Skip to content

feat(gl-mr): surface per-file name-status by default (#332)#333

Merged
fdaviddpt merged 2 commits into
masterfrom
feat/gl-mr-name-status-332
Jun 25, 2026
Merged

feat(gl-mr): surface per-file name-status by default (#332)#333
fdaviddpt merged 2 commits into
masterfrom
feat/gl-mr-name-status-332

Conversation

@fdaviddpt

Copy link
Copy Markdown
Contributor

Context

gl-mr:N reported a file count but not which files nor their change type, forcing a separate git diff --name-status master...branch round-trip — the borrowed round-trip the variants exist to kill. The trigger was auditing a deleted-migration concern on a real MR (!25155).

What changed

  • presets/gitlab/mr.py_name_status_flag (A/D/R/M from GitLab's new_file/deleted_file/renamed_file flags) + _get_name_status (paginated merge_requests/:iid/diffs; one page by default, walks up to 500 on :full). New ## Files (N) block after the Changes line, capped at 50 with … +N more (use gl-mr:N:full). Any API/parse failure silently omits the block.
  • Design calls (from gl-mr: surface file-level diff (name-status) in output #332's own notes): reused :full rather than a new :diff suffix; change type comes from the API, not a git shellout; added the 50-file cap the issue's "one line per file" default lacked.
  • Tests — 9 new (flag mapping, parse, old_path fallback, API/JSON/timeout failures, single-page vs paginate, fetch cap). 33 pass.
  • Docsgitlab.json op list, docs/presets/gitlab.md, README.md, CHANGELOG.

Verified

Live against !25155: renders 18 files with A/M flags, zero D lines (confirms that branch is clean).

Closes #332

🤖 Generated by Max

Add a `## Files (N)` block to the gl-mr dashboard: one A/D/R/M line per
changed path, from the paginated merge_requests/:iid/diffs endpoint (change
type via GitLab's new_file/deleted_file/renamed_file flags, no git shellout).
"What got removed?" is the high-signal MR-review question; gl-mr previously
gave only a file count, forcing a separate `git diff --name-status` round-trip.

Capped at 50 files with a `… +N more` marker; gl-mr:N:full uncaps (paginates
to 500). Any API/parse failure silently omits the block.

9 new tests (33 pass). Docs + CHANGELOG updated.

Closes #332

Co-Authored-By: Max <noreply>
…play

Review of #333 surfaced three issues:
- Renames showed only new_path (R new.py) — now "R old.py → new.py" so the
  source path isn't lost (the one case a single path is ambiguous).
- The "+N more" overflow undercounted: changes_count is always a *string*
  ("18"/"1000+"), so the isinstance(int) guard always fell through to the
  fetched-page count, undercounting on >100-file MRs in default mode. Added
  _coerce_count (leading-digits parse) so the total is authoritative.
- Extracted the display math into _render_name_status so it's unit-testable;
  main() now just prints its lines.

Adds 7 tests (rename formatting, _coerce_count, overflow math, full-mode cap,
fallback). 40 gl-mr tests pass; full suite 3438 pass.

Co-Authored-By: Max <noreply>
@fdaviddpt fdaviddpt merged commit 7aed79b into master Jun 25, 2026
12 checks passed
@fdaviddpt fdaviddpt deleted the feat/gl-mr-name-status-332 branch June 25, 2026 13:15
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.

gl-mr: surface file-level diff (name-status) in output

1 participant