-
Notifications
You must be signed in to change notification settings - Fork 391
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
Allow git_credentials to be configurable #823
Conversation
This pull request has been mentioned on Jupyter Community Forum. There might be relevant details there: |
Thanks for following up with this PR! After (re)reading our code for a while and pondering why it is the way it is I think for the GitLab repo provider we should copy the GitHub one: binderhub/binderhub/repoproviders.py Lines 330 to 341 in 591b9cf
but change the comment and format of the git credentials string it produces. This would save people from having to put their access tokens in two places in the config. From a bit of googling it seems the username can be set to anything and the token goes in the password field (unlike GitHub where it is the other way around ...) So I think the reason that Regarding setting these value from a helm config file: this should be automatic if you set the |
Ok, I've updated this according to feedback, and updated the docs as well. I decided to use the I have manually tested this. |
Looks good to me. Merging! Congratulations on your first merged PR to BinderHub and thanks for the patience :) Maybe some day someone who knows about access vs private token will stop by and explain it to us. |
I learned something -- so, private tokens were a thing that was deprecated, but
Technically it's an |
This will make it so repo2docker can clone private GitLab repos as long as
GitLabRepoProvider.git_credentials
is configured.I have no way of testing that this will work with an actual secret.yaml file. I believe there is more work to do for it to read this value from a yaml file -- in the helm-chart templates. Can someone confirm this for me?
Also the tests fail for me on master, probably because I'm missing some step I need in order to run them. The contributing docs just say to run
pytest
, but it seems there's more to it than that. Anyway, I can't test this.There are a couple other ways I could do this:
GitLabRepoProvider
, instead of in all repo providers via theRepoProvider
base class.git_username
, and build the credential string in a method onGitLabRepoProvider
(sinceaccess_token
is already configurable and that's the git password).I'm not sure what way is best. Please provide feedback.