Skip to content

Require the simulation API's latest PolicyEngine.py version before the Public API deploys #4157

Closed

Description

@anth-volk

Problem

Before each staging and production deploy, the release runs .github/check-policyengine-bundle-supported.sh, which fetches the selected environment's simulation gateway /versions and runs policyengine_api.worker_spm_release. The check is meant to stop the Public API deploying while its PolicyEngine.py version differs from the latest version the simulation API has published. It never reads that version (policyengine.latest). Instead, it checks that /versions maps the Public API's installed PolicyEngine.py, policyengine-us and policyengine-uk versions to the same worker app.

So whether a Public API that is behind the simulation API is blocked depends on the country package versions:

  • On 2 November the simulation API published PolicyEngine.py 6.12.0 with the same policyengine-us (2.2.1) and policyengine-uk (2.151.0) versions as 6.11.1. Publishing 6.12.0 pointed us[2.2.1] and uk[2.151.0] at the 6.12.0 worker, so releases on 6.11.1 failed with "The us route resolves to a different worker application" until Update PolicyEngine bundle to 6.12.0 #4156 merged.
  • If a new PolicyEngine.py version changes either country package version, the Public API's older country versions keep pointing at the older worker, the check passes, and the Public API keeps deploying the older PolicyEngine.py version.

The pull request check also runs only when a pull request changes the bundle pin or one of seven listed files (--if-changed-from-base).

The Public API sends policyengine_version with every simulation request, so the gateway picks the worker by PolicyEngine.py version and doesn't use the us or uk routes for those requests.

Proposal

  • The check compares the installed PolicyEngine.py version with policyengine.latest in the selected environment's /versions. It fails, naming both versions, when they differ or when /versions reports no latest version.
  • Remove the US and UK route comparisons from worker_spm_release.py, and the unused -us and -uk options from request-simulation-model-versions.sh.
  • Keep the SPM capability check, which the registry keys by PolicyEngine.py version, and the check that the installed packages match the bundle manifest.
  • Run the pull request check on every pull request by removing --if-changed-from-base.

While the Public API is behind the simulation API, every pull request and release fails this check until the bundle update merges. A simulation API rollback moves latest back to an older version, so it also fails releases until the Public API's PolicyEngine.py version matches.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions