Skip to content

Read paginated literal original commit diffs for MR review #628

Description

@sjungwon03

Problem

MR commit review needs literal original commit diff reads. The current repository commitDiff exposes one parsed page, discards pagination headers/raw text and cannot establish complete original context for a later private write.

Scope

  • Add generated CommitDiffFile metadata preserving exact paths, raw nullable diff text, modes and optional omission/generated flags without synthesizing lines or write eligibility.
  • Add a dedicated read-only RepositoryApi.commitDiffPage requiring a full lowercase SHA-1 commit identity and encoded project, offset page size and unidiff=true. Preserve the existing commitDiff contract.
  • Reuse the tested same-resource offset cursor validation for MR membership and original diff pages, validating fixed unidiff plus optional exact project/SHA echoes observed in public GitLab headers. Reuse only offsets, never supplied URLs.
  • Add guarded advertised-page traversal to HistoryRepository: captured client and project/commit identity, immutable ordered files, duplicate path-pair rejection, obsolete/partial success and late typed-error discard.
  • Test first, regenerate models, pass formatting/analysis and workspace tests; update MW-07 scope documentation.

Boundaries

No user action or new private write. GitLab diff limits can stop pagination before all files are returned; absent metadata and traversal completion never prove full repository changes, atomicity or write-safe coordinates. MR/fork identity, parent interpretation, literal selection, fresh context and guarded save/recovery UI remain required follow-ups. No dependency, persistence, telemetry or localization change.

References: https://docs.gitlab.com/api/commits/#retrieve-commit-diff and https://docs.gitlab.com/api/rest/#pagination

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions