fix(forge): issue view lists the files attached to an issue and its comments #4

Open
HumanBean wants to merge 1 commit from HumanBean/Tooling:fix/forge-issue-view-attachments into main
Owner

Why

A bug report's log is usually an attachment, and forge.py issue view printed only the issue's text, so a report with a log read as if it had none. This lists the attached files so the log can be found.

What changed

issue view (and --comments) lists each file attached to the issue and to each comment as attached: "NAME" (SIZE) LINK, without downloading anything. The name and link are JSON-escaped, so a newline, escape code or odd character in a filename stays one printable line. A file the text already links (what pr comment --attach leaves) is not listed twice. No new request: it reads the assets the two GETs already return.

  • scripts/forge.py: show_attachments(), called by cmd_issue and show_comments(); usage line updated.
  • tests/test_forge_pr.py: test_issue_view_lists_the_attachments, test_attachment_names_and_links_are_escaped; the stand-in Forgejo answers GET /issues/N.
  • docs/forge.md: a paragraph under Other commands.

Ported from Longshot#298 by Amateurwizrd (MagicBeanDev/Longshot#298): forge.py moved to this repository (Tooling#1), so the change belongs here. The behaviour, tests and docs are the same as theirs, adapted to this repository's forge.py.

Testing

No tests were run on this PC (not the checks, not a single test). The original author ran tests/test_forge_pr.py (34 pass) and the commands against the live tracker on Windows 11 in Longshot#298.

🤖 Generated with Claude Code

## Why A bug report's log is usually an attachment, and `forge.py issue view` printed only the issue's text, so a report with a log read as if it had none. This lists the attached files so the log can be found. ## What changed `issue view` (and `--comments`) lists each file attached to the issue and to each comment as `attached: "NAME" (SIZE) LINK`, without downloading anything. The name and link are JSON-escaped, so a newline, escape code or odd character in a filename stays one printable line. A file the text already links (what `pr comment --attach` leaves) is not listed twice. No new request: it reads the `assets` the two GETs already return. - `scripts/forge.py`: `show_attachments()`, called by `cmd_issue` and `show_comments()`; usage line updated. - `tests/test_forge_pr.py`: `test_issue_view_lists_the_attachments`, `test_attachment_names_and_links_are_escaped`; the stand-in Forgejo answers `GET /issues/N`. - `docs/forge.md`: a paragraph under Other commands. Ported from Longshot#298 by Amateurwizrd (https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/298): forge.py moved to this repository (Tooling#1), so the change belongs here. The behaviour, tests and docs are the same as theirs, adapted to this repository's forge.py. ## Testing No tests were run on this PC (not the checks, not a single test). The original author ran `tests/test_forge_pr.py` (34 pass) and the commands against the live tracker on Windows 11 in Longshot#298. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A bug report's log is usually an attachment, and issue view printed only the issue's text, so a report with a log read as if it had none. issue view (and --comments) now lists each file attached to the issue and to each comment by name, size and link, without downloading anything; names and links are JSON-escaped so an odd filename can't break the terminal or the output's lines. A file the text already links (what pr comment --attach leaves) is not listed twice.

Ported from Longshot#298 by Amateurwizrd (MagicBeanDev/Longshot#298). No tests were run on this PC.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/forge-issue-view-attachments:HumanBean-fix/forge-issue-view-attachments'
git switch 'HumanBean-fix/forge-issue-view-attachments'
Sign in to join this conversation.
No reviewers
No labels
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Tooling!4
No description provided.