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

Change RepositoryMock GetCommits(GetCommitsRequest request) to sort commits like the GitLab api #875

Merged
merged 7 commits into from
Mar 17, 2025

Conversation

Hastaroth1
Copy link
Contributor

@Hastaroth1 Hastaroth1 commented Mar 14, 2025

The behavior of NGitLab.Mock.Repository GetCommits(GetCommitsRequest request) is different from GetCommits(string @ref)

GetCommits(string @ref) correctly returns commits in reverse chronological order (newest commit first).

https://docs.gitlab.com/api/commits/#list-repository-commits

image

GetCommits(GetCommitsRequest request) does not:

image

The GitLab api returns commits like GetCommits(string @ref)

I assume this is because of the difference in the SortBy used inside.
This might break existing tests that assume this behavior. But aligning the behavior with GitLab itself justifies this, imo.

https://docs.gitlab.com/api/commits/#list-repository-commits
image

@Hastaroth1 Hastaroth1 requested a review from a team as a code owner March 14, 2025 17:18
@Hastaroth1 Hastaroth1 requested review from Toa741 and removed request for a team March 14, 2025 17:18
@Hastaroth1 Hastaroth1 closed this Mar 14, 2025
@Hastaroth1 Hastaroth1 reopened this Mar 14, 2025
@Hastaroth1 Hastaroth1 marked this pull request as draft March 14, 2025 17:23
@Hastaroth1 Hastaroth1 marked this pull request as ready for review March 14, 2025 17:29
@louis-z louis-z merged commit cdf1681 into ubisoft:main Mar 17, 2025
5 checks passed
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