Skip to content

fix(migrations): merge theme editors and purge audit heads - #44364

Merged
sadpandajoe merged 1 commit into
masterfrom
aminghadersohi/merge-theme-editors-purge-audit-heads
Sep 17, 2026
Merged

sadpandajoe merged 1 commit into
masterfrom
aminghadersohi/merge-theme-editors-purge-audit-heads

Conversation

@aminghadersohi

Copy link
Copy Markdown
Contributor

SUMMARY

master currently has two alembic heads, so superset db upgrade aborts before applying anything:

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

The two heads are:

revision down_revision
e2f3a1b9c640 — merge purge-audit pruning and username index heads ("c7f53d184ea2", "88a01c781622")
0884f655c0a6 — merge task_dependencies with theme_editors heads ("7e2c9a4f1b83", "aa5fa339627c")

Neither is an ancestor of the other. The themes branch was long-lived and carried its own merge revisions, which were computed against a master that predated e2f3a1b9c640; merging it re-branched the graph.

This PR adds a single empty merge revision (60f94cd6cd11) with down_revision = ("0884f655c0a6", "e2f3a1b9c640"). There is no schema or data change — upgrade() and downgrade() are empty. It mirrors the shape of the prior merge revision in e2f3a1b9c640.

This unblocks integration CI repo-wide: every open PR's integration legs are dying in 1–2 minutes on this signature, before any tests run, including PRs that add no migrations at all.

Note that the enforce-single-migration-head check does not catch this class of break, because it only inspects the migrations a PR itself adds. It passes green on PRs that are being broken by master's divergent graph, so its status says nothing about whether master's graph has converged.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A — migration graph change only.

TESTING INSTRUCTIONS

Against a fresh SQLite metadata database:

# Before this change
$ superset db heads
0884f655c0a6 (head)
e2f3a1b9c640 (head)

$ superset db upgrade
ERROR [flask_migrate] Error: Multiple head revisions are present for given argument 'head' ...

# After this change
$ superset db heads
60f94cd6cd11 (head)

$ superset db upgrade
INFO [alembic.runtime.migration] Running upgrade 0884f655c0a6, e2f3a1b9c640 -> 60f94cd6cd11,
Merge theme editors and purge audit heads.
# completes successfully

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

master has two alembic heads, so `superset db upgrade` aborts with
"Multiple head revisions are present" and every PR's integration CI legs
fail in 1-2 minutes before running any tests.

Add an empty merge revision joining 0884f655c0a6 and e2f3a1b9c640. No
schema or data change.
@codecov

codecov Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.32%. Comparing base (7b6dd75) to head (77ef39f).
⚠️ Report is 13 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #44364      +/-   ##
==========================================
+ Coverage   80.30%   80.32%   +0.01%     
==========================================
  Files        2929     2930       +1     
  Lines      174172   174300     +128     
  Branches    40450    40461      +11     
==========================================
+ Hits       139876   140007     +131     
+ Misses      31639    31622      -17     
- Partials     2657     2671      +14     
Flag Coverage Δ
hive 37.17% <ø> (+0.01%) ⬆️
mysql 56.61% <ø> (+0.03%) ⬆️
postgres 56.64% <ø> (+0.03%) ⬆️
presto 39.24% <ø> (+<0.01%) ⬆️
python 84.72% <ø> (+0.02%) ⬆️
sqlite 56.33% <ø> (+0.03%) ⬆️
unit 76.30% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mikebridge

Copy link
Copy Markdown
Contributor

Reviewed 77ef39fcaaaf5170b8e828a69953a98ca4ca46f4 against 7b6dd7597c4af49f7f0571b7b33dd247f382218b with Python, SQLAlchemy/Alembic, and Superset-committer lenses (automated review).

No blocking correctness findings from the Python and migration reviews. The full migration graph has exactly the two expected parent heads before this change and only 60f94cd6cd11 afterward. Alembic 1.15.2 graph traversal confirms that starting from either parent still includes the missing other branch. Both empty callbacks are appropriate for this merge-only revision.

One nonblocking typing nit at lines 26–27: under our strict assignment-annotation convention, prefer revision: str and down_revision: tuple[str, str]. The existing migration template emits unannotated identifiers, so this is not a correctness issue or a reason to hold up the repair.

Verification limits: graph analysis and direct no-op callback execution, not an independently executed database upgrade/downgrade round trip. Please complete the migration checklist with actual downgrade verification and runtime/downtime evidence.

At the final check, migration guards, SQLite integration, pre-commit and unit tests passed; MySQL/PostgreSQL integration were still running, with no failed checks observed. The committer lens therefore remained process-only under its CI-first rule, not a completed code approval. Required migration approvals and remaining CI still apply; this comment is not a substitute for maintainer approval.

The merge-time guard improvement that would prevent recurrence can be handled separately from this focused repair.

@sadpandajoe
sadpandajoe merged commit 4c77b0b into master Sep 17, 2026
130 checks passed
@sadpandajoe
sadpandajoe deleted the aminghadersohi/merge-theme-editors-purge-audit-heads branch September 17, 2026 00:00
mikebridge added a commit to mikebridge/superset that referenced this pull request Sep 17, 2026
Regenerate the PR merge snapshot after apache#44364 merged the migration heads. No source or tree changes; old Actions reruns retain the broken merge SHA and are not repaired-graph evidence. Keep sc-120945 separate and post-GA.
@bito-code-review

Copy link
Copy Markdown
Contributor

Bito Automatic Review Skipped – PR Already Merged

Bito scheduled an automatic review for this pull request, but the review was skipped because this PR was merged before the review could be run.
No action is needed if you didn't intend to review it. To get a review, you can type /review in a comment and save it

rusackas added a commit that referenced this pull request Sep 17, 2026
…o master's merge

0e8bab8c31a3 merged the same two heads (0884f655c0a6, e2f3a1b9c640) that
60f94cd6cd11 already merged on master via #44364, re-splitting into two
heads. Drop the duplicate merge and repoint the theme_editors.theme_id
index migration at 60f94cd6cd11 instead.

Co-Authored-By: Evan Rusackas <evan@preset.io>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
rusackas added a commit that referenced this pull request Sep 23, 2026
…o master's merge

0e8bab8c31a3 merged the same two heads (0884f655c0a6, e2f3a1b9c640) that
60f94cd6cd11 already merged on master via #44364, re-splitting into two
heads. Drop the duplicate merge and repoint the theme_editors.theme_id
index migration at 60f94cd6cd11 instead.

Co-Authored-By: Evan Rusackas <evan@preset.io>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
rusackas added a commit that referenced this pull request Oct 3, 2026
…o master's merge

0e8bab8c31a3 merged the same two heads (0884f655c0a6, e2f3a1b9c640) that
60f94cd6cd11 already merged on master via #44364, re-splitting into two
heads. Drop the duplicate merge and repoint the theme_editors.theme_id
index migration at 60f94cd6cd11 instead.

Co-Authored-By: Evan Rusackas <evan@preset.io>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:db-migration PRs that require a DB migration size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants