Skip to content

feat: warning lines from summary stay in the head of the question, and apply can add short lines to its report #42

Open

Description

@groupsky

Why

The [watch] list catches changed paths. Some risky changes are not a path: a variable that changes who may log in, or a file that mentions sudoers or the gate itself. Only the owner's summary command can find those, because it reads the tree.

Today the summary output goes into the <pre> block at the end of the question (DESIGN.md §12). When the message is longer than 3800 characters, pullgate cuts whole lines from the end. So a long list of changed files can push the summary's most important line out of the message. The head (host, SHA, watched-path warnings) is never cut; the summary's warnings should get the same rule.

What to do

  • A summary output line that starts with WARN: is taken out of the <pre> block and shown in the head, after the watched-path warnings, as ⚠ <code>text</code> (the text cleaned and cut to 200 characters like any repo text).
  • At most 10 such lines; more give one line "⚠ N more warnings from the summary".
  • These lines are never cut. If the head alone is too long, the commit and file lists go first, then the rest of the summary.
  • The full SHA line ("Full:") stays last, as today.
  • apply report lines: the applied / failed message shows only the exit status today (DESIGN.md §11). An apply that did part of the work (for example skipped one step on purpose) cannot tell the owner. Give apply a file PULLGATE_REPORT_FILE; its first 10 lines are added to that message, cleaned and shown as code.
  • DESIGN.md §11–§12 and the README describe the WARN: prefix and the report file.

Done when

  • Test: a summary with 2 WARN: lines and 500 changed files gives a question with both warnings in the head and a cut file list.
  • Test: a WARN: line with HTML, a link-like text or a right-to-left mark is shown only as cleaned code.
  • Test: 12 WARN: lines show 10 and "2 more".
  • Test: a summary without WARN: lines gives the same message as 0.2.0.
  • Test: an apply that writes 2 lines to PULLGATE_REPORT_FILE gets them in the applied message; 15 lines show 10 and a count.
  • Released in a tagged version.

Activity

  1. groupsky commented on Nov 20, 2026

    @groupsky
    ContributorAuthor

    Built in #54 (squash commit 47bf7cc). Evidence for each "Done when" box:

    • 2 WARN: lines and 500 changed files: both in the head, file list cut — TestSummaryWarningsStayInTheHeadOfALongQuestion (internal/message/warn_test.go).
    • HTML, link-like text, right-to-left mark shown only as cleaned code — TestSummaryWarningIsOnlyCleanedCode.
    • 12 WARN: lines show 10 and "2 more" — TestTwelveSummaryWarningsShowTenAndACount.
    • No WARN: lines: same message as 0.2.0 — TestSummaryWithoutWarningsIsUnchanged (an exact text; it also passes on the old code of main).
    • apply writes 2 lines to PULLGATE_REPORT_FILE: they are in the applied message; 15 lines show 10 and a count — TestApplyReportTwoLines, TestApplyReportFifteenLinesShowTen (internal/gate/report_test.go). Also: TestApplyReportInTheFailedMessage, TestApplyReportLinkIsNotFollowed, TestApplyReportHardLinkIsNotRead.
    • Released in a tagged version — waits for the next release.

    One note on the spec: the body keeps its old cut order (from its end), so that a summary without WARN: lines gives the same message as 0.2.0. The warnings are in the head and are not cut for the lists. Details in #54.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions