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

RF+BF: github - remove user/password authentication, use only tokens #5218

Merged
merged 4 commits into from Dec 9, 2020

Conversation

yarikoptic
Copy link
Member

  • minor doc tuneup for typos, and consistent GitHub (not Github)
  • also removes storing of a (now "entered", not generated) token into
    git configuration. If desired to do so - do manually. To
    centralize entered credentials handling, regular credential store is
    used
  • VCR tapes were updated (with token manually replaced after) for two
    tests and 3rd commented out was removed completely (Closes Reenable github integration test #4079)
  • in some cases a little better error reporting now (e.g., giving a
    hint that token likely lack permissions to find a repository while
    creating ;))

Overall, it is not yet "much better" but it should be working and
usable again.

If merged, closes #3947

- minor __doc__ tuneup for typos, and consistent GitHub (not Github)
- also removes storing of a (now "entered", not generated) token into
  git configuration.  If desired to do so - do manually.  To
  centralize entered credentials handling, regular credential store is
  used
- VCR tapes were updated (with token manually replaced after) for two
  tests and 3rd commented out was removed completely
- in some cases a little better error reporting now (e.g., giving a
  hint that token likely lack permissions to find a repository while
  creating ;))

Overall, it is not yet "much better" but it should be working and
usable again.
@yarikoptic yarikoptic added the merge-if-ok OP considers this work done, and requests review/merge label Dec 8, 2020
Copy link
Contributor

@kyleam kyleam left a comment

Choose a reason for hiding this comment

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

Didn't test out locally, but looks fine to me on a read through.

@adswa
Copy link
Member

adswa commented Dec 9, 2020

I have adjusted the handbook section that walks through create-sibling-github accordingly: datalad-handbook/book#626

adswa and others added 2 commits December 9, 2020 11:49
test__make_github_repos() is failing on Travis because the the logged
BadCredentialsException ends with

    very bad status "some data"

instead of

    very bad status some data

I see the same failure locally (PyGithub 1.53 and Python 3.7.3).  I'm
hesitant to change it though, because presumably this passed on
@yarikoptic's local machine.

The exact form isn't the crucial part of this test, so just chop off
the trailing part of the query string.

https://travis-ci.com/github/datalad/datalad/jobs/456528059#L2319
@codecov
Copy link

codecov bot commented Dec 9, 2020

Codecov Report

Merging #5218 (0320924) into maint (b7c9864) will decrease coverage by 0.00%.
The diff coverage is 71.05%.

Impacted file tree graph

@@            Coverage Diff             @@
##            maint    #5218      +/-   ##
==========================================
- Coverage   89.90%   89.90%   -0.01%     
==========================================
  Files         294      294              
  Lines       40954    40919      -35     
==========================================
- Hits        36820    36787      -33     
+ Misses       4134     4132       -2     
Impacted Files Coverage Δ
datalad/distribution/create_sibling_github.py 83.87% <ø> (ø)
datalad/distribution/tests/test_create_github.py 95.77% <ø> (ø)
datalad/support/tests/test_github_.py 86.56% <50.00%> (-0.76%) ⬇️
datalad/support/github_.py 71.89% <71.42%> (-1.93%) ⬇️
datalad/consts.py 100.00% <100.00%> (ø)
datalad/core/distributed/tests/test_clone.py 93.25% <0.00%> (-0.75%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b7c9864...0320924. Read the comment docs.

@yarikoptic
Copy link
Member Author

Thank you @adswa for fixups -- FWIW, they look fine to me.

@yarikoptic yarikoptic added this to the 0.13.6 milestone Dec 9, 2020
@kyleam
Copy link
Contributor

kyleam commented Dec 9, 2020

@yarikoptic Are you fine with the change in aed2886 (TST: github: Loosen string matching of credential exception, 2020-12-09)? Or would you like to verify that the original test passed on your end (i.e. you're seeing different results than what happens on Travis and my local machine)?

@yarikoptic
Copy link
Member Author

well, I have given my blessing the changes. I think it would have been nice to keep it a bit more strict, even if just to keep the beginning of the exception string, but I was ok as is with @adswa 's changes... well -- since you are asking, I will add back at least the very bad status , test locally and push ;)

@kyleam
Copy link
Contributor

kyleam commented Dec 9, 2020

well, I have given my blessing the changes.

You said: "Thank you @adswa for fixups -- FWIW, they look fine to me."

So, it's not clear that you're considering aed2886, which is a commit from me. Hence why I asked explicitly.

well -- since you are asking, I will add back at least the very bad status , test locally and push ;)

That part was dropped because it fails on Travis and for me locally. (edit: never mind, you're talking about just the leading part; ok). As aed2886 said:

test__make_github_repos() is failing on Travis because the the logged
BadCredentialsException ends with

    very bad status "some data"

instead of

    very bad status some data

I see the same failure locally (PyGithub 1.53 and Python 3.7.3).  I'm
hesitant to change it though, because presumably this passed on
@yarikoptic's local machine.

@yarikoptic
Copy link
Member Author

ha ha -- and I was thinking "Adina gave such a nice commit message, like Kyle does, good for her" ;) I have missed the fact that it was commit from you @kyleam not Adina ;)

@kyleam
Copy link
Contributor

kyleam commented Dec 9, 2020

@yarikoptic Just out of curiosity, do you think the difference in that output is due to the PyGithub version?

@yarikoptic
Copy link
Member Author

I do not know and not care much enough ;) FWIW locally I have 1.43.7-1 from debian's python3-github

@kyleam
Copy link
Contributor

kyleam commented Dec 9, 2020

I do not know and not care much enough ;)

That's fair, but I hate unsolved mysteries :)

FWIW locally I have 1.43.7-1 from debian's python3-github

Thanks. Indeed this change comes with PyGithub's v1.43.8-12-ga0f01cf9 (Remove more Python version specific code, 2019-08-28).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-if-ok OP considers this work done, and requests review/merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants