-
Notifications
You must be signed in to change notification settings - Fork 80
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
Simplify auto-generated pac-gitauth secret URL #1311
Conversation
In GitLab's installation instructions, the manual @chmouel any idea of where that could be done? Thanks! |
/retest |
Not sure if I broke something with e2e tests, though... |
/ok-to-test |
Golang test coverage difference reportCoverage unchanged. 🥈 Package report
|
#1313 should fix the doc generation error, you should be able to rebase to get the fix |
for the linter error you can use this make target to get things fixed (as long you have markdownlint binary installed)
|
/ok-to-test |
Thanks! Any idea on how to handle |
give me a bit to think a bit about it, i don't think we need to force users using the .git url we had that same issue for bitbucketcloud and i think if you set the CloneURL field properly in the parse payload it would do the right thing properly. ie see this comment https://github.com/openshift-pipelines/pipelines-as-code/blob/main/pkg/secrets/basic_auth.go#L31 i am not totally sure tho so need to give it a try |
(for e2e failing, there is some flakes going on with the generated pipelienrun that is not realted to your commit) |
Is there any reason for the generated git authentication secret to use the full repository URL instead of just the host? That would fix the issue while having no impact on the -[credential "https://gitlab.example.com/my-project"]
+[credential "https://gitlab.example.com"]
helper = store |
that's a good point i don't think there is a reason, did you look if it's support greedy operator like start so we would not have to care about .git or not ? |
What do you mean by "support greedy operator"? I don't understand that part. |
@chmouel if you're talking about git's context matching behaviour, then according to git's documentation, git will match a context to a config section if the context is a subset of the configured section. e.g. |
Also, from git's docs:
So having a config section that uses a GitLab group URL wouldn't match properly, either. |
thanks for linking the documentation, yes that sounds good to me. we can just make that change in the git secret and that would work... This would be very useful as well on githup app and our granulated token scoping. the existing e2e test on gitea for private repo should test that i think so no need to add one. (and sorry for the long time to answer on this) |
Excellent, I'll get on that right away. Thanks! |
/retest |
this look good to me, any chance you can modify https://pipelinesascode.com/docs/guide/privaterepo/ and add a note that we are adding the URL of the git provider host (i.e https://github.com or https://gitlab.com) as url in gitconfig and if you can finally squash all commits as one so we are good to merge |
Done! Squash-merging from Pull Requests can also be enforced via project settings. :) |
/ok-to-test
yeah sometime it's okay to have multiple feature in a PR (like having a refactoring commit and then a feature/bugfix commit) if clearly identified, admitely i can just hit the dropdown of squashing commit on demand if needed as well but i probably going to forget it :) |
@@ -18,6 +18,12 @@ This secret contains a [Git Config](https://git-scm.com/docs/git-config) file: | |||
file: .git-credentials, which includes the https URL using the token obtained | |||
from the GitHub application or secret attached to the repo CR. | |||
|
|||
{{< hint info >}} For compatibility, the [Git |
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.
Changes
Changed GitLab's payload parser to get repository URL from
project.get_http_url
instead ofproject.web_url
.Fixes #1307
Submitter Checklist
make test lint
before submitting a PR (ie: with pre-commit, no need to waste CPU cycle on CI