Skip to content

Conversation

@dpgaspar
Copy link
Member

@dpgaspar dpgaspar commented Nov 12, 2025

SUMMARY

Upgrades flask-appbuilder to 5.0.2

Release notes: https://github.com/dpgaspar/Flask-AppBuilder/releases/tag/v5.0.2

This release will increase the user.username length from 64 chars to 128 chars

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

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

@korbit-ai
Copy link

korbit-ai bot commented Nov 12, 2025

Based on your review schedule, I'll hold off on reviewing this PR until it's marked as ready for review. If you'd like me to take a look now, comment /korbit-review.

Your admin can change your review schedule in the Korbit Console

@github-actions github-actions bot added the risk:db-migration PRs that require a DB migration label Nov 12, 2025
@codecov
Copy link

codecov bot commented Nov 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.53%. Comparing base (9fbfcf0) to head (661b7d7).
⚠️ Report is 16 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #36086       +/-   ##
===========================================
+ Coverage        0   68.53%   +68.53%     
===========================================
  Files           0      634      +634     
  Lines           0    46302    +46302     
  Branches        0     4991     +4991     
===========================================
+ Hits            0    31731    +31731     
- Misses          0    13325    +13325     
- Partials        0     1246     +1246     
Flag Coverage Δ
hive 43.94% <ø> (?)
mysql 67.43% <ø> (?)
postgres 67.48% <ø> (?)
presto 47.48% <ø> (?)
python 68.32% <ø> (?)
sqlite 67.10% <ø> (?)
superset-extensions-cli 94.80% <ø> (?)
unit 100.00% <ø> (?)

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

☔ View full report in Codecov by Sentry.
📢 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.

@dpgaspar dpgaspar marked this pull request as ready for review November 13, 2025 10:43
@dosubot dosubot bot added change:backend Requires changing the backend risk:breaking-change Issues or PRs that will introduce breaking changes labels Nov 13, 2025
Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

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

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Status
Design Duplicate Column Check Logic ▹ view
Functionality Incomplete upgrade skip condition ▹ view
Functionality Incorrect downgrade skip condition ▹ view
Files scanned
File Path Reviewed
superset/migrations/versions/2025-11-12_12-54_x2s8ocx6rto6_expand_username_field_to_128_chars.py
superset/migrations/shared/utils.py

Explore our documentation to understand the languages and file types we support and the files we ignore.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

Comment on lines +39 to +42
def upgrade():
"""Expand ab_user.username field from 64 to 128 characters."""
# Check current column length to avoid errors if already upgraded
column_info = get_table_column("ab_user", "username")
Copy link

Choose a reason for hiding this comment

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

Duplicate Column Check Logic category Design

Tell me more
What is the issue?

The code for checking column information and handling migration logic is duplicated between upgrade() and downgrade() functions.

Why this matters

Code duplication increases maintenance burden and risk of inconsistencies when changes are needed. If the column checking logic needs to be modified, it would require changes in multiple places.

Suggested change ∙ Feature Preview

Extract the common column checking logic into a helper function:

def get_username_column_length():
    column_info = get_table_column("ab_user", "username")
    if column_info is None:
        return None
    current_type = column_info.get("type")
    return getattr(current_type, "length", None)
Provide feedback to improve future suggestions

Nice Catch Incorrect Not in Scope Not in coding standard Other

💬 Looking for more details? Reply to this comment to chat with Korbit.

current_type = column_info.get("type")
current_length = getattr(current_type, "length", None)

if current_length is not None and current_length <= 64:
Copy link

Choose a reason for hiding this comment

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

Incorrect downgrade skip condition category Functionality

Tell me more
What is the issue?

The downgrade function uses '<= 64' condition which will skip the downgrade when the column length is exactly 64, but it should only skip when the length is already less than 64.

Why this matters

This prevents the downgrade from running when it should, making the migration non-reversible in cases where the column is exactly 64 characters.

Suggested change ∙ Feature Preview

Change the condition to check only for lengths less than 64:

if current_length is not None and current_length < 64:
Provide feedback to improve future suggestions

Nice Catch Incorrect Not in Scope Not in coding standard Other

💬 Looking for more details? Reply to this comment to chat with Korbit.

current_type = column_info.get("type")
current_length = getattr(current_type, "length", None)

if current_length is not None and current_length == 128:
Copy link

Choose a reason for hiding this comment

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

Incomplete upgrade skip condition category Functionality

Tell me more
What is the issue?

The upgrade function uses '== 128' condition which will not skip the migration if the column length is greater than 128, potentially causing issues with larger existing column sizes.

Why this matters

This could lead to unnecessary schema changes or errors when the column is already larger than the target size of 128 characters.

Suggested change ∙ Feature Preview

Change the condition to check for lengths greater than or equal to 128:

if current_length is not None and current_length >= 128:
Provide feedback to improve future suggestions

Nice Catch Incorrect Not in Scope Not in coding standard Other

💬 Looking for more details? Reply to this comment to chat with Korbit.

)
return

with op.batch_alter_table("ab_user") as batch_op:
Copy link
Member

Choose a reason for hiding this comment

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

Just checking that we don't have a utils to do batch alters. If not then this looks good to me, else we should switch to the util

Copy link
Member Author

Choose a reason for hiding this comment

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

Good call, just checked and there isn't one

@dpgaspar dpgaspar merged commit b051f77 into apache:master Nov 14, 2025
122 of 124 checks passed
@dpgaspar dpgaspar deleted the chore/bump-fab-5.0.2 branch November 14, 2025 11:57
aminghadersohi pushed a commit to aminghadersohi/superset that referenced this pull request Nov 17, 2025
kshi020302 pushed a commit to jl141/superset that referenced this pull request Nov 30, 2025
# under the License.
"""Expand username field to 128 chars

Revision ID: x2s8ocx6rto6
Copy link
Member

Choose a reason for hiding this comment

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

#TIL Alembic revisions don't need to hexadecimal...

sadpandajoe pushed a commit that referenced this pull request Dec 4, 2025
(cherry picked from commit b051f77)
sadpandajoe pushed a commit that referenced this pull request Dec 4, 2025
(cherry picked from commit b051f77)
Facyla pushed a commit to Facyla/superset-contrib that referenced this pull request Dec 16, 2025
sadpandajoe pushed a commit that referenced this pull request Dec 16, 2025
(cherry picked from commit b051f77)
aminghadersohi pushed a commit to aminghadersohi/superset that referenced this pull request Jan 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:backend Requires changing the backend risk:breaking-change Issues or PRs that will introduce breaking changes risk:db-migration PRs that require a DB migration size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants