codeant-ai-for-open-source[bot] commented on code in PR #40134:
URL: https://github.com/apache/superset/pull/40134#discussion_r3245007359
##########
superset/migrations/versions/2026-03-02_00-00_ce6bd21901ab_migrate_deckgl_and_mapbox.py:
##########
@@ -44,7 +44,7 @@
# revision identifiers, used by Alembic.
revision = "ce6bd21901ab"
-down_revision = "a1b2c3d4e5f6"
+down_revision = "41292324bf4e"
Review Comment:
**Suggestion:** Changing the parent revision to a brand-new ID breaks
upgrade continuity for any environment currently stamped at the old placeholder
revision (`a1b2c3d4e5f6`): Alembic will fail because the current DB revision no
longer exists in the script directory. Preserve compatibility by keeping a
legacy revision node (or adding a bridge migration) so both already-migrated
and fresh environments can upgrade without manual stamping. [api mismatch]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ❌ Alembic upgrade fails from databases stamped old placeholder revision.
- ⚠️ Deployment pipeline requires manual alembic stamp to recover upgrades.
```
</details>
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. Note the new parent revision chain in the PR code:
-
`superset/migrations/versions/2026-03-02_12-00_41292324bf4e_add_granular_export_permissions.py`
defines `Revision ID: 41292324bf4e` and `down_revision = "4b2a8c9d3e1f"`
(verified via
Grep: lines 19–21 and 26–27).
-
`superset/migrations/versions/2026-03-02_00-00_ce6bd21901ab_migrate_deckgl_and_mapbox.py`
defines `revision = "ce6bd21901ab"` and at line 47 (in this PR hunk) sets
`down_revision = "41292324bf4e"`.
2. Confirm that the previous placeholder revision ID no longer exists in the
migration
scripts:
- A repo-wide Grep for `a1b2c3d4e5f6` under `/workspace/superset` returns
no matches,
so there is no migration file whose `revision` equals `a1b2c3d4e5f6`.
3. Consider an environment that previously ran the original migration from
PR #38361
before this fix:
- In that environment, the Alembic `alembic_version` table was stamped to
the
placeholder revision ID `a1b2c3d4e5f6` (the old revision value that this
PR replaces
with `41292324bf4e`).
- After deploying this PR's code (which only knows `41292324bf4e` and has
`down_revision = "41292324bf4e"` at line 47), the database still reports
`a1b2c3d4e5f6`
as its current revision.
4. Run the standard migration upgrade command (e.g. `superset db upgrade`,
which drives
Alembic using the script directory `superset/migrations/versions`):
- Alembic reads the current DB revision `a1b2c3d4e5f6` from
`alembic_version`, then
looks for a migration script with `revision = "a1b2c3d4e5f6"`.
- Because that revision no longer exists in the script directory (step
2), Alembic
raises a `RevisionError` like "Can't locate revision identified by
'a1b2c3d4e5f6'",
blocking upgrades until an operator manually runs `alembic stamp
41292324bf4e` or
equivalent.
```
</details>
[Fix in
Cursor](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt=This%20is%20a%20comment%20left%20during%20a%20code%20review.%0A%0A%2A%2APath%3A%2A%2A%20superset%2Fmigrations%2Fversions%2F2026-03-02_00-00_ce6bd21901ab_migrate_deckgl_and_mapbox.py%0A%2A%2ALine%3A%2A%2A%2047%3A47%0A%2A%2AComment%3A%2A%2A%0A%09%2AApi%20Mismatch%3A%20Changing%20the%20parent%20revision%20to%20a%20brand-new%20ID%20breaks%20upgrade%20continuity%20for%20any%20environment%20currently%20stamped%20at%20the%20old%20placeholder%20revision%20%28%60a1b2c3d4e5f6%60%29%3A%20Alembic%20will%20fail%20because%20the%20current%20DB%20revision%20no%20longer%20exists%20in%20the%20script%20directory.%20Preserve%20compatibility%20by%20keeping%20a%20legacy%20revision%20node%20%28or%20adding%20a%20bridge%20migration%29%20so%20both%20already-migrated%20and%20fresh%20environments%20can%20upgrade%20without%20manual%20stamping.%0A%0AValidate%20the%20correctness%20of%20the%20flagged%20issue.%20If%20correct%2C%20How%20can%20I%2
0resolve%20this%3F%20If%20you%20propose%20a%20fix%2C%20implement%20it%20and%20please%20make%20it%20concise.%0AOnce%20fix%20is%20implemented%2C%20also%20check%20other%20comments%20on%20the%20same%20PR%2C%20and%20ask%20user%20if%20the%20user%20wants%20to%20fix%20the%20rest%20of%20the%20comments%20as%20well.%20if%20said%20yes%2C%20then%20fetch%20all%20the%20comments%20validate%20the%20correctness%20and%20implement%20a%20minimal%20fix%0A)
| [Fix in VSCode
Claude](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt=This%20is%20a%20comment%20left%20during%20a%20code%20review.%0A%0A%2A%2APath%3A%2A%2A%20superset%2Fmigrations%2Fversions%2F2026-03-02_00-00_ce6bd21901ab_migrate_deckgl_and_mapbox.py%0A%2A%2ALine%3A%2A%2A%2047%3A47%0A%2A%2AComment%3A%2A%2A%0A%09%2AApi%20Mismatch%3A%20Changing%20the%20parent%20revision%20to%20a%20brand-new%20ID%20breaks%20upgrade%20continuity%20for%20any%20environment%20currently%20stamped%20at%20the%20old%20placeholder%20revision%20%28%60a1b2c3d4e5f6%60
%29%3A%20Alembic%20will%20fail%20because%20the%20current%20DB%20revision%20no%20longer%20exists%20in%20the%20script%20directory.%20Preserve%20compatibility%20by%20keeping%20a%20legacy%20revision%20node%20%28or%20adding%20a%20bridge%20migration%29%20so%20both%20already-migrated%20and%20fresh%20environments%20can%20upgrade%20without%20manual%20stamping.%0A%0AValidate%20the%20correctness%20of%20the%20flagged%20issue.%20If%20correct%2C%20How%20can%20I%20resolve%20this%3F%20If%20you%20propose%20a%20fix%2C%20implement%20it%20and%20please%20make%20it%20concise.%0AOnce%20fix%20is%20implemented%2C%20also%20check%20other%20comments%20on%20the%20same%20PR%2C%20and%20ask%20user%20if%20the%20user%20wants%20to%20fix%20the%20rest%20of%20the%20comments%20as%20well.%20if%20said%20yes%2C%20then%20fetch%20all%20the%20comments%20validate%20the%20correctness%20and%20implement%20a%20minimal%20fix%0A)
*(Use Cmd/Ctrl + Click for best experience)*
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:**
superset/migrations/versions/2026-03-02_00-00_ce6bd21901ab_migrate_deckgl_and_mapbox.py
**Line:** 47:47
**Comment:**
*Api Mismatch: Changing the parent revision to a brand-new ID breaks
upgrade continuity for any environment currently stamped at the old placeholder
revision (`a1b2c3d4e5f6`): Alembic will fail because the current DB revision no
longer exists in the script directory. Preserve compatibility by keeping a
legacy revision node (or adding a bridge migration) so both already-migrated
and fresh environments can upgrade without manual stamping.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F40134&comment_hash=f0a40a66ce6145cc4c004beac2a961d9d21cd3d6221b7dbb13322cabd6d1ac52&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F40134&comment_hash=f0a40a66ce6145cc4c004beac2a961d9d21cd3d6221b7dbb13322cabd6d1ac52&reaction=dislike'>👎</a>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]