Repository navigation
fix(ci): unbreak auto_deploy — container build, clippy, FCM test, staging CD vars - #386
Open
geekbrother wants to merge 3 commits into
Open
geekbrother wants to merge 3 commits into
geekbrother wants to merge 3 commits into
Conversation
Two of the three failures on main's auto_deploy, both from drift rather than
any commit:
build-container (Dockerfile and slim.Dockerfile) died in the chef stage:
error: failed to compile `cargo-chef v0.1.78`
feature `edition2024` is required ... not stabilized in this version
of Cargo (1.79.0)
`rust:buster` is frozen at Rust 1.79 (buster is EOL), while unpinned
`cargo install cargo-chef` resolves the newest release, whose clap_derive
needs edition 2024. Moved both files to bookworm and added --locked so the
tool's own lockfile pins its deps. Verified: the chef stage builds, giving
rustc 1.98.1 and cargo-chef 0.1.78, and bookworm carries the build packages
(protobuf-compiler, lld, llvm) and runtime libssl3.
Clippy failed on all three feature variants with 9 errors under -D warnings,
from lints in the newer floating stable: one unused `debug` import and eight
`useless_borrows_in_formatting` (a redundant & in a format! arg). Fixing
those surfaced two dead-code errors behind them: an empty unused `Error` enum
in the test harness, removed, and the whole context harness being unused
under default features — gated behind functional_tests, like its only
consumer, mod functional.
cargo clippy passes for all three variants and cargo fmt --check is clean.
The third failure (tenant_update_fcm_bad) is untouched: it needs a decision
on legacy FCM, since validation now fails open against Google's decommissioned
legacy API.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…oned Google decommissioned the legacy FCM HTTP API in June 2024. Probed directly: POST https://fcm.googleapis.com/fcm/send now answers 404 for every key, so update_fcm's dry-run check never sees FcmError::Unauthorized and its `_ => Ok(())` arm accepts anything. The assertion cannot be made to hold while legacy FCM is still offered. Failing closed instead was the obvious move and is wrong: tenant_update_fcm_ valid, tenant_enabled_providers and tenant_delete all post a legacy key from ECHO_TEST_FCM_KEY and assert success, and they pass only because validation falls open. Rejecting on any error turns one red test into four and makes legacy key registration impossible in production. So the test is ignored with its reason, and the validation site records what it no longer does: any key is accepted and stored, a suspended tenant is restored on it, and src/providers/fcm.rs sends through the same dead endpoint. Dropping legacy FCM for the v1 path is the real fix and a product decision. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
run-cd calls cd.yml, whose apply steps set TF_VAR_jwt_secret, TF_VAR_relay_public_key and TF_VAR_image_version — all ignored by TFC remote-execution runs, so the apply would fail on the two required variables exactly as the plan did before ci_terraform.yml was fixed. image_version is the subtle one: unset, coalesce() in main.tf falls back to the latest release rather than the image auto_deploy just built and pushed under github.sha. Applies the ci_terraform.yml treatment to the staging job and drops terraform/apply@1.0.3, which passes -var-file. Matches keys-server's sub-infra-apply.yml. deploy-infra-prod still needs the same change; it is skipped by auto_deploy (deploy_to_prod: false) so it does not block this run, and prod deploys stay broken exactly as they are today until it lands. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
arminx86-77616c
approved these changes
Sep 14, 2026
arminx86-77616c
left a comment
Contributor
There was a problem hiding this comment.
Thanks for putting the vars into apply.auto.tfvars.json
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Unbreaks
main'sauto_deploy(run 34381941835), which fails in three independent ways. None is caused by a commit — the same failures are in the pre-#384 run 34351560435, andrun-cdhas been skipped in every retained run, so nothing has deployed frommain.1.
build-container(both Dockerfiles)rust:busteris frozen at Rust 1.79 because Debian buster is EOL, while unpinnedcargo install cargo-chefresolves the newest release, whoseclap_deriveneeds edition 2024 — a moving dependency against a frozen toolchain. Both files move to bookworm (build and runtime stages together, so the binary and its libssl stay consistent) andcargo installgains--locked.2. Clippy (all three feature variants)
9 errors under
-D warningsfrom lints in the newer floating stable:unused import: debuginsrc/handlers/delete_fcm_v1.rs, and 8×useless_borrows_in_formatting(a redundant&in aformat!arg) insrc/error.rsandsrc/handlers/push_message.rs.Fixing those surfaced two dead-code errors queued behind the lib failure: an empty unreferenced
pub enum Error {}intests/context/server.rs, removed; and the wholecontextharness being unused under default features, now gated behindfunctional_teststo match its only consumer,mod functional.3.
tenant_update_fcm_badGoogle decommissioned the legacy FCM HTTP API in June 2024. Probed directly:
update_fcm.rsvalidates a legacy key with a dry-run send and maps onlyFcmError::UnauthorizedtoBadFcmApiKey; a 404 hits the_ => Ok(())arm, so every key is accepted. The assertion cannot hold while legacy FCM is offered.Failing closed is the obvious fix and is wrong:
tenant_update_fcm_valid,tenant_enabled_providersandtenant_deleteeach post a key fromECHO_TEST_FCM_KEYand assert success, passing only because validation falls open. Rejecting on any error turns one red test into four and makes legacy key registration impossible in production.The test is therefore ignored with its reason, and the validation site records what it no longer does: any key is accepted and stored, a suspended tenant is restored on it, and
src/providers/fcm.rssends through the same dead endpoint — so legacy FCM pushes are already failing in production. Dropping legacy FCM in favour of the v1 path is the real fix and a product decision, deliberately not made here.4. CD would have failed next
run-cdcallscd.yml, whose apply steps setTF_VAR_jwt_secret,TF_VAR_relay_public_keyandTF_VAR_image_version— all ignored by TFC remote-execution runs, so the apply would fail on the two required variables just as the plan did.image_versionis the subtle one: unset,coalesce()inmain.tffalls back to the latest release instead of the imageauto_deployjust pushed undergithub.sha. The staging job now injects them viaapply.auto.tfvars.jsonand applies inline, matchingci_terraform.ymland keys-server'ssub-infra-apply.yml.Important
deploy-infra-prodstill needs the identical change and is not included here. It is skipped byauto_deploy(deploy_to_prod: false), so it does not block this run; manual prod deploys stay broken exactly as they are today until it lands.Verification
cargo clippywith-D warningsfor--tests,--features=multitenant --tests, and--all-features --all-targets: cleancargo fmt --check: cleancargo test --features <the CI set> --test integration -- --list --ignored: exactly one ignored testdocker build -f Dockerfile ., all stages: exit 0 — chef, plan, release compile withmultitenant,analytics,cloud, and thebookworm-slimruntimeprotobuf-compiler,lld,llvm) and runtimelibssl3Note that no PR check builds the container:
build-containerexists only inauto_deploy.yml(push: main) andrelease.yml(workflow_dispatch). That is why the Dockerfile was verified locally, and arguably why this went unnoticed — a build-only PR job would have caught it at the commit that broke it.🤖 Generated with Claude Code