Repository navigation
fix(stdlib): type the patch ledger by kind, and check revision against it - #3786
Open
minimal-backporter[bot] wants to merge 2 commits into
Open
minimal-backporter[bot] wants to merge 2 commits into
minimal-backporter[bot] wants to merge 2 commits into
Conversation
…st it (#1277) * feat(stdlib): revision counter and typed patch ledger in Attrs Two attrs for the security-patch convention in gominimal/inbox#511: a `revision` counting the patch-sets applied on top of upstream_version, and a typed `patches[]` ledger naming what each one fixed. Entries are contract-enforced, so a blank cve or origin refuses to parse rather than producing an SBOM row that asserts nothing. `upstream_version` gains a contract: it never carries an `-rN` suffix, because it is the advisory-matching key that feeds and `pkgmgr check` compare against. None of the registry's recipes violate it. Attrs is a closed schema, so recipes may set these only once every consumer carries this stdlib. The publish-boundary `qualified_version()` in pkgmgr renders `-rN` into SBOM, OpenVEX and secdb output. Refs: gominimal/inbox#511, gominimal/pkgmgr-rs#750 * feat(stdlib): type the patch ledger by kind, and check revision against it A ledger entry carries a kind of security, build or vendor; only a security fix must name its CVE and upstream commit, and the records are closed so a build or vendor entry cannot carry one. The ledger is checked entry by entry when the attribute is, because a consumer that reads attrs as values sees an array's elements without their contracts. Across attributes, a non-empty ledger needs revision >= 1, and neither revision nor patches is accepted without an upstream_version to qualify. An attr that fails now says why. decode gains the tests the spec names for REV-001, REV-003 and REV-011. stdlib 0.0.22. Refs: gominimal/inbox#511 * fix(stdlib): restart revision at 1 when a patch survives a bump; CVE sequence syntax Review (mitodrummer, 10-10): resetting revision to 0 on an upstream bump while a build patch survives produced a bump PR the ledger rule refuses to load. The counter restarts at 0 only when no patch survives, else 1 (spec REV-002, gominimal/pkgmgr-rs#962); a test pins both states. CveId now follows CVE syntax: a four-digit sequence may be zero-padded, five or more digits may not start with zero (CodeRabbit). The eager-fold comment gives its real reason after #2047. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit aa13deb)
1 of 2 tasks
Contributor
|
Important Review skippedBot user detected. Ask an organization administrator to verify that this bot has an active assigned CodeRabbit review seat. See the seat-assignment guide. After the seat is confirmed, request a review again.
|
Contributor
|
Approved: no findings at Nothing to do. Clobber: none: the PR is the cherry-pick of #1277 plus a fix that removes a duplicate test helper. |
…ackport release/0.7.x already defines the same helper (identical body) at the top of the test module, so the cherry-picked copy failed with E0428. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Backport of #1277 to
release/0.7.x.Squash-merge this PR and keep the PR title as the subject. The cherry-picked commit keeps the source subject.