Promote API now allows version downgrades with allowRollbacks flag

Deployment operators can now promote older versions by passing allowRollbacks=true to the promote API, giving flexibility to rollback to known-good states without manual intervention.
When something goes wrong in production, operators sometimes need to quickly revert to a known-good deployment. Previously, the promote API blocked this by rejecting any attempt to promote an older version — the system would return a 400 error saying "Cannot promote a deployment that is older than the current deployment."
A new allowRollbacks query parameter now bypasses this version check. By appending ?allowRollbacks=true to the promote endpoint, operators can promote any deployment regardless of version ordering. This is useful in incident response scenarios where speed matters and the root cause is understood.
The change lives in the webapp's deployment API routes and the ChangeCurrentDeploymentService that handles the promotion logic. A simple boolean flag controls whether the version comparison runs, keeping the implementation minimal and low-risk.
View Original GitHub Description
✅ Checklist
- I have followed every step in the contributing guide
- The PR title follows the convention.
- I ran and tested the code works
Testing
Deployed twice with pnpm exec trigger deploy
# Without allowRollbacks: returns 400
curl -X POST http://localhost:3030/api/v1/deployments/20260314.1/promote -H "Authorization: Bearer ${TRIGGER_API_KEY}"
{"error":"Cannot promote a deployment that is older than the current deployment."}
# With allowRollbacks: succeeds
curl -X POST "http://localhost:3030/api/v1/deployments/20260314.1/promote?allowRollbacks=true" -H "Authorization: Bearer ${TRIGGER_API_KEY}"
{"id":"deployment_k2usviwk6bgq63ctkqqqo","version":"20260314.1","shortCode":"pzaalcga"}
<img width="1038" height="132" alt="image" src="https://github.com/user-attachments/assets/0c75c444-9122-484a-adc7-ff339bc04482" />
Changelog
Adds an allowRollbacks query param to the promote deployment API endpoint (POST /api/v1/deployments/:version/promote?allowRollbacks=true). When set to true, the version ordering check in ChangeCurrentDeploymentService is skipped, allowing older deployments to be promoted.
Screenshots
N/A