Upgrade EdgeZero to v0.0.7 and complete staging runtime integration - #940
Upgrade EdgeZero to v0.0.7 and complete staging runtime integration#940aram356 wants to merge 32 commits into
Conversation
Point the edgezero-* dependencies at the feature/edgezero-deploy-actions branch (PR #316) and adapt Trusted Server to its API changes: - Wire the new ts CLI subcommands surfaced by edgezero-cli: active-version, healthcheck, and rollback, plus deploy --stage and a --version flag, with argument-parsing coverage. - Migrate TrustedServerAppConfig to the AppConfigMeta::secret_fields() method that replaces the removed SECRET_FIELDS associated constant.
Status update — P0/P1 trackingHead: `96dd1f72` (main merged in twice since the original commit; edgezero dep unchanged, no conflicts). P0.2 — CI + output-line contract
P1.3 — edgezero library ↔ action lockstep (recorded pair)The `ts` CLI is built from this repo's `Cargo.toml` (edgezero library rev), and the deployer separately pins `stackpop/edgezero/.github/actions/deploy-fastly@` (edgezero action ref). These MUST be the same edgezero commit so library and action can't diverge.
P0.1 — re-pin off the moving branch (blocker, still open)edgezero #316 is not yet merged and no new tag exists. Cannot re-pin until it lands; PR stays draft until then. |
Re-resolve the six edgezero-* deps from 145f1699 to bb441162 (current tip of feature/edgezero-deploy-actions, PR #316). The deploy staging flag was renamed there from --stage to --staging, standardizing on the same verb healthcheck/rollback/config-push already use; update the deploy CLI parse test to match. No production dispatch change is needed — ts passes the edgezero-cli arg structs through, so the renamed flag is picked up automatically.
Re-resolve the six edgezero-* deps from bb441162 to 908e229a (current tip of feature/edgezero-deploy-actions, PR #316), and adapt the ts CLI to its surface changes: - Wire the new `ts config gc` subcommand (reclaims orphaned config-store chunk entries) to edgezero_cli::run_config_gc, with parse coverage for the preview default, destructive --yes/--older-than sweep, and the --dry-run/--yes conflict. - Lock the hardened deploy staging behavior: --stage was renamed to --staging and deploy passthrough is now last=true, so a stray --stage fails closed at parse time instead of routing a staging-intended deploy to production. Add tests for the rejection and for post---- passthrough capture.
…ain sync) with the #940 re-merge
Re-resolve the six edgezero-* deps from 908e229a to 5f3d648c (current tip of feature/edgezero-deploy-actions, PR #316). The upstream change is an internal review-addressing pass (redact config-store errors, fix version parse, log cleanup, docs) confined to the Fastly adapter CLI; no ts CLI surface change, so no run.rs adaptation is needed.
prk-Jr
left a comment
There was a problem hiding this comment.
Summary
Tight, well-tested upgrade: six edgezero deps repointed at the deploy-actions branch, SECRET_FIELDS migrated to secret_fields(), and the new active-version / healthcheck / rollback / config gc subcommands wired through with argument-parsing coverage for each. Dispatch is a clean passthrough and every new command has a doc comment. Two things block: the dependency reference is mutable while upstream #316 is still open, and the operator docs weren't updated for the new (partly destructive) surface.
Blocking
🔧 wrench
-
Mutable
branch =dep on an unmerged upstream PR (Cargo.toml:57-62): upstreamstackpop/edgezero#316is confirmedopen/merged: false, but this PR isisDraft: falseandMERGEABLE. See the inline comment for therevpin suggestion. -
docs/guide/cli.mdnot updated for the new CLI surface: four subcommands ship undocumented —active-version,healthcheck,rollback, andconfig gc.config gcis the one that matters most: with--yesand--older-thanit destructively sweeps config-store entries, and the only place its semantics are written down right now is a one-line clap doc string and three parse tests. The "Lifecycle commands" block (docs/guide/cli.md:79-90) and "Configuration commands" block (:43-77) both enumerate the available commands, so they read as complete and are now silently wrong.The same file also carries a version claim that this PR invalidates (
docs/guide/cli.md:67-70):EdgeZero v0.0.4 only overrides leaves already present in the TOML; add newly introduced fields to existing configs before relying on their overrides.
The dependency is no longer v0.0.4. Either confirm the behavior still holds on the new tree and drop the version qualifier, or update it to whatever gets pinned at merge time.
Non-blocking
🤔 thinking
- Unrelated dependency downgrades in the lock refresh (
Cargo.lock):windows-sys 0.61.2 → 0.48.0anditertools 0.13.0 → 0.10.5. Details and a scopedcargo updateinline.
🌱 seedling
ts --versioncan't identify the embedded edgezero (crates/trusted-server-cli/src/run.rs:16): follow-up, not this PR.
📝 note
secret_fields()port (crates/trusted-server-core/src/config.rs:115): mechanical and correct; the empty-set caveat above it is unchanged.
👍 praise
deploy_rejects_renamed_stage_flag_before_separator(crates/trusted-server-cli/src/run.rs:306): catches a silent staging→production routing hazard created by the upstream flag rename pluslast = truepassthrough.
CI Status
All 19 checks green on fe5767e — reported from GitHub, not re-run locally:
- fmt: PASS
- clippy (fastly / axum / cloudflare native + wasm / spin native + wasm): PASS
- rust tests (core, axum, cloudflare, spin, ts CLI, cross-adapter parity): PASS
- integration + browser integration + Fastly EC lifecycle: PASS
- js tests (vitest) / format-typescript / format-docs: PASS
- CodeQL (actions, javascript-typescript, rust): PASS
Replace the mutable branch = "feature/edgezero-deploy-actions" reference with rev = "5f3d648c", the exact commit the lockfile already resolved, so cargo update or an unlocked resolve cannot silently retarget the branch tip. Rebuild the lock from main with a scoped update of the six edgezero packages. The re-resolve of the edgezero subtree unifies wide version ranges onto co-present lower majors (prost-build/prost-derive onto itertools 0.10.5, colored/winapi-util onto windows-sys 0.48.0); restore those five dependency edges to main's picks so the only non-edgezero lock changes are syn 3.0.3 and toml_edit 0.25.12, both required by the new edgezero tree. Verified with cargo metadata/check --locked and the host CLI test suite.
Cover active-version, healthcheck, rollback, deploy --staging with the -- passthrough boundary, and the destructive config gc surface (preview default, --yes with a required --older-than window, and gc's different --no-env meaning). Drop the stale EdgeZero v0.0.4 qualifier from the env-overlay note; the leaves-only behavior is unchanged at the pinned rev.
The dependency is no longer pinned at v0.0.4. The leaves-only overlay behavior is unchanged at the pinned rev (apply_env_overlay still only overrides keys already present in the parsed tree), so keep the behavior claims and remove the version qualifier.
# Conflicts: # crates/trusted-server-cli/tests/config_env_overlay.rs # crates/trusted-server-core/src/config.rs # docs/guide/cli.md
stackpop/edgezero#316 was squash-merged and released as v0.0.6, so the six deps move from the interim rev = "5f3d648c" pin to tag = "v0.0.6" (c8d6e414). The squash makes this different bytes rather than a mechanical reference swap: the CLI argument surface is byte-identical to the prior pin, the documented behaviors (healthcheck attempts clamp, staging selector-only mirror, leaves-only env overlay) were re-verified at the tag, and the full local gate list was re-run. The lock is rebuilt from main with a scoped update and the five resolver-unified edges restored; the only non-edgezero changes are syn 3.0.4 and toml_edit 0.25.12.
…-upgrade # Conflicts: # crates/trusted-server-cli/tests/config_env_overlay.rs
Apply review round 4: capture the production rollback target with active-version before deploying (nothing emits it afterwards), label the lifecycle trio Fastly-only, state where healthcheck's <version> comes from, name --store alongside --no-env as a way a destructive gc sweep can retarget, and present the deploy -- separator as the migration it is. Document the staging config limitation honestly: a staged version currently loads the production blob because the Fastly entry point does not read the version-linked edgezero_runtime_env selectors. The non-hack fix needs edgezero to expose its runtime-env loader as public API, filed as stackpop/edgezero#349 with the downstream wiring tracked in #1082; the stale previous-version rollback hint is stackpop/edgezero#350. Add parse coverage for config gc --store.
|
Need to merge stackpop/edgezero#351 and stackpop/edgezero#352 |
# Conflicts: # Cargo.lock # Cargo.toml
|
Approved, and no objection to the upgrade itself. One sequencing note before it lands. This PR changes If the stack can't be merged quickly and #940 needs to go first, the alternative we suggested to Rowena, Jason and Shailley is a release branch model: keep the current live branch and the next release branch in sync, so both sets of changes land without either blocking the other. Either order works for us. Flagging it now so whoever merges first knows the other is coming. |
…-upgrade # Conflicts: # trusted-server.example.toml
This PR Iis currently blocking deployment workflows for active prospects, so holding it behind the provider stack would have a direct customer impact. |
Summary
Upgrades all six EdgeZero workspace dependencies from
v0.0.4tov0.0.7and completes the Trusted Server integration for the full release delta.edgezero-adapter-{axum,cloudflare,fastly,spin},edgezero-cli, andedgezero-coretotag = "v0.0.7"(5c9886e5). The lockfile update is scoped to the EdgeZero tree; the required non-EdgeZero additions aresyn 3andtoml_edit 0.25.trusted_server_configstore metadata and addEnvConfig-aware store-name/key selectors while retaining the existing native default helpers.runtime_env_config(TrustedServerApp::stores())once in the Fastly entry point and reuse it for the JA4 settings read, physical store open, application construction, and both fallback settings reloads.trusted_server_configfrom thetrusted_server_configphysical store, while staged versions can selecttrusted_server_config_stagingthrough the version-linkededgezero_runtime_envstore. Physical store-name overrides remain independent of key selection.TrustedServerAppConfigto the v0.0.7AppConfigMeta::secret_fields()API.v0.0.4 to v0.0.7 audit
The upstream functional changes were audited through the v0.0.7 tag:
ts config gc, including preview/destructive gates, age filtering,--store, and--no-envtargeting behavior.CLI coverage
Every downstream operational EdgeZero handler is exposed by
ts:tssurfaceactive-versionrun_active_versionauthrun_authbuildrun_buildconfig diffrun_config_diff_typed::<TrustedServerAppConfig>config gcrun_config_gcconfig pushrun_config_push_typed::<TrustedServerAppConfig>config validaterun_config_validate_typed::<TrustedServerAppConfig>deployrun_deployhealthcheckrun_healthcheckprovisionrun_provisionrollbackrun_rollbackserverun_serveTrusted Server's own
audit,config init,prebid, anddevcommands remain intact.ts newis intentionally not included. EdgeZero's feature-gated contributor-only demo server is not a downstream CLI operation and is not enabled.Argument coverage includes the remaining proof gaps from the v0.0.4→v0.0.7 audit:
healthcheck --path,config gc --store, andconfig gc --no-env, in addition to retry/staging/rollback/destructive-GC behavior.Verification
Self-review and an independent code review found no remaining critical, important, or minor issues. The final branch passes:
cargo fmt --all -- --check, andgit diff --check.cargo test-fastlyrun passed 166 adapter tests, 2,257 core tests (6 expected ignores), 2 JS bridge tests, 21 OpenRTB tests, and 3 doctests (4 expected ignores).Explicit exclusions
ts newcommand..github/workflowschanges.Closes #939
Closes #1082