Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix master build by merging alembic migration heads #28361

Merged
merged 1 commit into from
May 6, 2024

Conversation

mistercrunch
Copy link
Member

@mistercrunch mistercrunch commented May 6, 2024

See title, this happens when merging two database migration without rebasing first

ERROR

ERROR [flask_migrate] Error: Multiple head revisions are present for given argument 'head'; please specify a specific target revision, '<branchname>@head' to narrow to a specific head, or 'heads' for all heads
Screenshot 2024-05-06 at 11 39 57 AM

@mistercrunch mistercrunch requested a review from a team as a code owner May 6, 2024 18:38
@github-actions github-actions bot added risk:db-migration PRs that require a DB migration preset-io labels May 6, 2024
Copy link
Member

@john-bodley john-bodley left a comment

Choose a reason for hiding this comment

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

Thanks for the fix.

@mistercrunch mistercrunch merged commit d1e13ab into master May 6, 2024
34 of 35 checks passed
@mistercrunch mistercrunch deleted the alembic_fix_multiple_heads branch May 6, 2024 18:54
@john-bodley
Copy link
Member

BTW @mistercrunch #28361 was just merged today and we could likely just change the revision keys in the associated migration file if we didn't want to add another migration.

@john-bodley
Copy link
Member

@mistercrunch I wonder if there could be a GitHub action—something which I'm not overly well versed with—that could enforce that any PR which touches a migration file must be rebased against master before merging?

@mistercrunch
Copy link
Member Author

mistercrunch commented May 6, 2024

I wonder if there could be a GitHub action ...

I think there's a timing issue here where while things may be ok at the time the PR is updated (and CI runs), it doesn't mean things are ok after when the main branch has changed. We'd need something like pre-merge hook but I don't think they exist.

@mistercrunch
Copy link
Member Author

One approach would be to try and "auto-fix" with a script that would run when pushing on master, but not great to push this straight on the main branch...

That or maybe merge queues? https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue

imancrsrk pushed a commit to imancrsrk/superset that referenced this pull request May 10, 2024
jzhao62 pushed a commit to jzhao62/superset that referenced this pull request May 16, 2024
EnxDev pushed a commit to EnxDev/superset that referenced this pull request May 31, 2024
vinothkumar66 pushed a commit to vinothkumar66/superset that referenced this pull request Nov 11, 2024
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 4.1.0 labels Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels preset-io risk:db-migration PRs that require a DB migration size/M 🚢 4.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants