Skip to content

Commit 5a5601e

Browse files
committed
Scrub process references from deploy-lifecycle code comments
Removes internal spec-section references (§5.4, 8.x, 9.x, 12.x), PR/round/finding markers (PR #269, Post-F4/F6, F1/F2), plan-phase labels (Stage 5/6), and test-doc severity prefixes from comments and user-facing strings in the files this branch touches. The explanatory content is preserved verbatim — only the process reference is dropped and the surrounding sentence re-flowed. Comments now describe what the code does, not which spec section or review round produced it. Two deliberate survivors: the raw-push error string points at the real design doc's §3.2.1 (a user-facing pointer, and asserted by tests), so it and its test assertions are left intact.
1 parent a426ee5 commit 5a5601e

10 files changed

Lines changed: 141 additions & 147 deletions

File tree

crates/edgezero-adapter-axum/src/cli.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ impl Adapter for AxumCliAdapter {
137137
match action {
138138
// The axum adapter is the in-process native dev server —
139139
// there is no remote auth provider to sign in/out of.
140-
// Per spec this is an explicit no-op.
140+
// This is an explicit no-op.
141141
AdapterAction::AuthLogin | AdapterAction::AuthLogout | AdapterAction::AuthStatus => {
142142
log::info!(
143143
"[edgezero] axum has no remote auth surface; `auth` is a no-op for this adapter"
@@ -147,12 +147,12 @@ impl Adapter for AxumCliAdapter {
147147
AdapterAction::Build => build(args),
148148
AdapterAction::Deploy => deploy(args),
149149
AdapterAction::Serve => serve(args),
150-
// The Fastly staging lifecycle (spec §5.4) is Fastly-only.
150+
// The Fastly staging lifecycle is Fastly-only.
151151
AdapterAction::DeployStaged
152152
| AdapterAction::EmitVersion
153153
| AdapterAction::Healthcheck
154154
| AdapterAction::Rollback => Err(format!(
155-
"axum adapter does not support the Fastly staging lifecycle action {action:?} (spec §5.4)"
155+
"axum adapter does not support the Fastly staging lifecycle action {action:?}"
156156
)),
157157
other => Err(format!("axum adapter does not support {other:?}")),
158158
}
@@ -191,7 +191,7 @@ impl Adapter for AxumCliAdapter {
191191
// Axum reads `.edgezero/local-config-<logical>.json`.
192192
// The platform name is informational here -- the env
193193
// overlay isn't used for local file paths because the
194-
// path encoding is the spec's canonical form.
194+
// path encoding is the canonical form.
195195
let logical = store.logical.as_str();
196196
out.push(format!(
197197
"axum config store `{logical}` reads `.edgezero/local-config-{logical}.json`; nothing to provision"
@@ -223,7 +223,7 @@ impl Adapter for AxumCliAdapter {
223223
// `string -> string` JSON object `AxumConfigStore` reads
224224
// back from `.edgezero/local-config-<id>.json`. The path
225225
// is keyed on the LOGICAL id, not the env-resolved
226-
// platform name -- the local file flow is the spec's
226+
// platform name -- the local file flow is the
227227
// canonical form and isn't subject to the per-store env
228228
// overlay (which targets platform store names, not local
229229
// file paths).
@@ -241,8 +241,8 @@ impl Adapter for AxumCliAdapter {
241241
.map_err(|err| format!("failed to create {}: {err}", local_dir.display()))?;
242242
// Upsert into any existing map so a `config push --key
243243
// app_config_staging` doesn't wipe a previously-pushed
244-
// `app_config` blob (spec 12.7 requires default + staging
245-
// to coexist for the `EDGEZERO__STORES__CONFIG__APP_CONFIG__KEY`
244+
// `app_config` blob (default + staging must coexist
245+
// for the `EDGEZERO__STORES__CONFIG__APP_CONFIG__KEY`
246246
// override to switch between them). The map is owned (rather
247247
// than borrowed) so we can merge old + new without lifetime
248248
// surgery on the slice.
@@ -598,7 +598,7 @@ fn find_axum_manifest(start: &Path) -> Result<PathBuf, String> {
598598
}
599599

600600
fn read_axum_project(manifest: &Path) -> Result<AxumProject, String> {
601-
// Per the spec hard-cutoff: only the canonical
601+
// Per the hard-cutoff: only the canonical
602602
// `EDGEZERO__ADAPTER__HOST` / `EDGEZERO__ADAPTER__PORT` env
603603
// vars are honoured. The pre-rewrite `EDGEZERO_HOST` /
604604
// `EDGEZERO_PORT` shim is gone -- the core runtime stopped
@@ -1415,7 +1415,7 @@ mod tests {
14151415
}
14161416
}
14171417

1418-
/// Spec 12.7: pushing two blobs under different keys (e.g.
1418+
/// Pushing two blobs under different keys (e.g.
14191419
/// `app_config` + `app_config_staging`) must leave both keys
14201420
/// readable so the runtime
14211421
/// `EDGEZERO__STORES__CONFIG__APP_CONFIG__KEY` override can

crates/edgezero-adapter-cloudflare/src/cli.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,12 @@ impl Adapter for CloudflareCliAdapter {
156156
}),
157157
AdapterAction::Deploy => deploy(args),
158158
AdapterAction::Serve => serve(args),
159-
// The Fastly staging lifecycle (spec §5.4) is Fastly-only.
159+
// The Fastly staging lifecycle is Fastly-only.
160160
AdapterAction::DeployStaged
161161
| AdapterAction::EmitVersion
162162
| AdapterAction::Healthcheck
163163
| AdapterAction::Rollback => Err(format!(
164-
"cloudflare adapter does not support the Fastly staging lifecycle action {action:?} (spec §5.4)"
164+
"cloudflare adapter does not support the Fastly staging lifecycle action {action:?}"
165165
)),
166166
other => Err(format!("cloudflare adapter does not support {other:?}")),
167167
}

crates/edgezero-adapter-fastly/src/cli.rs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,10 @@ const RUNTIME_ENV_STAGING_STORE: &str = "edgezero_runtime_env_staging";
137137

138138
/// Env var carrying the Fastly API token (read by the Fastly CLI and
139139
/// forwarded to the Fastly API via the `Fastly-Key` header). Part of
140-
/// the Fastly staging lifecycle (deploy-github-action spec §5.4).
140+
/// the Fastly staging lifecycle.
141141
const FASTLY_API_TOKEN_ENV: &str = "FASTLY_API_TOKEN";
142142
/// Env var carrying the default Fastly service id, used when
143-
/// `--service-id` is not passed explicitly (spec §5.4).
143+
/// `--service-id` is not passed explicitly.
144144
const FASTLY_SERVICE_ID_ENV: &str = "FASTLY_SERVICE_ID";
145145

146146
/// Flags `fastly compute update` accepts that take a VALUE (either
@@ -264,7 +264,7 @@ impl Adapter for FastlyCliAdapter {
264264
}
265265
AdapterAction::Deploy => deploy(args),
266266
AdapterAction::Serve => serve(args),
267-
// Fastly staging lifecycle (deploy-github-action spec §5.4).
267+
// Fastly staging lifecycle.
268268
AdapterAction::DeployStaged => deploy_staged(args),
269269
AdapterAction::EmitVersion => emit_active_version(args),
270270
AdapterAction::Healthcheck => healthcheck(args),
@@ -1049,8 +1049,8 @@ fn write_fastly_local_config_store(
10491049

10501050
// Upsert into the existing per-store contents table so a
10511051
// `config push --key app_config_staging` does NOT wipe the
1052-
// previously-pushed `app_config` blob. Spec 12.7 requires
1053-
// default + staging keys to coexist so the runtime
1052+
// previously-pushed `app_config` blob. The
1053+
// default + staging keys must coexist so the runtime
10541054
// EDGEZERO__STORES__CONFIG__APP_CONFIG__KEY env var can
10551055
// switch between them. (Earlier wholesale-replace was a
10561056
// misread of the "stale entries don't linger" property:
@@ -1705,7 +1705,7 @@ pub fn serve(extra_args: &[String]) -> Result<(), String> {
17051705
}
17061706

17071707
// ===================================================================
1708-
// Fastly staging lifecycle (deploy-github-action spec §5.4)
1708+
// Fastly staging lifecycle
17091709
// ===================================================================
17101710
//
17111711
// These entry points back the `deploy --stage`, `healthcheck`, and
@@ -1721,7 +1721,7 @@ pub fn serve(extra_args: &[String]) -> Result<(), String> {
17211721
// * rollback → activate `<v>-1` (production) or deactivate
17221722
// `<v>` (staging) via the Fastly API.
17231723
//
1724-
// **Version-output contract (spec §5.4.2):** deploy/stage print a
1724+
// **Version-output contract:** deploy/stage print a
17251725
// single `version=<N>` line to stdout (via `log::info!`, which the CLI
17261726
// logger emits verbatim). The `deploy-fastly` action greps that line
17271727
// to surface `fastly-version`. Rollback prints `rolled-back-to=<N>`.
@@ -1865,7 +1865,7 @@ fn last_version_after(lower: &str, marker: &str, terminator: char) -> Option<u64
18651865
/// Parse a Fastly service version out of Fastly CLI output, accepting
18661866
/// ONLY the shapes the CLI actually emits, in precedence order:
18671867
///
1868-
/// 1. Our canonical `version=<N>` contract line (spec §5.4.2).
1868+
/// 1. Our canonical `version=<N>` contract line.
18691869
/// 2. The CLI's success line, whose Go format string is
18701870
/// `"Updated package (service %s, version %v)"` (and
18711871
/// `"Deployed package (...)"` for `compute deploy`) — matched as
@@ -2252,7 +2252,7 @@ fn resolve_manifest_dir(args: &[String]) -> Result<PathBuf, String> {
22522252
.ok_or_else(|| "fastly manifest has no parent directory".to_owned())
22532253
}
22542254

2255-
/// `deploy --adapter fastly --service-id <id> --stage` (spec §5.4):
2255+
/// `deploy --adapter fastly --service-id <id> --stage`:
22562256
/// build, upload to a new draft version (no activation), stage it, and
22572257
/// emit `version=<N>`.
22582258
fn deploy_staged(args: &[String]) -> Result<(), String> {
@@ -2490,7 +2490,7 @@ fn relink_runtime_env_for_staging(
24902490
Ok(())
24912491
}
24922492

2493-
/// Production companion to `deploy` (spec §5.4.2): resolve the active
2493+
/// Production companion to `deploy`: resolve the active
24942494
/// service version via the Fastly API and emit `version=<N>`.
24952495
fn emit_active_version(args: &[String]) -> Result<(), String> {
24962496
let service_id = resolve_service_id(args)?;
@@ -2504,7 +2504,7 @@ fn emit_active_version(args: &[String]) -> Result<(), String> {
25042504
Ok(())
25052505
}
25062506

2507-
/// `healthcheck --adapter fastly ...` (spec §5.4): probe the domain
2507+
/// `healthcheck --adapter fastly ...`: probe the domain
25082508
/// (production) or the version's staging IP (`--staging`), retrying up
25092509
/// to `--retry` times. Emits `status-code` / `healthy` and returns
25102510
/// `Err` (non-zero exit) when unhealthy after retries.
@@ -2596,7 +2596,7 @@ fn curl_status(args: &[String]) -> Result<u16, String> {
25962596
})
25972597
}
25982598

2599-
/// `rollback --adapter fastly ...` (spec §5.4): production activates
2599+
/// `rollback --adapter fastly ...`: production activates
26002600
/// `<version> - 1`; staging deactivates `<version>`.
26012601
fn rollback(args: &[String]) -> Result<(), String> {
26022602
let service_id = resolve_service_id(args)?;
@@ -2664,7 +2664,7 @@ mod tests {
26642664
// `edgezero_core::test_env`; the merge with edition-2024 main replaced our
26652665
// local copy with it (its `set_var` calls are wrapped for 2024's unsafe-env).
26662666

2667-
// ── Fastly staging lifecycle helpers (spec §5.4) ──────────────────
2667+
// ── Fastly staging lifecycle helpers ──────────────────────────────
26682668

26692669
#[test]
26702670
fn arg_value_reads_flag_value() {
@@ -2825,7 +2825,7 @@ mod tests {
28252825
}
28262826
}
28272827

2828-
// ── healthcheck / rollback input validation (spec §5.4) ───────────
2828+
// ── healthcheck / rollback input validation ───────────────────────
28292829
//
28302830
// GitHub Actions' `required: true` does NOT fail when an input is
28312831
// omitted or empty, so the CLI is the real guard. An absent / empty /
@@ -3025,7 +3025,7 @@ mod tests {
30253025
parse_fastly_version("\nSUCCESS: Updated package (service SU1Z0, version 42)\n"),
30263026
Some(42)
30273027
);
3028-
// Our canonical contract line (spec §5.4.2).
3028+
// Our canonical contract line.
30293029
assert_eq!(parse_fastly_version("version=12"), Some(12));
30303030
// The --autoclone notice, when no success line is present.
30313031
assert_eq!(
@@ -3488,7 +3488,7 @@ mod tests {
34883488

34893489
#[test]
34903490
fn setup_block_present_true_when_only_setup_exists() {
3491-
// Post-F6 (PR #269 round 2): `setup_block_present` only
3491+
// `setup_block_present` only
34923492
// checks `[setup.<kind>_stores.<id>]`. The pre-fix check
34933493
// ALSO required `[local_server.<kind>_stores.<id>]`, but
34943494
// writing an empty `[local_server.*]` table didn't match
@@ -3530,7 +3530,7 @@ mod tests {
35303530
after.contains("[setup.kv_stores.sessions]"),
35313531
"setup table added: {after}"
35323532
);
3533-
// Post-F6: no `[local_server.*]` write — that empty stanza
3533+
// No `[local_server.*]` write — that empty stanza
35343534
// didn't satisfy fastly's local-server schema and made
35353535
// `fastly compute serve` error or skip the store. Local-
35363536
// server seeding is now `config push --adapter fastly
@@ -4664,7 +4664,7 @@ build = \"cargo build --release\"
46644664
);
46654665
}
46664666

4667-
/// Spec 12.7: pushing two blobs under different root keys
4667+
/// Pushing two blobs under different root keys
46684668
/// (e.g. `app_config` + `app_config_staging`) must leave both
46694669
/// keys readable from the local fastly.toml so the runtime
46704670
/// `EDGEZERO__STORES__CONFIG__APP_CONFIG__KEY` override can
@@ -5082,14 +5082,14 @@ build = \"cargo build --release\"
50825082
);
50835083
}
50845084

5085-
/// Spec 12.3 + 9.3: a second oversized push must converge the
5085+
/// A second oversized push must converge the
50865086
/// runtime on the NEW envelope — chunk keys are content-addressed
50875087
/// by the full-envelope SHA, so push B writes a new chunk-set and
50885088
/// installs a new root pointer.
50895089
///
50905090
/// The local fastly.toml writer upserts per-key (so a sibling
5091-
/// `--key app_config_staging` push leaves `app_config` intact per
5092-
/// spec 12.7). Within the SAME root key, old chunks for envelope
5091+
/// `--key app_config_staging` push leaves `app_config` intact).
5092+
/// Within the SAME root key, old chunks for envelope
50935093
/// A remain in the contents table after envelope B's push — they're
50945094
/// unreferenced (the root pointer at `app_config` now names B's
50955095
/// chunks), matching the remote Fastly behaviour where the
@@ -5111,7 +5111,7 @@ build = \"cargo build --release\"
51115111

51125112
// First push: envelope A. Records the chunk-key set so we can
51135113
// confirm they survive the second push (no garbage collection
5114-
// in v1 — spec 9.3 + Q6).
5114+
// in v1).
51155115
let envelope_a = make_test_envelope(FASTLY_CONFIG_ENTRY_LIMIT.saturating_add(1));
51165116
FastlyCliAdapter
51175117
.push_config_entries_local(

0 commit comments

Comments
 (0)