Repository navigation
feat(update): redesign the PR description around the update table - #364
Merged
Merged
Conversation
The table comes first and carries the links: the package links to its source repository and the version range to the compare view, with <kbd> badges for the update type and security. Rows for one package moving from the same version to the same target merge, listing each file. - Security fixes and image rebuilds open with a one-line IMPORTANT headline; their advisory tables, sorted by severity with a "Fixed in" column, collapse below the update table. - Release notes collapse into one block per package, without the per-package heading or Source/Compare line; truncation notices sit inside the block, and a package without notes gets one small line. - The batch PR's removal list collapses below the release notes, its items marker reserved in the budget. - A footer says the Count opened the PR, with the vector bat logo pinned to the release, before the checkboxes. - The rebasing banner becomes a four-line NOTE alert; removal takes every quoted line between the marker lines. - The render salt moves to notes-render-v7, so open PRs rewrite once.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
count-patchula | ce5647c | Commit Preview URL Branch Preview URL |
Nov 23 2026, 02:26 AM |
- finish builds the tail first and fits the visible text into exactly the room left with patchula_notes::fit_within, which cuts where a block ends and closes open fences and <details> (fence- and code-span-aware) within the limit, so nothing swallows the batch section, footer or checkboxes. The substring <details> counting and the PERMIT_RESERVE estimate are gone. - Advisory summaries and ids lose their tags, ids their brackets; link_target rejects control characters and encodes backslashes and backticks; an advisory without a safe link renders as plain text, and introduced advisories and listed ids go through link_target too. - Image advisory rows sort by severity like the security table. - Notes::render, unreadable_notes and failed_notes stay within their limit after HTML escaping; table links never take a package's notes below MIN_RENDER, and a section that would not fit whole is left out rather than cut mid-tag. - With nothing shown, the standalone notice names the package and claims no partial notes. - Duplicate or ineligible changes no longer trigger "Out of room". - tail keeps the controls only when fixed(...) fits, and the oversize refusal names what filled the body. - Docs list bodyNotes before the release notes, as rendered.
- close_open_blocks reads <details> depth left to right per line, as an unsigned counter: an opening tag (<details then a space, > or /) goes deeper, a closing tag shallower, and a stray close never cancels a later open. - fit_within closes what its text leaves open even when all of it fits, shrinking the cut if the closing lines push it over the limit. - Each bodyNotes entry is fitted with fit_within instead of being cut raw; once one no longer fits, the rest stay out. - Image SBOM and registry fields (package, platforms, OS, detail) go through prose_cell. prose_cell and id_cell cut first, then make the text inert, escape backslashes before pipes and brackets, and drop tags. - The derived and state version rows that watch crates/notes/src move up one.
…ntly - fit_within returns whether it kept the text whole, and after a failed try moves the room to just before the cut that failed (markdown::fit_at reports it), so its tries are bounded by blocks, not bytes. - Notes::render_within fits each release with fit_within and keeps room for its trailing blank line, so the fold never outgrows its limit and releases that already fit are never lost to cut(). - bodyNotes skip empty entries, keep trying shorter notes after one does not fit, use fit_within's flag instead of comparing lengths, and add one reserved line whenever a note was cut or left out.
Merged
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.
What changed
The Count's PR description now follows the chosen "Minimalist Ledger" layout: a table you can read at a glance, with everything long collapsed.
`a` → `b`) links to the compare view. The update type andsecurityare<kbd>badges. Rows that move one package from the same version to the same target are merged into one, with the files separated by<br>. The links come from the release-notes fetch:intent()still hashes the unlinked rows, andDraft::pushlinks a row once its fetch comes back, but only if the budget has room for the extra bytes (Body::reserve). Rows whose source is private, unresolved or beyondRELEASES_PER_BODYstay unlinked.> [!IMPORTANT]line reads Fixes N known vulnerabilities (severity badges) inpkg. The advisory table follows the update table inside a collapsed<details>("Security advisories (N fixed)"). It is sorted critical → high → moderate → low → unrated and has a "Fixed in" column. Image SBOM comparisons work the same way: the headline, warnings and notes are visible, and the table of fixed advisories is collapsed below the update table. The "drawing blood" line is gone.Notes::rendertakes aNaming. Each package's notes are one collapsed block: "Release notes · from → to" when the body has one notes range, the package name when it has several. There is no### packageheading or Source/Compare line any more. Truncation and "may be incomplete" notices sit inside the</details>. Empty notes, a missing source, an unsupported host and fetch failures are each one<sub>line. The short-single-release exception is gone, so notes are always collapsed.<details>after the release notes ("Remove an update from this batch (N items)"), followed by thepatchula-batch:items marker. Its size is reserved in the budget the way the controls are.concat!(…, env!("CARGO_PKG_VERSION"), …), sits before the checkboxes. It is part oftail(), so it can never be cut. Markup copied from the reference files.Re-check this PR {timing}andAdd to the batch PR *(closes this PR and moves the update there)*. Both are still found by their trailing markers.> [!NOTE]alert between the markers, in the spec's exact wording for both a re-check and a lockfile rebuild. The base branch is still truncated and passed throughtext::code.without_bannernow removes every run of quoted lines bounded by both marker lines, so one-line banners from older releases still come off. Stray-marker, CRLF and missing-line-break handling are unchanged.notes-render-v6tov7, so every open PR is rewritten once and reused after that.guide/pull-requests.md(the banner and "The PR"),guide/release-notes.md,guide/security.mdandguide/batch.md.Before / after
<kbd>badges, merged rows### pkg+ Source/Compare line + fold (short single release expanded)<sub>lineBudget
TAIL_RESERVEgoes from 1,500 to 2,500, so the intent and notes leave the footer, the content and ownership markers, the re-check box and a server advert their room.finishnow also reserves the start line, the tail, the batch section, a 2-byte block break and room to close up to four<details>blocks a cut might leave open (48 bytes). As a result, a cut can't pull the footer into a collapsed block or turn the---rule into a heading.reserved()counts the same bytes, so an oversized batch or permit marker is refused up front instead of being cut.PERMIT_RESERVEis unchanged (1,000). The permit fit now also subtracts the batch section.BODY_LIMIT(32,000).Deviations from the spec
<kbd>high</kbd> ×2, <kbd>low</kbd>) rather than one badge per advisory, so a fix for many advisories doesn't produce a long headline. The reference case renders exactly as specified.changelogstate row moves to version 15 with its new source hash, becausecrates/notes/src/changed and parity requires it.Removed tests
The scope for this PR says not to pin PR-body wording or layout in tests. These tests were deleted, trimmed or renamed for that reason:
Deleted:
crates/update/src/pr/body/tests.rs:the_maintenance_body_has_no_empty_update_tablecrates/update/src/pr/body/tests.rs:image_tests::a_fixing_rebuild_lists_its_advisories_with_old_and_new_versionscrates/update/src/pr/body/tests.rs:tooling_tests::each_tooling_warning_is_a_caution_in_the_design_wording(the wholetooling_testsmodule)crates/update/src/pr/banner.rs:wording_follows_the_trigger_and_the_image_is_pinned_to_this_release(its branch-sanitising assertion survives asa_branch_name_cannot_break_out_of_the_banner)crates/notes/tests/notes.rs:release_notes_sit_in_one_fold_that_says_what_is_insidecrates/notes/tests/notes.rs:one_short_release_stays_expanded(the behaviour itself is gone)crates/notes/tests/notes.rs:notes_from_a_charts_sources_say_where_they_came_fromTrimmed to their behavioural assertions (wording assertions dropped, renamed where the old name described wording):
crates/update/src/pr/body/tests.rs:the_moved_ref_list_is_rendered_only_when_refs_moved→moved_refs_join_the_content_hash;a_removed_actions_lock_is_named_in_the_maintenance_body→a_removed_actions_lock_joins_the_content_hash;a_failed_notes_fetch_is_named_and_never_reused→a_failed_notes_fetch_is_never_reused;a_resolved_source_with_unreadable_notes_keeps_its_link;security_tests::fixed_advisories_lead_the_body_once_each→fixed_advisories_are_listed_once_each;security_tests::advisory_text_and_package_names_never_mention_anyone;image_tests::an_oversized_image_section_keeps_its_limits;image_tests::only_advisories_with_a_record_get_a_row_and_the_rest_are_counted_ids;image_tests::a_rebuild_that_only_brings_advisories_in_still_says_so+image_tests::a_rebuild_with_no_verified_record_claims_no_fix→a_rebuild_without_a_verified_record_claims_no_fix;image_tests::a_generator_name_cannot_close_its_code_span;image_tests::each_image_gets_its_own_line_and_silenced_warnings_are_left_off→silenced_warnings_are_left_offcrates/notes/tests/notes.rs:rendering_collapses_older_versions_truncates_with_links_and_neutralises_notifications,generated_note_heading_source_and_comparison_are_never_mention_neutralised→generated_note_headings_are_never_mention_neutralised,wrangler_notes_fold_with_demoted_headings_and_no_broken_links,an_oci_chart_lists_its_own_changes_for_each_version_in_the_range,a_charts_own_changes_render_without_a_sourcecrates/update/tests/write.rs: wording assertions dropped froma_retryable_notes_failure_is_fetched_again_on_the_next_run(now asserts that the settled body replaces the unsettled one),pr_create_repeat_update_labels_notes_and_checked_retry,generated_tables_policy_text_and_markers_do_not_gain_joiners,pin_title_respects_prefix_and_pin_rows_never_request_release_notes,a_lockfile_rebuild_shows_the_banner_until_it_ends_either_wayanda_ticked_recheck_shows_the_banner_and_a_plain_rebuild_never_doescrates/engine/tests/write.rs: banner wording assertion dropped froma_ticked_pr_retries_the_branch_it_namesTests that tick boxes or inject a stale banner were updated to the new checkbox and banner text. Request transcripts were regenerated with
mise run transcripts:snapshot; only body hashes changed.Checks run (on the VM)
cargo test --no-fail-fast -p patchula-notes -p patchula-update -p patchula-engine -p patchula-server -p patchula-cli: passcargo clippy -p patchula-notes -p patchula-update -p patchula-engine -p patchula-server -p patchula-cli --all-targets -- -D warnings: passcargo test --no-fail-fast --workspace --lib parity: passcargo fmt --check: cleanoption-a-patch.mdandoption-a-security-rebasing.md; markers included, they match apart from hashes and version.Follow-ups
After review
An adversarial review found nine defects; all are fixed in ce5647c.
Draft::finishno longer counts<details>substrings, which went wrong on tags in code,<details open>and upper case. Closing open blocks is now done bypatchula_notes's fence- and code-span-aware closer (viafit), and only when a cut happens.finishbuilds the tail first and computes the visible budget exactly fromfixed(tail, batch). ThePERMIT_RESERVEestimate and the four-close reserve are gone. The newpatchula_notes::fit_withincuts where a block ends and closes fences and<details>within the limit, so the result never exceeds the budget. It runs on every path, including the no-permit and large-batch ones. A cut can no longer swallow the batch section, the footer or the checkboxes, on GitHub or formarkers::checkboxes.</>escaped, and ids also have[/]escaped.link_targetrejects control characters and encodes\and`. An advisory without a safe link renders as plain text instead of[x]().brings_inand the listed-id links also go throughlink_target.fixed_idsset is removed.Notes::renderbounds its output after HTML escaping. Package names are escaped and cut on whole characters or entities (escape_html_within), escaped URL lengths are checked, and an over-long line falls back to a short one or nothing.unreadable_notesandfailed_notesare bounded the same way. Table links are never reserved if that would leave a package's notes belowMIN_RENDER. A section that wouldn't fit whole is left out rather than cut mid-tag.pkgleft out…"; otherwise it says "The Count could not show the release notes forpkg…", with no claim of partial notes.Draft::nextchecksnotes_keyand already-fetched keys before the room checks, so duplicates or ineligible changes no longer end the notes with "Out of room".Bodies::tailkeeps the controls only whenfixed(with_controls, 0) <= BODY_LIMIT. The oversize refusal now names what filled the body: release-age evidence, the batch's items, or a large group's markers.guide/pull-requests.mdlistsbodyNotesbefore the release notes, matching the code.Tests. No new tests, per your instruction. I restored the trimmed behavioural assertions: an introduced advisory (
USN-9-1) and an unverified fixed one (DSA-7) still appear in the image section.Cache version.
fit_withinlives incrates/notes/src/lib.rsrather thanmarkdown.rs. Putting it inmarkdown.rswould have forced version bumps of theparsed-changelogandnotes-forge-changelogderives. Thechangelogrow stays at version 15 with its new hash.Transcripts. Regenerated; only
an_overfull_tail_drops_the_controls_but_keeps_ownershipchanged, because the tail now keeps or drops the controls byfixed(...).Checks. Tests for notes, update, engine, server and cli; clippy with
-D warnings; workspace parity;cargo fmt --check. All pass.Second re-check (2e53ac1)
A re-check confirmed findings 1–10 fixed and found three more; all are fixed:
<details>depth.close_open_blocksnow reads<details>depth left to right on each line outside fences and code spans, using an unsigned counter. An opening tag is<detailsfollowed by a space,>or/; it goes one deeper. A closing tag goes one shallower, and a closing tag with nothing open is ignored. So a stray</details>in upstream notes can no longer cancel a later open block and leave it unclosed over the footer.bodyNotesare no longer raw-cut.fit_withinnow closes whatever its text leaves open even when all of the text fits, shrinking the cut if the closing lines push it over the limit.bodyNotesentry is fitted withfit_withininstead of being cut raw. Once one entry doesn't fit, the remaining entries are left out.prose_cell.prose_cellandid_celltruncate the raw text first, then make it inert, escape\before|,[and], and escape</>. A cut can no longer leave a lone backslash or half an escape.Cache versions. Editing
markdown.rsforced version bumps, and putting the new version numbers inchangelog.rs,forge.rsandadapters.rsthen changed every derive that watches those files. Each of these moves up one relative toorigin/main:notes-adapter-listing13→14parsed-postgres-sgmlandparsed-go-history13→14notes-changelog-directoryandparsed-changelog2→3notes-gitlab-releases,notes-gitea-releases,notes-forge-tags,notes-forge-filesandnotes-forge-changelog4→5changelogstays at 15 with a new hashTranscripts. Regenerated; only
release_notes_are_bounded_deduplicated_cached_and_policy_controlledchanged, because its oversizedbodyNotesare now fitted, not raw-cut.Checks. Tests for notes, update, engine, server and cli; clippy with
-D warnings; workspace parity;cargo fmt --check. All pass. No new tests.Third re-check (d906695)
A second re-check confirmed the earlier fixes and version bumps, and found three more defects (two from 2e53ac1); all are fixed:
bodyNotes.fit_within's newwholeflag instead of a length comparison.Notes::render_withinfits each release withfit_withinintoroom - heading - 1, leaving room for the blank line after it. The fold can't outgrow its limit, so releases that already fit are never thrown away by the finalcut().fit_withincost.fit_withinnow returns(String, bool). When the closing lines push a try over the limit, the next try starts just below the cut that failed (markdown::fit_atreports the cut offset), instead of stepping back by the overshoot. The number of tries is now bounded by the number of blocks, not bytes.Cache versions. Only hashes were refreshed (
parsed-changelog,notes-forge-changelog,changelog). Each version is still exactly one aboveorigin/main.Transcripts. Only
release_notes_are_bounded_deduplicated_cached_and_policy_controlledchanged: its oversized note now produces the omission line.Checks. Tests for notes, update, engine, server and cli; clippy with
-D warnings; workspace parity;cargo fmt --check. All pass. No new tests.