Skip to content

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

Closed

Description

@groupsky

Problem

When check fails, the notice shows the output of the check, but cut so short that the reason is lost. Seen on 2026-11-16 with v0.1.0. The check printed one line of about 200 characters, and the notice showed only:

nodkey broker check: config /var/lib/pullgate/NAME/trees/p-2030581612/run-new/broker.toml: …

The reason came after the long tree path ([secret.x] preapprove: is not allowed with ask = "never"), so the owner could not see why from the phone. They had to log in to the host or run the check elsewhere.

Proposal

  • Replace the tree paths ($PULLGATE_TREE, $PULLGATE_OLD_TREE) in the output with short names such as NEW and OLD before it is cut. These paths are long and say nothing to the owner.
  • Keep the end of the output when it must be cut, not only the start: most tools print the reason last. For example, keep the first line and the last N characters, with "…" between them.
  • Make sure the notice shows at least ~600 characters of the check output when the message has room for it.

Done when

  • A test: a check that prints TREE/broker.toml: <reason> (with the real long tree path) gives a notice that holds <reason> and does not hold the tree path.
  • A test: a check output longer than the limit keeps its last line.

Activity

  1. groupsky commented on Nov 17, 2026

    @groupsky
    ContributorAuthor

    Fixed in #39 (squash commit a7b20af).

    • A check that prints TREE/broker.toml: <reason> with the real tree path gives a notice with the reason and without the tree path: TestCheckNoticeShowsTheReason in internal/gate/check_test.go (the path becomes NEW).
    • Output longer than the limit keeps its last line: TestCheckNoticeKeepsTheLastLine (gate) and TestOutputKeepsTheEnd (message). The notice now shows up to 10 lines and 1500 characters, and a long line keeps its start and its end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority: lowDo when nothing else waits

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions