Repository navigation
fix(policy): accept package-at-version monorepo release tags in pinned constraint check - #3740
Closed
Mohammed Alkindi (MohammedAlkindi) wants to merge 1 commit into
Conversation
…d constraint check
6 of 12 tasks
Collaborator
|
Thank you Mohammed Alkindi (@MohammedAlkindi) for this fix and for the tests. The maintainers decided to accept exact |
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 18, 2026
* fix(policy): count exact [email protected] release tags as pinned (#3731) require_pinned_constraint now treats an exact package release tag (<name>@X.Y.Z or @<scope>/<name>@X.Y.Z, optional leading v, semver prerelease/build allowed, at most one scope segment) as a declared release, through the existing classifier in policy/_constraint_pinning.py. Dist-tags, ranges, partial versions and multi-segment names stay violations. This changes the #3224 ruling that rejected another package's tags, for this exact-release shape only. Docs state that the check judges declared release intent, not immutability; the lockfile, --frozen and require_hashes pin content. Reworks #3740 with the contributor's classifier approach and tests. Co-authored-by: Mohammed Alkindi <[email protected]> Co-authored-by: Copilot App <[email protected]> * docs(changelog): note exact [email protected] release tags for pinned constraints apm-spec-waiver: req-pl-008 is a floor; accepting exact release tags stays conforming and the record excludes spec text changes. Co-authored-by: Copilot App <[email protected]> * test(policy): cover a/b/[email protected] and [email protected] at installed-CLI tier The #3731 scope record requires installed-CLI tests showing that multi-segment names and partial versions after @ stay violations under warn and block; only unit tests covered them. Addresses panel follow-up FU-1 (test-coverage-expert). Co-authored-by: Copilot <[email protected]> * docs(policy): align pinned-shape lists and tag mutability wording Sibling pages still called tags immutable or listed pinned shapes without exact [email protected] release tags, contradicting the new policy docs. Qualifies require_hashes as security.integrity.require_hashes and trims the repeated immutability note. Addresses panel follow-ups FU-2, FU-3 and FU-4 (doc-writer). Co-authored-by: Copilot <[email protected]> * test(policy): install a release tag that names another package The motivating ref shadcn/ui#[email protected] names the published package, not the directory APM derives the name from. The installed-CLI cases only used pkg-a tags on pkg-a, so this adds [email protected] on the pkg-a subdirectory through install, --frozen and audit. Addresses Copilot inline on tests/integration/policy/ test_require_pinned_constraint_declared_e2e.py:295. Co-authored-by: Copilot <[email protected]> * docs(policy): separate --frozen replay from require_hashes require_hashes only requires a content hash on each locked entry; an update can still record a moved tag's new commit. Replaying the lockfile with --frozen is what installs the locked commit. Addresses Copilot inline on docs/src/content/docs/enterprise/policy-reference.md. Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: danielmeppiel <[email protected]> Co-authored-by: Mohammed Alkindi <[email protected]> Co-authored-by: Copilot App <[email protected]>
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.
Description
The pinned constraint policy check treated package release tags in monorepos as bare branches. Pinned tags using the package at version format, such as those published by Changesets and Lerna, now count as pinned release constraints when followed by an exact semver version.
Issue and approved scope
Issue: Fixes #3731
Human scope-approval comment: #3731
Does this PR complete the issue, or what remains? Completes the issue.
Type of change
Testing
Spec conformance (OpenAPM v0.1)
docs/src/content/docs/specs/openapm-v0.1.mdupdated(new/changed
<a id="req-XXX"></a>anchor + prose + Appendix Crow).
docs/src/content/docs/specs/manifests/openapm-v0.1.requirements.ymlupdated.
@pytest.mark.req("req-XXX")test undertests/spec_conformance/added or extended.CONFORMANCE.{md,json}regenerated viauv run --extra dev python -m tests.spec_conformance.gen_statementand committed.