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

refactor(sqllab): migrate share queries via kv by permalink #29163

Merged

Conversation

justinpark
Copy link
Member

@justinpark justinpark commented Jun 10, 2024

SUMMARY

This PR changes the existing SHARE_QUERIES_VIA_KV_STORE feature to store data using the permalink API instead of the KV store. This is one of the prerequisites of Remove old KV store endpoint and its associated asset.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

after--permalink2.mov

TESTING INSTRUCTIONS

Go to SQL Lab and then click "Copy Link"

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

@justinpark justinpark requested a review from betodealmeida June 10, 2024 20:04
@github-actions github-actions bot added the api Related to the REST API label Jun 10, 2024
@dosubot dosubot bot added the sqllab Namespace | Anything related to the SQL Lab label Jun 10, 2024
Copy link

codecov bot commented Jun 10, 2024

Codecov Report

Attention: Patch coverage is 87.74194% with 19 lines in your changes missing coverage. Please review.

Project coverage is 83.45%. Comparing base (76d897e) to head (45e570b).
Report is 1334 commits behind head on master.

Files with missing lines Patch % Lines
superset/commands/sql_lab/permalink/get.py 70.27% 11 Missing ⚠️
superset/sqllab/permalink/api.py 90.19% 5 Missing ⚠️
superset/commands/sql_lab/permalink/create.py 88.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #29163       +/-   ##
===========================================
+ Coverage   60.48%   83.45%   +22.97%     
===========================================
  Files        1931      546     -1385     
  Lines       76236    39249    -36987     
  Branches     8568        0     -8568     
===========================================
- Hits        46114    32757    -13357     
+ Misses      28017     6492    -21525     
+ Partials     2105        0     -2105     
Flag Coverage Δ
hive 48.84% <67.74%> (-0.32%) ⬇️
javascript ?
mysql 76.03% <87.74%> (?)
postgres 76.09% <87.74%> (?)
presto 53.34% <67.74%> (-0.46%) ⬇️
python 83.45% <87.74%> (+19.97%) ⬆️
sqlite 75.57% <87.74%> (?)
unit 61.06% <67.74%> (+3.44%) ⬆️

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.

@villebro
Copy link
Member

/testenv up

Copy link
Contributor

@villebro Ephemeral environment spinning up at http://52.37.81.73:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@villebro
Copy link
Member

/testenv up FEATURE_SHARE_QUERIES_VIA_KV_STORE=true

Copy link
Contributor

@villebro Ephemeral environment spinning up at http://35.86.167.107:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

Great improvement, this is long overdue! I suggest removing the SHARE_QUERIES_VIA_KV_STORE feature flag, and making the permalink only store the selected portion of the editor. Other than that this looks great!

@michael-s-molina
Copy link
Member

I suggest removing the SHARE_QUERIES_VIA_KV_STORE feature flag, and making the permalink only store the selected portion of the editor.

@villebro There's a proposal in 5.0 to remove this feature flag.

@justinpark
Copy link
Member Author

@villebro @michael-s-molina could you take a look?

@michael-s-molina
Copy link
Member

Can you add support for old saved query URLs?

@michael-s-molina michael-s-molina added the risk:breaking-change Issues or PRs that will introduce breaking changes label Jul 25, 2024
@justinpark justinpark force-pushed the refactor--migrate-copy-query-via-permalink branch from 26036ce to a55adb7 Compare January 13, 2025 23:04
@justinpark
Copy link
Member Author

Can you add support for old saved query URLs?

Done. @michael-s-molina PTAL

RESOURCES/FEATURE_FLAGS.md Outdated Show resolved Hide resolved
UPDATING.md Outdated Show resolved Hide resolved
@justinpark justinpark force-pushed the refactor--migrate-copy-query-via-permalink branch from f1afa3e to 004f52b Compare January 14, 2025 16:59
@@ -62,6 +62,7 @@ These features flags are **safe for production**. They have been tested and will
[//]: # "PLEASE KEEP THESE LISTS SORTED ALPHABETICALLY"

### Flags on the path to feature launch and flag deprecation/removal

Copy link
Member

Choose a reason for hiding this comment

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

Did you forget to remove the SHARE_QUERIES_VIA_KV_STORE and KV_STORE from this document?

UPDATING.md Outdated Show resolved Hide resolved
superset-frontend/src/types/bootstrapTypes.ts Outdated Show resolved Hide resolved
Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for addressing the comments @justinpark!

@justinpark justinpark force-pushed the refactor--migrate-copy-query-via-permalink branch from 8912670 to 45e570b Compare January 17, 2025 17:43
@justinpark justinpark merged commit 2874096 into apache:master Jan 18, 2025
52 checks passed
@LevisNgigi
Copy link
Contributor

LevisNgigi commented Jan 19, 2025

Hey, @justinpark I just fetched this to local and when I try to copy the link in Sqllab i get the error, "Request URL:
http://localhost:9000/api/v1/sqllab/permalink
Request Method:
POST
Status Code:
403 FORBIDDEN" could I be missing something? I'm logged in as an admin user.Though after commenting out the @Protect decorator it copies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Related to the REST API packages risk:breaking-change Issues or PRs that will introduce breaking changes size/XL sqllab Namespace | Anything related to the SQL Lab
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants