From 8819e6a0fbc301609794dae3427507ddb8645956 Mon Sep 17 00:00:00 2001 From: Aram Grigoryan <132480+aram356@users.noreply.github.com> Date: Wed, 26 Aug 2026 22:19:08 -0700 Subject: [PATCH 1/2] Fix rollback hint to reference a capture route that exists The run_rollback missing-target error told operators to use `deploy`'s `previous-version` output, but the CLI's production deploy emits only `version=` -- `previous-version` exists only as the deploy-fastly GitHub action's output, captured by running `active-version` before the deploy. An operator following the hint mid-incident found nothing to use. Reword the hint (and the matching --rollback-to doc comment) to name the real capture routes: run `active-version` before deploying, or wire the deploy-fastly action's `previous-version` output. Emitting `previous-version` from the CLI deploy itself was considered and rejected: it would make a pre-deploy Fastly API call mandatory, breaking the documented output-parsing path that works under manifest command overrides with dummy credentials, and a warn-and-continue capture would produce a line scripts cannot rely on. The action layer already captures the target fail-closed at the right place. Closes #350 --- crates/edgezero-cli/src/args.rs | 5 +++-- crates/edgezero-cli/src/lib.rs | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/crates/edgezero-cli/src/args.rs b/crates/edgezero-cli/src/args.rs index ddfdd1b9..63156914 100644 --- a/crates/edgezero-cli/src/args.rs +++ b/crates/edgezero-cli/src/args.rs @@ -381,8 +381,9 @@ pub struct RollbackArgs { /// Production only: the version to re-activate. Fastly exposes no /// metadata to tell a previously-live version from a staged one, so /// the rollback target CANNOT be inferred; it is captured before the - /// deploy that superseded it (see `deploy`'s `previous-version`) and - /// passed here. Required for a production rollback; ignored for staging. + /// deploy that superseded it (`active-version`, or the deploy-fastly + /// action's `previous-version` output) and passed here. Required for + /// a production rollback; ignored for staging. #[arg(long)] pub rollback_to: Option, /// Platform service id to roll back. Required. diff --git a/crates/edgezero-cli/src/lib.rs b/crates/edgezero-cli/src/lib.rs index 3205f87e..a617115b 100644 --- a/crates/edgezero-cli/src/lib.rs +++ b/crates/edgezero-cli/src/lib.rs @@ -516,8 +516,9 @@ pub fn run_rollback(args: &RollbackArgs) -> Result<(), String> { return Err( "a production rollback requires --rollback-to (the version to re-activate). Fastly \ exposes no metadata to infer it, so it must be captured before the deploy that \ - superseded it -- use `deploy`'s `previous-version` output. Pass --staging to \ - deactivate a staged version instead." + superseded it -- run `active-version` before deploying (the deploy-fastly GitHub \ + action does this and exposes it as its `previous-version` output). Pass --staging \ + to deactivate a staged version instead." .to_owned(), ); } From 389362b435bbb2eb91a26024ce34349781dac28c Mon Sep 17 00:00:00 2001 From: Aram Grigoryan <132480+aram356@users.noreply.github.com> Date: Mon, 31 Aug 2026 14:05:48 -0700 Subject: [PATCH 2/2] Polish rollback hint wording per review Address prk-Jr's non-blocking review findings on #352: - Name the output key: `active-version` prints `version=`, so an operator scripting the capture knows which line feeds --rollback-to. - Add a forward path for the operator reading the error mid-incident with no captured target: choose the target from the service's version history, since Fastly cannot identify it. - Rework the --rollback-to doc comment parenthetical so it no longer joins a command and an output name with one comma (renders in --help). - Add the CLI-native capture route to the CLI reference bullet, which named only the deploy-fastly Actions route. --- crates/edgezero-cli/src/args.rs | 6 +++--- crates/edgezero-cli/src/lib.rs | 7 ++++--- docs/guide/cli-reference.md | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/crates/edgezero-cli/src/args.rs b/crates/edgezero-cli/src/args.rs index 63156914..cc86e79c 100644 --- a/crates/edgezero-cli/src/args.rs +++ b/crates/edgezero-cli/src/args.rs @@ -381,9 +381,9 @@ pub struct RollbackArgs { /// Production only: the version to re-activate. Fastly exposes no /// metadata to tell a previously-live version from a staged one, so /// the rollback target CANNOT be inferred; it is captured before the - /// deploy that superseded it (`active-version`, or the deploy-fastly - /// action's `previous-version` output) and passed here. Required for - /// a production rollback; ignored for staging. + /// deploy that superseded it (run `active-version` before that deploy, + /// or wire the deploy-fastly action's `previous-version` output) and + /// passed here. Required for a production rollback; ignored for staging. #[arg(long)] pub rollback_to: Option, /// Platform service id to roll back. Required. diff --git a/crates/edgezero-cli/src/lib.rs b/crates/edgezero-cli/src/lib.rs index a617115b..cbe17c49 100644 --- a/crates/edgezero-cli/src/lib.rs +++ b/crates/edgezero-cli/src/lib.rs @@ -516,9 +516,10 @@ pub fn run_rollback(args: &RollbackArgs) -> Result<(), String> { return Err( "a production rollback requires --rollback-to (the version to re-activate). Fastly \ exposes no metadata to infer it, so it must be captured before the deploy that \ - superseded it -- run `active-version` before deploying (the deploy-fastly GitHub \ - action does this and exposes it as its `previous-version` output). Pass --staging \ - to deactivate a staged version instead." + superseded it -- run `active-version` (it prints `version=`) before deploying, \ + or wire the deploy-fastly GitHub action's `previous-version` output. If it was \ + never captured, choose the target from the service's version history -- Fastly \ + cannot identify it for you. Pass --staging to deactivate a staged version instead." .to_owned(), ); } diff --git a/docs/guide/cli-reference.md b/docs/guide/cli-reference.md index 37607371..65aaef4c 100644 --- a/docs/guide/cli-reference.md +++ b/docs/guide/cli-reference.md @@ -254,7 +254,7 @@ edgezero rollback --adapter --service-id --version [--rollback-t - `--adapter ` — target adapter (required). - `--service-id ` — platform service id to roll back (required). - `--version ` — the current (bad) version to roll back **from** (required; staging deactivates it). -- `--rollback-to ` — **production only:** the version to re-activate. Fastly cannot tell a previously-live version from a staged draft, so the target **cannot be inferred** — capture it before the superseding deploy (`deploy-fastly`'s `previous-version`) and pass it here. Required for a production rollback; ignored for staging. +- `--rollback-to ` — **production only:** the version to re-activate. Fastly cannot tell a previously-live version from a staged draft, so the target **cannot be inferred** — capture it before the superseding deploy (run [`active-version`](#edgezero-active-version), or use `deploy-fastly`'s `previous-version` output) and pass it here. Required for a production rollback; ignored for staging. - `--staging` — deactivate the staged version instead of activating `--rollback-to`. Reads the Fastly API token from `FASTLY_API_TOKEN` in the environment. A