require_pinned_constraint rejects [email protected] release tags as bare branches
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
The classification lives in classify_unbounded_reason in src/apm_cli/policy/_constraint_pinning.py. Read the existing step 5a handling of {name}-vX.Y.Z tags, then the step 7 fallthrough that returns BARE_BRANCH. Done means a ref like [email protected] or @upstash/[email protected] is treated as pinned, while a branch such as release@next stays unpinned.
Written by the indexing model from the issue text.
Description
Description
require_pinned_constraint: true treats [email protected] release tags as bare branches. Monorepos that release with changesets, or tag each package as <package>@<version>, publish exactly these tags, and they're immutable release tags like vX.Y.Z.
In our project, two dependencies pinned to the upstream projects' release tags fail the dependency-pinned-constraint check:
dependencies:
apm:
- upstash/context7/skills/context7-mcp#@upstash/[email protected]
- shadcn/ui#[email protected]
The alternative is pinning these by full commit SHA, which Dependabot (package-ecosystem: apm) then tries to move to the repository's latest release tag, often another package's in a monorepo.
Version
APM 0.35.0 and 0.35.1. main has the same classification.
Cause
classify_unbounded_reason in src/apm_cli/policy/_constraint_pinning.py accepts a full SHA, a literal vX.Y.Z tag, a {name}-vX.Y.Z or {name}--vX.Y.Z tag for the dependency's own name (step 5a), or a semver range. Anything else, including [email protected] and @upstash/[email protected], falls through to step 7 and is reported as BARE_BRANCH.
Expected
A ref of the form <name>@X.Y.Z (including a scoped @scope/[email protected]) counts as pinned, as the {name}-vX.Y.Z layouts already do. Restricting it to an exact X.Y.Z version keeps branch names such as release@next unpinned.
Reproduction
- A policy with
dependencies.require_pinned_constraint: trueandenforcement: block. - An
apm.ymlwith the two dependencies above, thenapm install. apm audit --ci --policy ./apm-policy.ymlfailsdependency-pinned-constraintfor both.
- Dominant language
- Python
- Stars
- 4.3k
- Forks
- 415
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 172
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/apm
-
[BUG] Hermes MCP adapter drops cwd, extra passthrough keys and the SSE transport when writing config.yamlPossibly taken @Parth-Vasave claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
microsoft/apm#3749 · 1 comment ·
Maintainers usually reply within 1 day
-
compilation-target policy check ignores the plural targets: keyPossibly taken @MohammedAlkindi claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
[BUG] Shorthand like git/git or jonas/tig is rejected because rstrip(".git") strips a character setOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
type/automation type/performance
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
[BUG] apm compile reports 'Referenced file not found' for links with a #fragmentPossibly taken A pull request linked to this issue is open or already merged. Openstatus/accepted
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
microsoft/apm#3255 · 2 comments ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
benchflow-ai/skillsbench#1090 ·
-
Missing unit tests for human-readable date/time formatters in utils/datetime.pyPossibly taken @prabhleen2317 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
apache/iceberg-python#4387 ·
Maintainers usually reply within 1 day
-
backend bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NVIDIA/numba-cuda-mlir#467 · 1 comment ·
Maintainers usually reply within 3 days
-
BUG: UserAgentGenerator.generate ignores browser_type and returns a random browser stackPossibly taken @HhH666-ux claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day