Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 1 addition & 85 deletions .github/workflows/simulation-deploy.reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1218,78 +1218,6 @@ jobs:
MODAL_ENVIRONMENT: ${{ inputs.modal_environment }}
run: ../../.github/scripts/stage12-v2-default-restore.sh

staging_household_check:
name: Calculate the staging household through the candidate
# Every staging deployment calculates the stored staging household that
# the beta variable SIMULATION_STAGING_HOUSEHOLD_ID names, through the
# candidate's household routes, and requires its household job to
# succeed. The routes use only the v2 manifest's default worker, so the
# check runs after the default has moved to the release's worker (or, in
# a deployment without Stage 12, with the default as it is). It calls the
# tagged candidate URL, which serves this release's revision whether or
# not it was promoted. The job's call writes a household_jobs row in the
# staging database, which the household function completes.
if: >-
${{
!cancelled() &&
inputs.deployment_environment == 'staging' &&
needs.deploy_entrypoint.result == 'success' &&
needs.authenticated_test.result == 'success' &&
((inputs.deploy_stage12_v2 && needs.publish_stage12_v2_default.result == 'success') ||
(!inputs.deploy_stage12_v2 && needs.publish_stage12_v2_default.result == 'skipped'))
}}
needs: [deploy_entrypoint, authenticated_test, publish_stage12_v2_default]
runs-on: ubuntu-latest
environment: ${{ inputs.release_environment }}
steps:
- uses: actions/checkout@v6

- name: Calculate the staging household and require it to succeed
env:
STAGING_HOUSEHOLD_ID: ${{ vars.SIMULATION_STAGING_HOUSEHOLD_ID }}
SIMULATION_TEST_AUTH_ISSUER: ${{ secrets.SIMULATION_ENTRYPOINT_AUTH_ISSUER }}
SIMULATION_TEST_AUTH_AUDIENCE: ${{ secrets.SIMULATION_ENTRYPOINT_AUTH_AUDIENCE }}
SIMULATION_TEST_AUTH_CLIENT_ID: ${{ secrets.SIMULATION_ENTRYPOINT_TEST_AUTH_CLIENT_ID }}
SIMULATION_TEST_AUTH_CLIENT_SECRET: ${{ secrets.SIMULATION_ENTRYPOINT_TEST_AUTH_CLIENT_SECRET }}
run: .github/scripts/simulation-staging-household-check.sh "${{ needs.deploy_entrypoint.outputs.candidate_url }}"

staging_economy_check:
name: Create a staging economy report through the candidate
# Every staging deployment creates a small economy report, current law
# against current law for Wales in 2026, through the candidate's
# POST /reports, and requires its run to succeed. The routes use only
# the v2 manifest's default worker, so the check runs after the default
# has moved to the release's worker (or, in a deployment without Stage
# 12, with the default as it is). It calls the tagged candidate URL,
# which serves this release's revision whether or not it was promoted.
# The report's rows are written in the staging database, and its
# coordinator records the run. Once a .py version's first check has
# succeeded, later checks on it reuse those simulation runs.
if: >-
${{
!cancelled() &&
inputs.deployment_environment == 'staging' &&
needs.deploy_entrypoint.result == 'success' &&
needs.authenticated_test.result == 'success' &&
((inputs.deploy_stage12_v2 && needs.publish_stage12_v2_default.result == 'success') ||
(!inputs.deploy_stage12_v2 && needs.publish_stage12_v2_default.result == 'skipped'))
}}
needs: [deploy_entrypoint, authenticated_test, publish_stage12_v2_default]
runs-on: ubuntu-latest
# Longer than the script's own 30-minute deadline, so the script fails first.
timeout-minutes: 40
environment: ${{ inputs.release_environment }}
steps:
- uses: actions/checkout@v6

- name: Create the staging economy report and require its run to succeed
env:
SIMULATION_TEST_AUTH_ISSUER: ${{ secrets.SIMULATION_ENTRYPOINT_AUTH_ISSUER }}
SIMULATION_TEST_AUTH_AUDIENCE: ${{ secrets.SIMULATION_ENTRYPOINT_AUTH_AUDIENCE }}
SIMULATION_TEST_AUTH_CLIENT_ID: ${{ secrets.SIMULATION_ENTRYPOINT_TEST_AUTH_CLIENT_ID }}
SIMULATION_TEST_AUTH_CLIENT_SECRET: ${{ secrets.SIMULATION_ENTRYPOINT_TEST_AUTH_CLIENT_SECRET }}
run: .github/scripts/simulation-staging-economy-check.sh "${{ needs.deploy_entrypoint.outputs.candidate_url }}"

finalize_routing:
name: Finalize the Modal routing publication
# Finish the durable journal after every gate, including failed uploads
Expand Down Expand Up @@ -1348,7 +1276,7 @@ jobs:
# The reporter only reads job results. Journal completion happens before
# it, so a failure or cancellation here cannot strand a publication.
if: ${{ !cancelled() }}
needs: [deploy_entrypoint, update_routing, integration, authenticated_test, promote_entrypoint, publish_latest, finalize_routing, publish_stage12_v2_default, staging_household_check, staging_economy_check]
needs: [deploy_entrypoint, update_routing, integration, authenticated_test, promote_entrypoint, publish_latest, finalize_routing, publish_stage12_v2_default]
runs-on: ubuntu-latest
defaults:
run:
Expand Down Expand Up @@ -1377,18 +1305,6 @@ jobs:
DEFAULT_RESULT: ${{ needs.publish_stage12_v2_default.result }}
run: .github/scripts/stage12-v2-default-ready.sh

- name: Check the staging household check result
env:
REQUESTED: ${{ inputs.deployment_environment == 'staging' }}
CHECK_RESULT: ${{ needs.staging_household_check.result }}
run: .github/scripts/simulation-staging-household-ready.sh

- name: Check the staging economy check result
env:
REQUESTED: ${{ inputs.deployment_environment == 'staging' }}
CHECK_RESULT: ${{ needs.staging_economy_check.result }}
run: .github/scripts/simulation-staging-economy-ready.sh

cleanup_entrypoint_revisions:
name: Remove superseded Cloud Run revisions
if: ${{ !cancelled() && inputs.promote_entrypoint && needs.deployment_ready.result == 'success' }}
Expand Down
1 change: 1 addition & 0 deletions changelog.d/remove-staging-v2-route-checks.removed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Staging deployments no longer calculate a staging household or create a staging economy report through the v2 routes after moving the v2 default. Those checks need the Public API's catalog to have the release's policyengine.py version, which it publishes only once the Public API itself moves to that version, after this service has deployed it.
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,8 @@ def _assert_deployment_environment_settings(reusable_workflow: str) -> None:
assert (
# Every job but stage12_v2_ready declares the release environment.
# The job that moves latest after the checks reads the prod
# environment's custom-hostname variable, the staging household
# check reads the beta variable SIMULATION_STAGING_HOUSEHOLD_ID and
# the environment's auth secrets, and the staging economy check
# reads those auth secrets too.
reusable_workflow.count("environment: ${{ inputs.release_environment }}") == 19
# environment's custom-hostname variable.
reusable_workflow.count("environment: ${{ inputs.release_environment }}") == 17
)
assert "APP_ENVIRONMENT: ${{ inputs.deployment_environment }}" in reusable_workflow
assert "STAGE12_ENABLED_VALUE: ${{ vars.STAGE12_ENABLED }}" in reusable_workflow
Expand Down
Loading
Loading