-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Git: Allow to auth with password/token #7384
Comments
@tdesveaux Thanks for working on this feature. It makes sense to have it in Buildbot. I've looked into the WIP code and I didn't see any problems in the logic part. Just before doing a PR please replace all camelCase in code additions with snake_case - Buildbot is gradually transitioning to standard Python snake_case style and all new code should use that. |
@p12tic apologize about the ping, but I feel I need to confirm an architectural / code style choice with you. I started to look into this by refactoring the code a bit (first by trying to move SSH stuff to However, I'm feeling more and more that it would be simpler to use composition instead of the Mixin pattern here. I see the following drawbacks to the Mixin inheritance used now:
Using composition, I could either:
I tend to prefer the 2nd option but it could become unwieldy if there are too many differences between service/worker, but will allow to implement auth by password/token in the same way and abstract both into a larger |
Myself I prefer composition as well due to the reasons you've outlined. Mixins were preferred by the previous Buildbot development team. I think that your complaint is enough of a reason to change the architecture to composition. In the composition case I think the first option with inheritance is slightly better as the complexity tends to grow and it will be easier to expand the derived classes with whatever functionality we need. Whatever you do, it would be great to have the refactor as a separate PR without additional functionality yet. |
At the moment, Buildbot allow to provide a ssh key to handle Git authentication.
GitHub and other hosts allow to authenticate with access tokens (and even recommend it).
From a rather quick search, I only found this related issue #3137
I started implementing the feature to authenticate with said token in Buildbot on this branch.
This add the
gitCredentials
andgitCredentialStoreContent
(I'll try to find better names...) attributes toGitStepMixin
to enable authentication with said tokens by using the git credential git feature with thestore
which store credentials in a file allowing to implement in a similar way to the ssh auth.There is some work left to do in this branch as it's more in a POC state than anything (no tests/doc, only tested
source.Git
step, make it work forGitPoller
, ...).Is this a feature of interest to the Buildbot project? And is this approach acceptable?
I also saw that there might be some opportunities to refactor some related code that I could tackle while at it.
Two that come to mind:
GitStepMixin
into aGitStepWithAuthMixin
to remove the dummy declarations inGitTag
andGitCommit
steps.GitStepMixin
andGitPoller
? There seems to be a bit of duplication in the ssh key handling.Let me know if you think of other things I can look at.
The text was updated successfully, but these errors were encountered: