require_pinned_constraint rejects [email protected] release tags as bare branches

Open Beginner friendly
#3,731 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@MohammedAlkindi is already working on this.

Since Nov 15, 2026.

  • #3740 by @MohammedAlkindi — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
tooling

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

  1. A policy with dependencies.require_pinned_constraint: true and enforcement: block.
  2. An apm.yml with the two dependencies above, then apm install.
  3. apm audit --ci --policy ./apm-policy.yml fails dependency-pinned-constraint for both.
Dominant language
Python
Stars
4.3k
Forks
415
Avg merge
3d 5h
Merged PRs (30d)
172

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/apm

All issues in microsoft/apm

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.