Skip to content

[mono]FEAT: Paging for mr_diff api#1320

Merged
benjamin-747 merged 7 commits into
gitmono-dev:mainfrom
AidCheng:main
Aug 9, 2025
Merged

[mono]FEAT: Paging for mr_diff api#1320
benjamin-747 merged 7 commits into
gitmono-dev:mainfrom
AidCheng:main

Conversation

@AidCheng

@AidCheng AidCheng commented Aug 8, 2025

Copy link
Copy Markdown
Contributor

Merge Request Diff Pagination and API Refactor

  • Update the content_diff method in Ceres/MonoApiService

    • new parameter: page_id, page_size
    • new returning: from String· to MrDiff`
    • page_id out of range will receive an empty vec
  • Created new structure MrDiff to return wrapped diff data and page info.

  • New API URL: /api/v1/mr/{link}/files-changed/{page_id}/{page_size}

Closes #1298

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>
@vercel

vercel Bot commented Aug 8, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mega ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 9, 2025 0:10am

@AidCheng AidCheng changed the title [[mono]:FEAT: paging for mr_content diff api] [mono]:FEAT: Paging for mr_diff api Aug 8, 2025
@AidCheng AidCheng changed the title [mono]:FEAT: Paging for mr_diff api [mono]FEAT: Paging for mr_diff api Aug 8, 2025
@genedna
genedna requested review from benjamin-747 and Copilot August 9, 2025 04:09

This comment was marked as outdated.

Signed-off-by: AidCheng <cn.aiden.cheng@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 MrDiff and MrPageInfo structures 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

Comment thread ceres/src/api_service/mono_api_service.rs Outdated
Comment thread mono/src/api/mr/mr_router.rs
Comment thread ceres/src/api_service/mono_api_service.rs
Comment thread ceres/src/api_service/mono_api_service.rs Outdated
AidCheng and others added 2 commits August 9, 2025 09:11
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
benjamin-747 added this pull request to the merge queue Aug 9, 2025
Merged via the queue into gitmono-dev:main with commit 2a867ca Aug 9, 2025
11 of 12 checks passed
@benjamin-747 benjamin-747 added this to the Web UI milestone Aug 11, 2025
@benjamin-747 benjamin-747 moved this to Done in Mega UI 重构 Aug 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[r2cn] 重构 Libra 模块实现的 Diff 功能,可以给Mono 复用

4 participants