[fix] Resolve broken workflow revision versions since release/v0.84.0#4639
[fix] Resolve broken workflow revision versions since release/v0.84.0#4639junaway wants to merge 3 commits into
workflow revision versions since release/v0.84.0#4639Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThis PR introduces a data migration that repairs workflow revision versions in PostgreSQL by seeding missing v0 rows, correcting misaligned duplicate versions, and updating environment revision JSON references to match. The migration is deployed via both OSS and EE Alembic entry points. ChangesWorkflow Revision Version Repair
🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
workflow revision versions since release/v0.84.0
There was a problem hiding this comment.
Pull request overview
This PR introduces an Alembic data migration to repair corrupted workflow_revisions.version data introduced around release/v0.84.0, by (a) inserting missing synthetic v0 revisions, (b) re-numbering versions for affected variants, and (c) rewriting embedded environment_revisions.data.references[*].*_revision.version values when versions change.
Changes:
- Adds a new OSS/EE Alembic migration revision (
b3c4d5e6f7a9) that runs the repair. - Implements the repair logic in a new OSS data migration module that seeds missing v0 rows, re-stretches revision versions in batches, and updates environment references accordingly.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| api/oss/databases/postgres/migrations/core/versions/b3c4d5e6f7a9_repair_workflow_revision_versions.py | Adds the OSS Alembic migration entrypoint wiring upgrade()/downgrade() to the new data migration. |
| api/oss/databases/postgres/migrations/core/data_migrations/workflow_revision_versions.py | Implements the batch seeding + version repair + environment reference rewrite logic. |
| api/ee/databases/postgres/migrations/core/versions/b3c4d5e6f7a9_repair_workflow_revision_versions.py | Adds the EE Alembic migration entrypoint mirroring OSS and reusing the OSS data migration implementation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 99a34408-f7bc-4cc7-955e-10a00a3fb727
📒 Files selected for processing (3)
api/ee/databases/postgres/migrations/core/versions/b3c4d5e6f7a9_repair_workflow_revision_versions.pyapi/oss/databases/postgres/migrations/core/data_migrations/workflow_revision_versions.pyapi/oss/databases/postgres/migrations/core/versions/b3c4d5e6f7a9_repair_workflow_revision_versions.py
Railway Preview Environment
|
…ce-0-84-0-migration
Summary
Repair
workflowrevisionversiondata caused by therelease/v0.84.0migration missing synthetic v0workflowrevisions.The migration does three things:
workflowrevisionsforworkflowvariantsthat do not have one.workflowrevisionversionsonly forworkflowvariantsthat currently have duplicateworkflowrevisionversions.environmentrevisiondatareferenceswhose referencedworkflowrevisionversionchanged.Why
The legacy apps migration copied existing apps data into
workflow_revisionsbut did not create the expected seed v0workflowrevision.For
workflowvariantmissing v0, later commits can compute aworkflowrevisionversionthat already exists, producing duplicateworkflowrevisionversions. This is data corruption, not an active commit race condition.Refs
This PR supersedes this other PR.