Default: `false`. When `true`, every APM dependency declared in `apm.yml` must use a bounded constraint -- a semver range with an upper bound, a literal version tag (e.g. `v1.5.3`), or a 40-char commit SHA. Empty refs, bare branch names, wildcards (`*`, `1.x`), and open-upper ranges (`>=1.0.0`, `>1.0.0`) all fail the `dependency-pinned-constraint` check.
Default: `false`. When `true`, every direct APM dependency declared in `apm.yml` must use a bounded constraint -- a semver range with an upper bound, a literal version tag (`v1.5.3`, or `pkg-a-v1.5.3` / `pkg-a--v1.5.3` for a package named `pkg-a`, the layouts APM resolves ranges against), or a 40-char commit SHA. Empty refs, bare branch names, wildcards (`*`, `1.x`), and open-upper ranges (`>=1.0.0`, `>1.0.0`) all fail the `dependency-pinned-constraint` check.
The check judges the constraint as declared. A range such as `pkg-a#^1.0.0` passes as a bounded choice even though the install selects a concrete release tag for it, and a bare branch stays a violation however it resolves. Fresh installs, locked reinstalls, updates, and `apm audit` agree.
```yaml
dependencies:
require_pinned_constraint: true
```
Transitive deps are also classified; they pass when their parent manifests pinned them. See the [policy schema reference](../../reference/policy-schema/#require_pinned_constraint-reference) for the full classification table and diagnostic format.
Only direct dependencies are evaluated; a transitive package's own manifest is not something the consumer can rewrite. See the [policy schema reference](../../reference/policy-schema/#require_pinned_constraint-reference) for the full classification table and diagnostic format.
---
Expand DownExpand Up
@@ -430,7 +432,7 @@ There are 21 policy checks.
| `required-executable-untrusted` | Required executable packages are present and trusted |
| `required-package-version` | Required packages with version pins match per `require_resolution` |
| `transitive-depth` | No dependency exceeds `max_depth` |
| `dependency-pinned-constraint` | Every dep uses a bounded constraint (semver range, literal tag, or SHA) when `require_pinned_constraint: true` |
| `dependency-pinned-constraint` | Every direct dep declares a bounded constraint (semver range, literal tag, or SHA) when `require_pinned_constraint: true` |
| `registry-source` | Dependencies come from required registries when `registry_source` is configured |
@@ -108,7 +108,7 @@ When a dependency matches `deny`, `apm install` will **not download or deploy th
| `require` | list of refs or null | `null` | `null` = no opinion (transparent during merge). `[]` = explicitly empty. Packages every consumer manifest must include. |
| `require_resolution` | enum | `project-wins` | `project-wins` / `policy-wins` / `block` -- how to resolve version conflicts on required packages. |
| `max_depth` | integer | `50` | Maximum transitive dependency depth. Must be `> 0`. |
| `require_pinned_constraint` | boolean | `false` | When `true`, every APM dep declared in `apm.yml` must use a bounded constraint (exact, `^`/`~`/bounded range, literal tag, or SHA). Transitive deps are also classified and pass when their parent manifests pinned them. Unbounded refs (missing ref, `*`, bare branch, bare `>=X.Y`) are routed through `policy.enforcement` (`warn` / `block`). **Enabling on existing projects will likely surface violations; roll out with `enforcement: warn` first.** |
| `require_pinned_constraint` | boolean | `false` | When `true`, every direct APM dep declared in `apm.yml` must use a bounded constraint (exact, `^`/`~`/bounded range, literal tag such as `v1.2.3` or `pkg-a-v1.2.3` for a package named `pkg-a`, or SHA). The declared constraint is judged, not the tag a range resolved to; transitive deps are not evaluated. Unbounded refs (missing ref, `*`, bare branch, bare `>=X.Y`) are routed through `policy.enforcement` (`warn` / `block`). **Enabling on existing projects will likely surface violations; roll out with `enforcement: warn` first.** |
### `require_pinned_constraint` reference
Expand All
@@ -128,6 +128,8 @@ dependencies:
- sixth_eq/lib#=1.5.3 # OK: exact version (npm/cargo explicit equality)
- sixth_pip/lib#==1.5.3 # FAIL: pip-style operator not supported (BARE_BRANCH)
- seventh/lib#v1.5.3 # OK: literal tag
- acme/mono/packages/pkg-a#pkg-a-v1.5.3 # OK: this package's own release tag
- acme/mono/packages/pkg-a#pkg-b-v1.5.3 # FAIL: another package's tag (BARE_BRANCH)
- ./packages/local # OK: local-path dep (no version surface)
```
Expand All
@@ -144,6 +146,8 @@ Diagnostic shape (ASCII-only, ``[x]`` for block, ``[!]`` for warn):
- acme/lib: bare branch 'main' tracks a moving tip
```
A range is classified as the author wrote it: `fourth/lib#^1.2.0` stays `OK` after the install selects `v1.4.0` for it, and `acme/lib#main` stays `FAIL` whatever commit it resolves to. The package name used for `{name}-v{version}` and `{name}--v{version}` tags is the final path segment of a subdirectory dependency, otherwise the repository name.
Patterns are matched against `<owner>/<repo>` (or `<host>/<owner>/<repo>`). Wildcards via shell-style globs, e.g. `contoso/*`.
"When true, every direct APM dep must declare a bounded constraint "
"(exact version, '^'/'~'/bounded range, literal tag, or SHA). "
"(exact version, '^'/'~'/bounded range, literal tag such as 'v1.2.3' "
"or 'pkg-a-v1.2.3' for a package named pkg-a, or SHA). The declared "
"constraint is judged, not the tag a range resolved to. "
"Unbounded refs (missing ref, '*', bare branch, bare '>=X.Y') are "
"reported through 'policy.enforcement' (warn | block). "
"Default: false. Recommend rolling out with 'enforcement: warn' first."
Expand Down
Loading
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Loading
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
You are visitor 01402622 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.