Skip to content

Move the deploy pipelines' multi-line steps into tested scripts - #763

Merged
anth-volk merged 6 commits into
mainfrom
ci-scripts-deploy
Oct 14, 2026
Merged

anth-volk merged 6 commits into
mainfrom
ci-scripts-deploy

Conversation

@anth-volk

@anth-volk anth-volk commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #761

Same-Repository Draft PR Check

  • This PR is a draft.
  • This PR is from a branch in PolicyEngine/policyengine-sim-api, not a personal fork.

Summary

Phase 1 step 1.7, part 2: the production deploy pipelines (simulation-deploy.reusable.yml, simulation-deploy.yml). Stacked on the part 1 PR.

Every multi-line block that predates #743 and #744 is fixed. Those two PRs merged to main after this one was written; see After rebasing onto #743 and #744 below.

Moved into tested scripts:

Step Script
Capture stable service state cloud-run-simulation-entry-stable-state.sh
Resolve exact candidate metadata cloud-run-simulation-entry-candidate.sh
Select the v2 application name stage12-v2-application-name.sh
Validate v2 workers stage12-validate-v2-workers.sh
Stage 12 result check stage12-deployment-ready.sh
Deployment result check simulation-deployment-ready.sh

Other changes:

  • Build and push the entrypoint image are now separate steps. If the build fails, the push is still skipped.
  • Four backslash-continued commands are now single lines.
  • The executor app name is a one-line echo.
  • Fixed after review: the stage12_v2_ready and deployment_ready jobs now check out the repository before running their scripts. Without the checkout, both gates would have failed every deployment. A test checks that every job running a repository script checks it out first.

Behaviour is unchanged, apart from the checkout fix above. A PyYAML comparison of the old and new workflows shows identical job if/needs/env/outputs/permissions/environment and identical step id/if/working-directory. The only env: change adds ENTRYPOINT_SERVICE: ${{ inputs.entrypoint_service }} to the two Cloud Run steps. Each script body equals the old inline code, with ${{ inputs.* }} replaced by a variable.

Points to review:

  • The scripts add set -u; every variable they read comes from env: or the runner.
  • The v2-validation script now rejects an empty Modal environment. That input is required, so this can't happen in practice.
  • Two scripts keep #!/bin/bash, because an existing executor test requires it for modal-*/simulation-* scripts.

After rebasing onto #743 and #744:

Testing

🤖 Generated with Claude Code

@anth-volk
anth-volk added this pull request to stack #755 October 12, 2026 20:30
@anth-volk
anth-volk force-pushed the ci-scripts-deploy branch 3 times, most recently from 514a55c to 9a3c0d6 Compare October 14, 2026 14:47
@anth-volk
anth-volk force-pushed the ci-scripts-deploy branch 4 times, most recently from 24782e9 to 77d4972 Compare October 14, 2026 20:14
Base automatically changed from ci-scripts-exceptions to main October 14, 2026 21:43
anth-volk and others added 6 commits October 15, 2026 01:43
deploy_entrypoint now captures the stable service state and resolves the
candidate metadata with cloud-run-simulation-entry-stable-state.sh and
cloud-run-simulation-entry-candidate.sh. Their bodies are the former inline
shell unchanged, except that the service name comes from the step's env:
instead of an interpolated expression; the $GITHUB_OUTPUT names and values,
step ids and job outputs are unchanged. Tests run them against fake gcloud
output with the real jq. Building and pushing the image become two
single-line steps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The UK private-data credential sync was one backslash-continued command and
is now one line. The executor app name step substitutes the version inside
its single echo instead of through a temporary variable; the output is the
same for any version string.

This commit originally also moved the update_routing "Publish active
routing state" step into a tested modal-publish-routing.sh. #744 replaced
that step on main with journaled plan, record and publish steps whose
tests read the inline run: text, so those steps stay inline and baselined,
and the script and its tests are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
deploy_stage12_v2 now selects the v2 application name and validates the
deployed workers with stage12-v2-application-name.sh and
stage12-validate-v2-workers.sh, and stage12_v2_ready checks the job results
with stage12-deployment-ready.sh. Their bodies are the former inline shell,
so they write the same name= and file= outputs, and a failing bundle lookup
or validation still fails the step before anything is written. Tests cover
the outputs, the exact uv calls, the failure paths and every combination of
requested and skipped Stage 12 jobs.

The packaged-bundle validation and the v2 manifest publication were one
backslash-continued command each and are now one line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
deployment_ready now runs simulation-deployment-ready.sh, the former inline
checks unchanged: every phase must succeed, the promotion must succeed
when requested and be skipped otherwise, and an existing-stack deployment
also needs a successful routing job and a finalize_routing run whose
outcome is completed (the checks #744 added). Tests cover each
combination; the existing guard test now finds the result checks in the
script and the results in the step's env:, and #744's gate tests run the
step from the repository root. The deployment summary call was one
backslash-continued command and is now one line.

That removes the last multi-line run: block this stack inherited from
before #743 and #744. The 13 blocks those PRs added stay in the
sim.ci.multiline-run-is-script baseline, so the rule stays ratcheted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
stage12_v2_ready and deployment_ready now call stage12-deployment-ready.sh
and simulation-deployment-ready.sh, but neither job checked out the
repository, so on a runner the scripts would not exist and both gates
would fail every deployment. Check out first in both jobs, and test that
every job in the reusable deploy workflow checks out before it runs a
repository script.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@anth-volk
anth-volk marked this pull request as ready for review October 14, 2026 21:52
@anth-volk
anth-volk requested a review from a team as a code owner October 14, 2026 21:52
@anth-volk
anth-volk merged commit 511619d into main Oct 14, 2026
13 checks passed
@anth-volk
anth-volk deleted the ci-scripts-deploy branch October 14, 2026 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move the deploy pipeline's multi-line steps into tested scripts

1 participant