Skip to content

feat(platform): answer version and deployment history in the app - #4790

Merged
yannickmonney merged 2 commits into
mainfrom
feat/automation-versions-app
Oct 11, 2026
Merged

yannickmonney merged 2 commits into
mainfrom
feat/automation-versions-app

Conversation

@yannickmonney

Copy link
Copy Markdown
Contributor

What

The app's door for the version history, the deployment history and restoring a version. It's the data the versions screens will read, and it fixes the deploy notice. No REST, MCP or contract change; the machine doors follow separately.

  • GET /:name/versions reads the version history: who saved each version, through which door and client, what it was based on or restored from, what it changed, its tests, whether it is live and when it last went live. limit and before ask for a page; without them it answers every version, as the version picker reads it, and a missing message or test verdict is still left out.
  • GET /:name/deployments (new) answers what is live with its runs still going, and when each version went live, a page at a time (before=<at>:<id>).
  • POST /:name/restore (new) brings an older version back as the newest. Its document passes the save's own checks and tests through the shared save_automation path, then saves restored from it. When its content is the latest already, nothing is saved (200, unchanged). Refusals are the save's.
  • POST /:name/deploy takes expectedDeployedVersion and answers the store's whole deploy: the previous version, the kind (deploy, rollback, unchanged), the deployment's id, and the trigger that starts the version now.
    • Fix: the answer had been cut down to {name, version}, so the editor's notice that the trigger is off after a deploy never appeared.
  • POST /:name/save records basedOnVersion ("save anyway" after a stale refusal) and answers what the version changed.
  • GET /:name says the shown version's door, lineage and changes, and which version is the latest.
  • The client data layer: contract entries, adapters that parse both histories with the shared wire schemas (never a cast), the restore mutation, and the new deploy and save fields. The hooks come with the screens that read them.
  • One wire mapping per row (versionHistoryWire, deploymentEventWire, liveDeploymentWire), for REST and MCP to reuse.

Verification (local)

  • Platform tsc, oxlint, oxfmt, knip.
  • The whole server and pii projects: 87,673 passed. One timing-bound test (travels.test.ts) timed out under the full run's load and passes alone (31/31), as it has before.
  • Automations UI suite: 1,202 passed.
  • New route tests (routes.versions.test.ts, 13): restore (created, unchanged, refused for problems, unknown version, member refused); the deploy passing expectedDeployedVersion, null included, and answering the store's whole deploy with its trigger; save lineage and changes; paged and complete version lists; the deployment history with its position parsed; the detail answer.
  • Adapter tests: the history reads parse and refuse unknown shapes, plus the restore, deploy and save bodies.
  • Not observed yet: the deploy notice in a browser. The route test pins the answer the editor reads; the browser check comes with the versions screens.

- GET /:name/versions reads the version history: who saved each version,
  through which door and client, what it was based on or restored from,
  what it changed, its tests, whether it is live and when it last went
  live. `limit` and `before` ask for a page; without them it answers every
  version, as the version picker reads it.
- GET /:name/deployments (new) answers what is live with its runs still
  going, and when each version went live, a page at a time.
- POST /:name/restore (new) brings an older version back as the newest:
  its document passes the save's own checks and tests, then saves
  restored from it — or nothing, when it is the latest already (200).
- POST /:name/deploy takes expectedDeployedVersion and answers the store's
  whole deploy: what was live before, the kind, the deployment's id and
  the trigger that starts the version now. The answer had been cut down
  to the name and version, so the editor's notice that a trigger is off
  after a deploy never showed.
- POST /:name/save records basedOnVersion ("save anyway" after a stale
  refusal) and answers what the version changed.
- GET /:name says the shown version's door, lineage and changes, and
  which version is the latest.

One mapping per wire row (versionHistoryWire, deploymentEventWire), for
the REST and MCP doors to share.
The app's data layer for the versions screens to come (their hooks come
with the screens that read them):

- listVersionHistory and listDeployments read a page of each history,
  parsed at the boundary with the shared wire schemas, so a field the
  server leaves out reads as unknown rather than absent and a shape it
  does not know is refused, never cast.
- restoreAutomationVersion brings an older version back as the newest.
- The deploy mutation carries the live version it expects (null for
  nothing live) and reads the kind, the previous version and the
  deployment's id; the save carries basedOnVersion and reads what the
  version changed; an automation's read says the shown version's door,
  lineage and changes.
@yannickmonney
yannickmonney merged commit 41d90f4 into main Oct 11, 2026
@yannickmonney
yannickmonney deleted the feat/automation-versions-app branch October 11, 2026 08:50
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.

1 participant