[mono]FEAT: Paging for mr_diff api#1320
Merged
Merged
Conversation
new api: /api/v1/mr/{link}/files-list
returns a new struct: MrDiff (contains the page info)
Signed-off-by: AidCheng <cn.aiden.cheng@gmail.com>
Signed-off-by: AidCheng <cn.aiden.cheng@gmail.com>
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Signed-off-by: AidCheng <cn.aiden.cheng@gmail.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds pagination support to the merge request diff API to handle large changesets more efficiently. The API now accepts page_id and page_size parameters and returns structured diff data with pagination metadata.
- Added pagination parameters (
page_id,page_size) to the content_diff method and API endpoint - Introduced
MrDiffandMrPageInfostructures to wrap diff content with pagination metadata - Updated API response structure to return paginated diff data instead of raw string content
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| mono/src/api/mr/mr_router.rs | Updated API endpoint to accept pagination parameters and handle new MrDiff response structure |
| mono/src/api/mr/mod.rs | Changed FilesChangedList content field from String to MrDiff structure |
| ceres/src/model/mr.rs | Added MrDiff and MrPageInfo structures with helper methods for MrDiffFile |
| ceres/src/api_service/mono_api_service.rs | Implemented pagination logic in content_diff method and added helper functions |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Aid C. <57825561+AidCheng@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Aid C. <57825561+AidCheng@users.noreply.github.com>
Signed-off-by: AidCheng <cn.aiden.cheng@gmail.com>
benjamin-747
approved these changes
Aug 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merge Request Diff Pagination and API Refactor
Update the
content_diffmethod inCeres/MonoApiServicepage_id,page_sizeString· toMrDiff`page_idout of range will receive an empty vecCreated new structure
MrDiffto return wrapped diff data and page info.New API URL:
/api/v1/mr/{link}/files-changed/{page_id}/{page_size}Closes #1298