superset icon indicating copy to clipboard operation
superset copied to clipboard

chore: Fix/remove hardcode of admin role

Open Always-prog opened this issue 11 months ago • 15 comments

SUMMARY

Just removed hardcode of admin role from perm utils and using AUTH_ROLE_ADMIN constant in the Superset config instead.

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

Always-prog avatar Mar 29 '24 08:03 Always-prog

@supersetbot orglabel

Always-prog avatar Mar 29 '24 08:03 Always-prog

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 69.77%. Comparing base (c0f8dfc) to head (06bbab7). Report is 6 commits behind head on master.

Files Patch % Lines
superset-frontend/src/preamble.ts 0.00% 2 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #27779      +/-   ##
==========================================
+ Coverage   69.71%   69.77%   +0.05%     
==========================================
  Files        1920     1920              
  Lines       75234    75244      +10     
  Branches     8423     8425       +2     
==========================================
+ Hits        52447    52498      +51     
+ Misses      20725    20684      -41     
  Partials     2062     2062              
Flag Coverage Δ
hive 48.93% <ø> (?)
javascript 57.39% <50.00%> (-0.01%) :arrow_down:
mysql 77.88% <ø> (-0.01%) :arrow_down:
postgres 77.99% <ø> (-0.01%) :arrow_down:
python 83.03% <ø> (+0.12%) :arrow_up:
sqlite 77.43% <ø> (-0.01%) :arrow_down:
unit 56.78% <ø> (+<0.01%) :arrow_up:

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Mar 29 '24 08:03 codecov[bot]

How I can add orglabel?)

Always-prog avatar Mar 29 '24 08:03 Always-prog

@supersetbot orglabel

How I can add orglabel?)

@mistercrunch can probably help. Not sure if there's documentation for all this somewhere... we should probably add a page to the docs site or the wiki (probably the wiki, since that's where more process/dev content is going, while the docs are more end-user focused).

rusackas avatar Apr 02 '24 19:04 rusackas

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 69.77%. Comparing base (c0f8dfc) to head (06bbab7). Report is 38 commits behind head on master.

Files Patch % Lines
superset-frontend/src/preamble.ts 0.00% 2 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #27779      +/-   ##
==========================================
+ Coverage   69.71%   69.77%   +0.05%     
==========================================
  Files        1920     1920              
  Lines       75234    75244      +10     
  Branches     8423     8425       +2     
==========================================
+ Hits        52447    52498      +51     
+ Misses      20725    20684      -41     
  Partials     2062     2062              
Flag Coverage Δ
hive 48.93% <ø> (?)
javascript 57.39% <50.00%> (-0.01%) :arrow_down:
mysql 77.88% <ø> (-0.01%) :arrow_down:
postgres 77.99% <ø> (-0.01%) :arrow_down:
python 83.03% <ø> (+0.12%) :arrow_up:
sqlite 77.43% <ø> (-0.01%) :arrow_down:
unit 56.78% <ø> (+<0.01%) :arrow_up:

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Apr 03 '24 00:04 codecov-commenter

@supersetbot unlabel TechAudit-BI

mistercrunch avatar Apr 03 '24 06:04 mistercrunch

@supersetbot orglabel

mistercrunch avatar Apr 03 '24 06:04 mistercrunch

The bot was down for some reason, revived it in recent PRs. More about the bot here -> https://github.com/apache-superset/supersetbot . It even has a logo now 🤖 🤖 🤖 Screenshot 2024-04-02 at 11 03 46 PM

mistercrunch avatar Apr 03 '24 06:04 mistercrunch

Thank you @mistercrunch!

Always-prog avatar Apr 03 '24 08:04 Always-prog

@john-bodley Hi! Fixed code by your review. Please take a look!

Always-prog avatar Apr 03 '24 13:04 Always-prog

Rerunning the mysql test in hopes that it's just flaky, but if it fails again, the PR might need a rebase (there were some glitches with these DB tests that got resolved on master not long ago).

rusackas avatar Apr 03 '24 20:04 rusackas

@rusackas Test cases has beed passed without rebase

Always-prog avatar Apr 10 '24 08:04 Always-prog

The main thing I'm wondering about this PR now that I look more closely at the code, is if there's a better place to store this information. I'm a little nervous about storing bootstrap data on the window object, which opens up a new "junk drawer" pattern where people might store anything there. I'm not sure if we should have the Feature Flags there either, really. Is it possible to access this via the getBootstrapData() like we do so many other things in the codebase already. It looks like the role is indeed in there.

rusackas avatar Apr 10 '24 14:04 rusackas

@rusackas I see, ok. I have pushed commit with the fix :+1:, please take a look!

Always-prog avatar Apr 15 '24 16:04 Always-prog