Repository navigation
PR bodies fit GitHub's limit; a refused PR waits with GitHub's words; Retry opens it from the work - #636
Merged
Conversation
… Retry opens it from the work
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.
Summary
A bundled security fix run (55 packages, 229 advisories, every task done) ended without its real pull request: GitHub refused the description with
422 body is too long (maximum is 65536 characters). The stop path then opened a small draft whose only open item was the raw HTTP error, and the run waited on "Review pull request #n" with that error as its reason.Now no body CoderHelm sends GitHub can be over its limit, a big bundle's description lists what to look at first and points at the full detail, a refused pull request is tried once more and then said in GitHub's own words, and Retry on a run whose work was done opens the pull request from its branch without implementing again.
Changes
common::pr_body_fit(new): one structured fitter for every body. It keeps the text before the first heading (ticket line, draft status, "Not yet verified"), the sections a reader and CoderHelm read first (Summary, Not finished, CI failing, Not yet verified, Verification, Open items, Proof, Risk), a dependency fix run's account under "What to check" (### Dependency fix run: the bumps applied, the ones deferred with why, the sandbox's checks and the cost, from Security update runs: planned by rule, verified in the sandbox, never stuck #634) whole, every##heading and every line with an HTML comment marker. It shrinks the other sections largest first, a step at a time: nested lines under list items, then long lists capped with "and N more", then a section's text replaced by one line saying where the full detail is. Code blocks are never left open. Titles are kept to 256 characters.bounded_payloadruns inpost,patch,post_emptyand the review update, so pull requests, description updates, issues, comments and reviews all go through it. The#0guard stays where it was.common::security_fixes): a bundle of more than 10 packages gets the short description. Every package is still in the table, most urgent first, each linked to its finding page. Advisories list P0, P1, exploited and malware first and count the rest by tier. Reachability lists what is reachable and counts the rest. "What to check" shows in full up to 10 packages that need a look (P0 and P1, and majors with breaking changes, call sites, or notes not found), then the rest by tier with counts inside<details>. A dependency fix run's account comes first in "What to check", as in the full description. Closes is capped. Small bundles and single fixes keep the full description as before.openspec/specs/<ticket>/security-detail.mdon the pull request's branch. That is the folder where CoderHelm already commits the run's plan, it is excluded from the work files, and it is written only when the team'scommit_openspecsetting is on. Its link is recorded on the ticket, so the in-place CI rewrite of "What to check" and Proof builds the same short sections. The dashboard's finding pages already show each advisory, its path, reachability and evidence, and the table links them whatever the setting is.stop_pr):openreturnsStopped::Opened { number, url }orStopped::Refused { why }. The supervisor's ending rules (Runs finish or hand back only for a listed reason: one supervisor for every ending #635) decide first: a run it ships opens its pull request and goes on to CI, now named only when GitHub gave it a number. A run it hands back for a reason on the human-only list opens its draft; a create GitHub refuses there is tried once more with a shorter body, and if it is refused again, or GitHub's answer has no number, the run waits with that same hand-back reason ("Open the pull request", with GitHub's words and what Retry does). Nothing logs or records a pull request it doesn't have (before, a missing number became #0). The log lines name the pull request number only fromStopped::Opened.resume_from) of a run whose checkpoint says the work was implemented (implementor a later pass), whose plan is still there and whose branch still exists takes up that checkpoint as its own. It goes on to the checks and the pull request without implementing again. The pull request pass finds the branch's open draft and rewrites its description in place. For a security ticket it now also tells the findings about that pull request, skipping findings that already point at it.Verification
cargo test --workspace,cargo clippy --workspace --all-targets -- -D warnings,cargo fmt --all, on main with Security update runs: planned by rule, verified in the sandbox, never stuck #634 and Runs finish or hand back only for a listed reason: one supervisor for every ending #635.pr_body_fit: a body 3x over the limit fits with every marker (in order), every heading and every kept section intact; an in-place rewrite of "What to check" and Proof on the fitted body works and fits again; the Not finished markers stay paired; a body over the limit before its first heading keeps its markers; a property test over 120 random bodies of every size checks that the result fits, keeps its markers and headings, and leaves a body that already fits unchanged.body_limit_tests): a local server receives a create, a description update, a comment and an issue with a body over twice the limit, and every body sent fits and keeps its required sections and marker. Every body write is checked to go through the bound.record_refused, and nounwrap_or(0).run_passestakes it up before deciding to implement, and that this run's recorded error resumes.origin/main): the bundle description is over the limit, the CI rewrite is over the limit, the client sends bodies over the limit, the stop path records a create without a number as #0 and logs "Opened" with whatever link came back, and Retry has no checkpoint, so it implements again.