Skip to content

#993 Gitlab diff api seems to mismatch param #1004

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

Merged
merged 2 commits into from
Jul 25, 2023
Merged

Conversation

DoubleDPro
Copy link
Contributor

For actualization MergeRequestApi:

  • added methods "getMergeRequestDiffs" for GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/diffs
  • renamed method "getMergeRequestDiffs" for GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/versions

Fixes #993

For actualization MergeRequestApi:
- added methods "getMergeRequestDiffs" for GitLab Endpoint:
GET /projects/:id/merge_requests/:merge_request_iid/diffs
- renamed method "getMergeRequestDiffs" for GitLab Endpoint:
GET /projects/:id/merge_requests/:merge_request_iid/versions
@jmini
Copy link
Collaborator

jmini commented Jul 22, 2023

Thank you for this PR 👍
I will have a look next week.

@jmini
Copy link
Collaborator

jmini commented Jul 24, 2023

The issue I see with the suggested change, is that this is breaking, because getMergeRequestDiffs() is changing.

For GET /projects/:id/merge_requests/:merge_request_iid/commits the methods is just named getCommits()

I suggest an other naming:

  • Instead of getMergedRequestXxxx(..) just use getXxxx(..) (remove the MergedRequest part)
  • for GET /projects/:id/merge_requests/:merge_request_iid/diffs
    • --> getDiffs(..)
  • for GET /projects/:id/merge_requests/:merge_request_iid/versions
    • --> getVersions(..)

So getMergeRequestDiffs() is deprecated and recommend to use getVersions(..) instead.

I also created the MergeRequestDiffVersion as suggested in #993 (comment) which is a subset of MergeRequestDiff.
So the MergeRequestDiff is extending from MergeRequestDiffVersion.

When a single version is loaded the complete object is returned: MergeRequestDiff.
When multiple versions are loaded only a list of MergeRequestDiffVersion is returned.

@jmini
Copy link
Collaborator

jmini commented Jul 24, 2023

@DoubleDPro I have pushed a new commit to your branch. Let me know what you think.

@DoubleDPro
Copy link
Contributor Author

@jmini LGFM! Let's merge.

@jmini jmini merged commit 7d1d6b1 into gitlab4j:main Jul 25, 2023
@jmini
Copy link
Collaborator

jmini commented Jul 25, 2023

Merged to main and then to 6.x where breaking changes are allowed. So on the 6.x branch I removed the deprecated methods.

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.

gitlab diff api seems to mismatch param
2 participants