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

fix: Breaking change in MachineAuthProvider constructor #25532

Merged
merged 2 commits into from
Oct 11, 2023

Conversation

kgabryje
Copy link
Member

@kgabryje kgabryje commented Oct 5, 2023

SUMMARY

A change introduced in #25247 in MachineAuthProvider caused some custom auth providers to be broken, because of unexpected second argument passed to the constructor. This PR reverts that behaviour and .allows only passing either Selenium or Playwright override auth function, not both at the same time.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

  1. Add a custom MACHINE_AUTH_PROVIDER_CLASS that inherits from MachineAuthProvider and uses an __init__ method that accepts only 1 argument - custom auth function (existing implementations follow this pattern)
  2. Verify that your custom auth provider works as expected.

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

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.

I propose we keep the original design, but update the sig to conform with how this is actually used, which assumes that the overrides are actually Optional arguments that default to None.

superset/utils/machine_auth.py Outdated Show resolved Hide resolved
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.

LGTM, but hoping we can clean this up properly in the next major version to have the same number of overrides as auth methods.

Copy link
Member

@craig-rueda craig-rueda left a comment

Choose a reason for hiding this comment

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

LGTM, but would be great if there was a test or two for this :D

@john-bodley
Copy link
Member

@kgabryje would you mind adding your testing instructions?

@kgabryje
Copy link
Member Author

Thanks for reviews!
@john-bodley Added test instructions. I had skipped this step as this PR is basically a revert to previous behaviour of the auth provider in order not to introduce a breaking change with the Playwright PR

@kgabryje kgabryje merged commit cef68f8 into apache:master Oct 11, 2023
33 checks passed
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.1.0 labels Mar 8, 2024
sfirke pushed a commit to sfirke/superset that referenced this pull request Mar 22, 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 size/S 🚢 3.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants