Skip to content

feat(commits): read paginated literal original commit diffs - #629

Merged
sjungwon03 merged 1 commit into
devfrom
feat/628-original-commit-diffs
Oct 6, 2026
Merged

sjungwon03 merged 1 commit into
devfrom
feat/628-original-commit-diffs

Conversation

@sjungwon03

Copy link
Copy Markdown
Member

Summary

Original commit review currently has only a single parsed diff page, which loses raw text and pagination. This adds fixed-SHA literal RepositoryApi.commitDiffPage reads, generated CommitDiffFile metadata, and guarded advertised-page traversal in HistoryRepository.originalCommitDiff while preserving the existing parsed commitDiff contract.

Raw paths/text, modes and nullable omission/generated flags are retained without inventing coordinates. HTTP status is checked before plain JSON decoding; malformed payloads and cursors remain sanitized typed failures. The shared offset helper preserves MR membership behavior and validates original diff unidiff=true plus exact optional project/SHA route echoes; only offsets are reused. Redirects are disabled and existing read-only account-bound OAuth recovery remains available. The repository returns immutable ordered files, rejects cross-page duplicates and discards partial/obsolete results and late typed errors.

Closes #628

Validation

  • dart format .: 963 Dart files, zero outstanding changes
  • flutter analyze: no issues
  • 7,594 full tests: app 4,251; design system 127; API 3,012; models 199; secure storage 5
  • 133 new behavior tests: API 108; repository 17; models 8. Missing contracts and unimplemented behavior failed before implementation
  • Existing 93 MR membership API regressions pass through the extracted shared cursor helper
  • Build runner regenerated model/serializers; generated files never hand-edited
  • Unauthenticated public GitLab commit-diff header/field spot-check confirmed id, sha and unidiff route/query fields
  • App/device and live private-write validation are not supplied by this read foundation; no UI change requires screenshots

Checklist

  • Linked issue, feature branch into dev, Conventional Commit and DCO
  • Test-first model/API/repository behavior and updated MW-07 documentation
  • No dependencies, token storage, persistence, telemetry or localization changes
  • Synthetic diff content/hashes and dummy credentials only; repository/code/review in English

Notes for reviewers

Uses the official commit diff endpoint and offset pagination contract. The primary endpoint and header builder confirm pagination and query echoes; no implementation code was copied. Optional totals and row counts never establish another page. Case-insensitive registered Link relations and relative targets retain the captured origin/resource, size and format; mismatched, duplicate, stale or context-changing targets fail rather than override a captured request.

This exposes no new user action or private write. GitLab's diff file limit can stop pagination before every changed file is returned. Advertised traversal and missing metadata therefore never prove full file coverage, an atomic snapshot, original parent references, MR membership or write eligibility. Nullable text/flags remain unknown; no parser or renderer repairs raw text here. Caller guards cannot abort an already dispatched GET/auth recovery, and must be checked again after awaiting.

Authoritative MR/fork identities, validated parent/original position references, literal selection and shared private-write reservation/actual settlement/visible recovery remain required before UI integration. No conditional-write, durable recovery, exactly-once or live-instance/device guarantee is claimed. MW-07 remains in progress, including image/file private draft creation.

Preserve original diff text and unknown omission metadata through captured-account pagination without exposing partial or obsolete context to future private review flows.

Signed-off-by: sjungwon03 <sjungwon03@gmail.com>
@sjungwon03
sjungwon03 marked this pull request as ready for review October 6, 2026 06:20
@github-actions github-actions Bot added area:api packages/gitlab_api — GitLab REST/GraphQL client area:ui Screens and feature UI area:docs AGENTS.md, .agents/, README and friends feat New feature labels Oct 6, 2026

@sjungwon03-ai sjungwon03-ai left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Review of commit 5fc52ed: Reviewed the literal diff model/generated output, API and repository contracts, shared cursor extraction, new regressions and documentation. No blocking findings. Fixed lowercase SHA-1 and captured project/format are preserved; raw paths/text and unknown omission flags are not reconstructed into write coordinates. Same-resource offset-only continuation confirms unidiff=true and optional exact id/sha echoes, while the original MR membership contract remains covered. Malformed payloads/cursors stay sanitized, redirects are disabled and read-only auth recovery stays captured-account bound. Traversal rejects duplicate path pairs, returns immutable ordered files and discards partial/obsolete results and late typed errors. Local gates passed: 963 files formatted, clean analysis, 7,594 full tests including 133 new regressions and the existing 93 MR membership API tests. GitLab file limits can stop advertised pages before all changes are exposed; traversal proves neither full coverage nor MR/parent context or write eligibility. No new UI/private write; authoritative fork/parent coordinates and guarded literal selection/save/recovery remain documented follow-ups.

@sjungwon03
sjungwon03 merged commit 11c04f3 into dev Oct 6, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:api packages/gitlab_api — GitLab REST/GraphQL client area:docs AGENTS.md, .agents/, README and friends area:ui Screens and feature UI feat New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Read paginated literal original commit diffs for MR review

2 participants