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

fix: Correctly deserialize GitLab MR commits #1808

Merged
merged 2 commits into from
Oct 30, 2024

Conversation

PigeonF
Copy link
Contributor

@PigeonF PigeonF commented Oct 29, 2024

The response for /api/v4/projects/:id/merge_requests/:merge_request_iid/commits is described in the documentation, and includes neither a sha, nor an author field.

As far as I can tell the GitLabMrCommit is only parsed from the /api/v4/projects/:id/merge_requests/:merge_request_iid/commits route, so the fields that are parsed have to be adjusted.

I removed the author information, because the route described only gives {author,committer}_name, and {author,committer}_email, which are taken from the commit, and do not correlate to GitLab usernames. If it is fine to use the commit author name in place of the username, I can add it back in (I am not familiar with the rest of the codebase and do not know if using a "wrong" username would have any impact).

The response for `/api/v4/projects/:id/merge_requests/:merge_request_iid/commits`
is described [in the documentation], and includes neither a `sha`, nor
an `author` field.

[in the documentation]: https://docs.gitlab.com/ee/api/merge_requests.html#get-single-merge-request-commits
Copy link
Owner

@MarcoIeni MarcoIeni left a comment

Choose a reason for hiding this comment

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

you are right, thanks, I don't know why I did this mistake 😅
If you want to open a PR to retrieve GitLab username, that will be appreciated, thanks!

@MarcoIeni MarcoIeni enabled auto-merge (squash) October 30, 2024 07:32
@MarcoIeni MarcoIeni merged commit 5562d31 into MarcoIeni:main Oct 30, 2024
12 checks passed
@release-plz release-plz bot mentioned this pull request Oct 29, 2024
@PigeonF PigeonF deleted the PigeonF/push-uzosxwprlzpr branch October 30, 2024 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants