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: Remove deprecated ENABLE_ACCESS_REQUEST workflow #24266

Conversation

john-bodley
Copy link
Member

@john-bodley john-bodley commented Jun 1, 2023

SUMMARY

This PR partially addresses Superset 3.0 task #9 by removing the previous deprecated ENABLE_ACCESS_REQUEST config parameter and the associated workflows.

The TL;DR is this legacy workflow failed to work post #22022 (which mentions that the API endpoint is deprecated and will be removed in 3.0) when the GET requests became POST requests meaning logic like this and this is currently broken.

Honestly I'm going in somewhat blind in terms of the how/where this logic was used, but the TL;DR is there seems to be no approval logic/workflow if there's no request workflows. Hopefully I've trimmed enough dead code without over pruning, though this has turned somewhat into a yak shaving exercise as—by deleting the /approve endpoint—it led to removing facets of role extension, deleting the granter role, etc.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

CI.

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

@john-bodley john-bodley force-pushed the john-bodley--remove-enable-access-request branch 2 times, most recently from 4b422f7 to a7c6abf Compare June 1, 2023 19:17
@pull-request-size pull-request-size bot added size/L and removed size/XL labels Jun 1, 2023
@john-bodley john-bodley marked this pull request as ready for review June 1, 2023 20:03
__(security_manager.get_datasource_access_error_msg(datasource)),
"danger",
)
return redirect(
Copy link
Member Author

Choose a reason for hiding this comment

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

Note this redirect no longer worked as this is being called via a GET yet the redirect URL only accepts a POST.

@john-bodley john-bodley force-pushed the john-bodley--remove-enable-access-request branch from a7c6abf to eeea8c9 Compare June 1, 2023 20:28
@pull-request-size pull-request-size bot added size/XL and removed size/L labels Jun 1, 2023
@codecov
Copy link

codecov bot commented Jun 1, 2023

Codecov Report

Merging #24266 (1263551) into master (4e47771) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 1263551 differs from pull request most recent head dc2a4d1. Consider uploading reports for the commit dc2a4d1 to get more accurate results

@@           Coverage Diff            @@
##           master   #24266    +/-   ##
========================================
  Coverage   69.08%   69.09%            
========================================
  Files        1905     1903     -2     
  Lines       74813    74608   -205     
  Branches     8107     8107            
========================================
- Hits        51686    51550   -136     
+ Misses      21016    20947    -69     
  Partials     2111     2111            
Flag Coverage Δ
hive 53.79% <100.00%> (+0.10%) ⬆️
javascript 55.62% <ø> (ø)
mysql 79.39% <100.00%> (+0.07%) ⬆️
postgres 79.46% <100.00%> (+0.07%) ⬆️
presto 53.71% <100.00%> (+0.10%) ⬆️
python 83.38% <100.00%> (+0.09%) ⬆️
sqlite 77.99% <100.00%> (+0.06%) ⬆️
unit 54.20% <100.00%> (+0.11%) ⬆️

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

Impacted Files Coverage Δ
superset/config.py 91.97% <ø> (-0.03%) ⬇️
superset/initialization/__init__.py 91.35% <ø> (-0.06%) ⬇️
superset/security/manager.py 95.92% <ø> (-0.02%) ⬇️
superset/views/__init__.py 100.00% <ø> (ø)
superset/views/core.py 76.24% <ø> (+0.96%) ⬆️
superset/explore/commands/get.py 90.42% <100.00%> (+1.65%) ⬆️
superset/models/__init__.py 100.00% <100.00%> (ø)
superset/utils/core.py 91.55% <100.00%> (-0.05%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@john-bodley john-bodley force-pushed the john-bodley--remove-enable-access-request branch 3 times, most recently from f949506 to 8c9dd8b Compare June 1, 2023 23:27
@john-bodley john-bodley force-pushed the john-bodley--remove-enable-access-request branch from 8c9dd8b to fb6f391 Compare June 7, 2023 19:04
@john-bodley john-bodley requested a review from a team as a code owner June 7, 2023 19:04
@john-bodley john-bodley force-pushed the john-bodley--remove-enable-access-request branch 4 times, most recently from 9e825ba to 44f918b Compare June 9, 2023 00:39
Copy link
Member

@dpgaspar dpgaspar left a comment

Choose a reason for hiding this comment

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

It seems that probably makes sense to remove /superset/override_role_permissions also, since it seems related with is granter role. See if you agree and I'll close: #24334

@john-bodley john-bodley force-pushed the john-bodley--remove-enable-access-request branch 2 times, most recently from f2f9cb5 to 17b5020 Compare June 9, 2023 01:28
@john-bodley
Copy link
Member Author

john-bodley commented Jun 9, 2023

@dpgaspar I agree with your comment as I went down this path previously but didn't know how far I should go. This also makes the granter role obsolete.

@john-bodley john-bodley force-pushed the john-bodley--remove-enable-access-request branch 2 times, most recently from d2be248 to 6511cb2 Compare June 9, 2023 06:13
@@ -348,7 +348,7 @@ def test_get_dataset_item(self):
"sql": None,
"table_name": "energy_usage",
"template_params": None,
"uid": "2__table",
"uid": "6__table",
Copy link
Member Author

Choose a reason for hiding this comment

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

Love how removing some tests exposed the non-idempotent facets of others.

Copy link
Member

Choose a reason for hiding this comment

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

Since we're only asserting fields that are listed here (see lines 375-377), maybe we can just remove this line? I'm not sure we really need to assert the uid, as I assume doing this assertion will fail when running this test in isolation.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll use mock.ANY.

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 to see this dead code being removed, as this has caused a lot of confusion over the years. If this type of functionality really is needed, it should probably be done slightly differently, using pluggable FAB views/classes etc that don't require this much logic in the main codebase.

@@ -348,7 +348,7 @@ def test_get_dataset_item(self):
"sql": None,
"table_name": "energy_usage",
"template_params": None,
"uid": "2__table",
"uid": "6__table",
Copy link
Member

Choose a reason for hiding this comment

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

Since we're only asserting fields that are listed here (see lines 375-377), maybe we can just remove this line? I'm not sure we really need to assert the uid, as I assume doing this assertion will fail when running this test in isolation.

@john-bodley john-bodley force-pushed the john-bodley--remove-enable-access-request branch 3 times, most recently from 726adbc to 2d82c46 Compare June 9, 2023 23:05
@john-bodley john-bodley force-pushed the john-bodley--remove-enable-access-request branch from 2d82c46 to dc2a4d1 Compare June 9, 2023 23:06
@john-bodley john-bodley merged commit 0e3f1f6 into apache:master Jun 10, 2023
@eschutho
Copy link
Member

@john-bodley just to be on the safe side, I'm going to mark this as a possible breaking change. Do you think we should add anything to the UPDATING.md file re the changes?

@eschutho eschutho added the risk:breaking-change Issues or PRs that will introduce breaking changes label Jun 12, 2023
@michael-s-molina michael-s-molina added the v3.0 Label added by the release manager to track PRs to be included in the 3.0 branch label Jun 12, 2023
@michael-s-molina michael-s-molina removed the v3.0 Label added by the release manager to track PRs to be included in the 3.0 branch label Jun 26, 2023
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.0.0 labels Mar 8, 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 risk:breaking-change Issues or PRs that will introduce breaking changes size/XXL 🚢 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants