Closed vfaergestad closed 1 month ago
I would be willing to provide a PR if approved.
Doing this enhancement, it would be beneficial to research the rest of the git-providers for a similar field as well.
Done, found the field in all APIs.
@vfaergestad if you start working on this, open a draft PR when you are ready, then you can convert your draft PR to open when you are ready for review :)
I have converted my PR to open. The integration-tests are failing, and I would really like some feedback on why.
The code itself seems to function correctly. I have tested it manually as well with both Gitlab and Github.
@vfaergestad just wrote a comment in your PR, see PR #17907 for files to update to fix e2e tests.
@agaudreault sorry for the off-topic. I'm having a hard time to get PR #17907 reviewed. Could you review it ?
@ggjulio Thank you, that did the trick!
@agaudreault Thank you for your pointers as well. I think the PR is ready for a review when someone is available.
Fixed by #18974
Summary
The pull request generators support multiple different template keys that are retrieved together with the pull requests from the Gitlab and Github API. The
author
/creator
field is not one of them.Motivation
When our team uses the Pull request generators, we need to reference which image tag that needs to be used in the generated application. Since we tag our images with
$USER-$COMMIT_SHA
, (where$USER
is the author of the pull request) there is no way for us (that we know of) to reference this image properly in the template.Proposal
author
/creator
field in the different pull-request services in/argoproj/argo-cd/v2/applicationset/services/pull_request
./argoproj/argo-cd/applicationset/generator/pull_request.go
Gitlab exposes this field through the
author
field in their API: https://docs.gitlab.com/ee/api/merge_requests.html#list-project-merge-requestsGithub exposes this field through the
creator
field in their API: https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#list-pull-requestsGitea exposes this field through the
user.login
field in their API: https://gitea.com/api/swagger#/repository/repoListPullRequestsBitbucket exposes this field throigh the
author
field in their API: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-getAzure Devips exposes this field through the
createdBy
field in their API: https://learn.microsoft.com/en-us/rest/api/azure/devops/git/pull-requests/get-pull-request?view=azure-devops-rest-7.2#gitpullrequest