Skip to content

fix(ci): queue migrate runs per environment instead of letting them overlap - #9394

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/migrate-workflow-concurrency
Oct 27, 2026
Merged

waleedlatif1 merged 1 commit into
stagingfrom
fix/migrate-workflow-concurrency

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Add a job-level concurrency group (migrate-<environment>, cancel-in-progress: false) to the reusable migrate.yml, so two migrate jobs against the same database queue instead of overlapping
  • ci.yml's ci-<ref> group already runs push runs on one branch one at a time. The gap is a manual workflow_dispatch of migrate.yml, which has no group and can run at the same time as a CI migrate for the same environment
  • migrate.ts's advisory lock already stops versioned and script migrations from running at once, but the second runner gives up after 30 minutes while the job allows 300 for long index builds, so a long migration fails the other run. On dev, db:push's try-lock fails right away instead of waiting
  • The group is set on the job, not the workflow: a called workflow evaluates workflow-level concurrency with the caller's github context, and migrate-* can never match the caller's ci-* group, so the two can't deadlock
  • With the default single-pending queue, a replaced pending migrate job ends cancelled. promote requires needs.migrate.result == 'success', so a cancelled migrate never deploys

Type of Change

  • Bug fix

Testing

  • actionlint on migrate.yml passes
  • Workflow-only change; the next staging ci run's migrate job confirms it

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Oct 27, 2026 3:49am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Adds per-environment job concurrency to .github/workflows/migrate.yml.

  • Migration jobs for the same environment wait in one queue.

waleedlatif1 explicitly accepts replacement of pending migration jobs. The PR description notes that cancelled migrations cannot deploy.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  CI[CI migration] --> Group[Shared group for the environment]
  Manual[Manual migration] --> Group
  Group --> Run[One migration runs at a time]
  Run --> Result{Migration succeeded?}
  Result -->|Yes| Gate[Other deployment checks]
  Result -->|No| Stop[No deployment]
Loading

Reviews (1) · Last reviewed commit: "fix(ci): queue migrate runs per environm..." · Reviewed by Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit ea86f85 into staging Oct 27, 2026
68 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/migrate-workflow-concurrency branch October 27, 2026 07:12

This branch was successfully deployed

1 active deployment
Preview — a1e7fc56 Deployed Oct 27, 2026 by vercel[bot]
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