Skip to content

fix: a failed check notice shows the end of the output, with short tree paths - #39

Merged
groupsky merged 1 commit into
mainfrom
fix/check-notice-reason
Nov 17, 2026
Merged

groupsky merged 1 commit into
mainfrom
fix/check-notice-reason

Conversation

@groupsky

Copy link
Copy Markdown
Contributor

Fixes #25

What changes

  • The notice of a failed check replaces the tree paths ($PULLGATE_TREE, $PULLGATE_OLD_TREE) in the output with NEW and OLD, before the cut.
  • It keeps the last lines of the output: at most 10 lines and 1500 characters (UTF-16 units, as Telegram counts). The last line is always kept.
  • A line longer than 300 characters keeps its start (75) and its end, with … between. Before, every line was cut at 100 characters, so the reason at the end was lost.
  • The text is still cleaned (control and invisible characters become ?), HTML-escaped and inside <pre>.
  • DESIGN.md section 7 step 7, THREAT-MODEL.md T3.

Tests

  • TestCheckNoticeShowsTheReason: a check prints config $PULLGATE_TREE/broker.toml: [secret.x] preapprove: is not allowed with ask = "never" with the real tree path. The notice holds NEW/broker.toml: … and the reason, and not the tree path.
  • TestCheckNoticeKeepsTheLastLine: 60 long lines and a 900-character last line; the notice keeps the start and the end of the last line, shows more than one line, and fits 4096.
  • TestOutputKeepsTheEnd (message): n = 0, empty output, a multibyte line cut in the middle, cleaning and escaping, and output over the limit that keeps its last line.

Reviews

Security review: no critical, high or medium findings. Fixed: the cap now counts UTF-16 units, unit tests added, one long doc line wrapped.
Correctness review: no bug found. Added the unit tests it asked for.

🤖 Generated with Claude Code

…ee paths

The notice of a failed check now replaces the tree paths
(PULLGATE_TREE, PULLGATE_OLD_TREE) with NEW and OLD, keeps the last
lines of the output (at most 10 lines and 1500 characters), and cuts a
long line in the middle, so the reason at the end is shown.

Fixes #25

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@groupsky
groupsky merged commit a7b20af into main Nov 17, 2026
9 checks passed
@groupsky
groupsky deleted the fix/check-notice-reason branch November 17, 2026 08:21
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.

fix: a failed check notice cuts the output before the reason

1 participant