feat(gl-mr): surface per-file name-status by default (#332)#333
Merged
Conversation
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>
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.
Context
gl-mr:Nreported a file count but not which files nor their change type, forcing a separategit diff --name-status master...branchround-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'snew_file/deleted_file/renamed_fileflags) +_get_name_status(paginatedmerge_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.:fullrather than a new:diffsuffix; change type comes from the API, not a git shellout; added the 50-file cap the issue's "one line per file" default lacked.gitlab.jsonop 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