Skip to content

Record when each policyengine.py route was published and when latest last changed #960

Closed

Description

@PavelMakarchuk

Problem

The gateway's /versions reports which policyengine.py (.py) version each route serves and which one is latest, but not since when. The app-v2 developer-tools Deployments page (PolicyEngine/policyengine-app-v2#1450) shows, for each core service, the .py, model and data build it serves; it can show "live since" for the household API (its /versions has deployed_at) but not for the simulation API. GitHub's prod deployments are no substitute: they run several times a day and include worker rebuilds that route nothing new.

Proposal

Add two optional fields to the routing state that the routing publisher writes, and return them from GET /versions:

  • published_at: for each .py version, when its route was first published (republishing the same version keeps the date).
  • latest_since: when latest.policyengine last changed (a publish that advances latest, a forced latest, or a rollback).

Both are optional: states written before the change still read and validate, and the response shows {} / null until the next publish.

Done when

  • build_next_routing_state and build_restored_routing_state set the fields as above; coerce_routing_state keeps valid values and drops malformed ones.
  • VersionsResponse has published_at and latest_since, documented; the golden OpenAPI is updated.
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