require_pinned_constraint rejects [email protected] release tags as bare branches

Aperta Adatta ai principianti
#3,731 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@MohammedAlkindi ci sta già lavorando.

Dal 15/11/2026.

  • #3740 di @MohammedAlkindi — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
tooling

Direzione di ricerca

La classificazione si trova in classify_unbounded_reason in src/apm_cli/policy/_constraint_pinning.py. Leggi la gestione esistente dei tag {name}-vX.Y.Z nel passo 5a, poi il fallthrough del passo 7 che restituisce BARE_BRANCH. Il lavoro è completo quando un riferimento come [email protected] o @upstash/[email protected] viene trattato come fissato, mentre un ramo come release@next resta non fissato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
Python
Stelle
4.3k
Fork
415
Merge medio
3g 4h
PR unite (30g)
176

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/apm

Tutte le issue di microsoft/apm

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.