Repository navigation
Deploy checklist: report which operated components a release changed (#1444) - #1446
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Fixes #1444
Part 1 of the approved design: detection only. Part 2, the approval-gated deploy, is #1445. Its input is this tool's
--json(schema 1). #1445 should auto-deploy only Lambdas withstatus: changedanddeploy_kind: code-only, usingfunctionsandbuild.What it does
scripts/deploychecklist(alsomake deploy-checklist FROM=... TO=...) reads both refs withgit archive, so the working tree is never touched. It makes no AWS calls.Lambdas. They are discovered from the deploy mechanisms using the same three rules as
scripts/lambda-deploy-census.sh: SAMlambda/*/template.yaml, any*.shthat runsaws lambda create-function|update-function-code, and Go deploys. Nothing is hardcoded. For each Lambda the tool compares, between the two refs:go list -depssays are compiled in, which can live in its own module or itsreplace ../..parent. That includes non-test Go, cgo/asm and//go:embedfiles, built with theGOOS,GOARCHand-tagsparsed from that mechanism's owngo buildline;go.mod/go.sumdiff (see below);godirective;Other deploy inputs. Each is its own
manualline item, again found by rule rather than from a list:file://documents those scripts apply;DynamoDB item writes (backfills) and EC2/EFS/FSx workload calls (smoke tests) are excluded.
Kinds.
code-onlymeans only compiled inputs changed.manualmeans anything else changed. A first deploy isaddedand a teardown isremoved, both manual.Errors. The tool fails loudly rather than guessing in three cases: a package error from
go list -e, a deploy script it cannot map to a package, or two mechanisms building one package for different targets.Release integration. There is a new
deploy-checklistjob inrelease.yaml.needsandcontinue-on-error: true, so it cannot block or reorder the release (spored publish, verify, GoReleaser).merge_commit_shais the tagged commit; checked against the API, that is Release v0.151.0 #1440 for v0.151.0 and Release v0.150.0 #1432 for v0.150.0. If there isn't exactly one, the job warns and leaves the checklist in the summary.contents: write.pull-requests: writeon this job'sGITHUB_TOKEN. There are no AWS credentials and no new secrets.Why module versions instead of go.mod/go.sum. Every nested module is tidy, so any dependency change that reaches a binary shows up as a version change. A raw diff of the root
go.modwould instead markpipeline-orchestrator, which lives in the root module, as changed on every Dependabot bump, even for modules it never links.Other files touched.
release_builds_test.go: the walk now stops at nested modules. The test is about commands "in this module", andscripts/is a separate module whose tool isgo runby the release workflow.internal/iamcoverage/principals_test.go: addsscripts/deploychecklistas a non-principal, since it calls no AWS API.Output for v0.150.0..v0.151.0
Deploy checklist: v0.150.0..v0.151.0
Operated components whose deploy inputs differ between
v0.150.0(ed74003) andv0.151.0(0fad91e), fromscripts/deploychecklist(#1444). code-only: only compiled inputs changed, so a code update ships it. manual: a script, template, policy or mapping changed; review and apply it by hand. Deploy from a clean checkout ofv0.151.0. How to read this: docs/infra-account.md, "Deploy checklist".Lambdas (4 of 9 need a deploy)
spawn-dashboard-api): changed, code-only(cd lambda/dashboard-api && ./deploy.sh [aws-profile])lambda/dashboard-api/scripts/deploy.shspawn-dashboard-websocket-processor): changed, code-only(cd lambda/dashboard-websocket-processor && ./deploy.sh <aws-profile> <websocket-api-id>)spawn-pipeline-orchestrator): changed, code-onlymake -C lambda/pipeline-orchestrator deployspawn-sweep-orchestrator): changed, code-onlyscripts/deploy-sweep-orchestrator.shUnchanged, no deploy:
lambda/cost-history-collector,lambda/dashboard-websocket,lambda/dns-updater,lambda/scheduler-handler,lambda/ttl-reaper.Other deploy inputs (4 of 26 changed, all manual)
lambda/dashboard-api/scripts/setup-all.sh[lambda/dashboard-api]: changed. runs lambda/dashboard-api/scripts/setup-dashboard-api-gateway.sh, lambda/dashboard-api/scripts/setup-dashboard-domain.sh(cd lambda/dashboard-api/scripts && ./setup-all.sh [aws-profile])lambda/dashboard-api/scripts/setup-dashboard-lambda-role.sh[lambda/dashboard-api]: changed. runs aws iam attach-role-policy, aws iam create-role, aws iam delete-policy, aws iam delete-policy-version, aws iam delete-role-policy, aws iam detach-role-policy, aws iam put-role-policy(cd lambda/dashboard-api && scripts/setup-dashboard-lambda-role.sh [aws-profile])lambda/dashboard-websocket/scripts/enable-streams.sh[lambda/dashboard-websocket]: changed. runs aws dynamodb update-table(cd lambda/dashboard-websocket/scripts && ./enable-streams.sh <aws-profile>)lambda/dashboard-websocket/scripts/setup-event-source-mappings.sh[lambda/dashboard-websocket]: changed. runs aws lambda create-event-source-mapping, aws lambda delete-event-source-mapping(cd lambda/dashboard-websocket/scripts && ./setup-event-source-mappings.sh <aws-profile>)Shipped with the CLI, no deploy
pkg/reaperdeploy: creates a Lambda from Go inside the spawn CLI (the self-hosted reaper, in the user's own account), so it ships with the CLI release, not as a spore.host deployAgainst the PR #1440 deploy record:
pkg/aws, pluspkg/launcherfor sweep. This is the case the first manual pass missed.dashboard-api: flagged code-only becausemodels.gochanged. The owner judged it behaviour-neutral, and the tool can't make that judgment.enable-streams.shandsetup-all.shchanged, but neither needed applying: they only dropped the deleted autoscale table and backfill step.Gates (each watched failing against a compiling revert)
TestGoFilesTestSyntheticRelease: reaperchanged, due toother_test.goandmain_test.gogit diff -- dir), docs includedTestSyntheticRelease: reaperchanged, due toREADME.mdgit diff -- lambda/mistake)TestV0151IsTheReleaseThatMotivatedThis(both orchestratorsunchanged) andTestSyntheticReleaselambda/(the #799 shape)TestDiscoveryAgreesWithTheCensus(4scripts/deploy-*.shmissing) andTestANewDeployMechanismIsSeenOrRefusedgo listpackage-error refusalTestAPackageErrorIsNotUnchangedTestV0151…: dashboard-api becomesmanual, and the role script is no longer its own line itemTestV0151…needs the real tags. CI's shallow checkout has none, so it skips there, andTestSyntheticReleasecovers the same shapes with a temp git repo. While writing this, the census flagged a comment indiscover.gothat spelled the Go SDK call. The census's Go-deploy discovery matches raw text, comments included. The comment is reworded.Checks
make check(from /private/tmp): passmake lint: 0 issues in all 10 modulesscripts/nested-modules.sh: passsemgrep scan --config=auto --error .: cleanactionlinton release.yaml: cleanmake check-docs: pass