-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[App] Fix env variable login #16339
[App] Fix env variable login #16339
Conversation
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ethanwharris FYI, with the changes in src/lightning_app/utilities/login.py undone, the tests in login.py still pass.
I did:
gh pr checkout 16339
git checkout master src/lightning_app/utilities/login.py
py.test -v tests/tests_app/utilities/test_login.py
Thanks @awaelchli !!! I've updated the tests to actually check for the credentials file and also refactored the Auth class a bit further to do all authentication in one place. Mind re-reviewing? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
What does this PR do?
Fixes a bug where login with env variables from the CLI would pass but then not actually create the credentials file.
This is because the CLI login calls
auth = Auth(); auth.clear()
and we were using__post_init__
to process the environment variables and save the credential file which would then be immediately deleted by the clear call.No added tests, but added calls to
auth.clear
so the tests reflect the CLI command.Does your PR introduce any breaking changes? If yes, please list them.
Before submitting
PR review
Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:
Did you have fun?
Make sure you had fun coding 🙃
cc @Borda