-
Notifications
You must be signed in to change notification settings - Fork 7
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
bugfix: revise search algorithm for GitHub token #157
Conversation
prjemian
commented
Nov 5, 2021
- FIX Unit test for GitHub token fails when specific file name is provided #156
@carterbox This is ready for review. |
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.
Wow, this function has gotten pretty complicated! 😆
What if the search order is in order of user-controlled to developer-controlled because this function is not part of the public API? Or the opposite ordering?
^ more user-y
GH_TOKEN
GITHUB_TOKEN
~/.config/__github_creds__.txt
~/.config/punx/__github_creds__.txt
creds_file_name
This is the optional parameter; it is a path to any arbitrarily named text tile.
[punx source directory]/__github_creds__.txt
v more developer-y
I agree this is too complicated. Can we simplify to require only either of the two environment variables? |
Do you mean the search order would be:
and the function would take no parameters? Sounds good to me. |
Yes
…On Fri, Nov 5, 2021, 2:51 PM Daniel Ching ***@***.***> wrote:
Do you mean the search order would be:
GH_TOKEN
GITHUB_TOKEN
and the function would take no parameters? Sounds good to me.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#157 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AARMUMCNH2UJZR4NWRNYHX3UKQ7UFANCNFSM5HM5GK7Q>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Now, still returns ================================================================== warnings summary ==================================================================
punx/tests/test_github_handler.py::test_connect_repo
punx/tests/test_github_handler.py::test_connected_GitHub_Repository_Reference
punx/tests/test_github_handler.py::test_Github_download_default
/home/prjemian/Documents/projects/prjemian/punx/punx/github_handler.py:80: UserWarning: Did not find environment variables GH_TOKEN or GITHUB_TOKEN
warnings.warn(
-- Docs: https://docs.pytest.org/en/stable/warnings.html
=========================================================== 8 passed, 3 warnings in 0.87s ============================================================ |
@carterbox - Docs will be modified if you agree on this approach. |
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.
I agree with the approach overall. Comments about warning implementation below.
Co-authored-by: Daniel Ching <carterbox@users.noreply.github.com>
@carterbox Thanks for the review. Feel free to merge and delete the branch. |