fix(filter): glob include respects the pipeline#91
Merged
Conversation
Glob patterns in `include:` (e.g. `*-dev`) previously bypassed the filter pipeline, including `semver:`, `sort:`, and `latest:`. Combined with a `semver:` range on the same mapping, the result was uncapped rescue defeating the range -- a footgun for the paired-variant mirror pattern (build + runtime tags bounded by the same range). Glob includes now rescue matching tags from `glob:` and the soft-tier excludes and run through the rest of the pipeline like any other tag. Literal includes (e.g. `latest`) keep today's bypass-everything behavior; this is the dominant case, used by every existing recipe. The dispatch is by pattern shape (`*`, `?`, or `[` makes it a glob). Mixed lists route each pattern per its shape. Filter suite 79 -> 89 tests; workspace 1361 -> 1366. Docs cover the new behavior in configuration.md (Include patterns), the semver-tracking and pin-literals recipes, and the Chainguard registry guide; cli-reference and observability descriptions of `include:` are corrected. JSON schema regenerated for the updated `TagsConfig::include` doc comment.
f77b06c to
afe4cf9
Compare
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.
Summary
Glob patterns in
include:(like*-dev) used to bypasssemver:,sort:, andlatest:. Writinginclude: ["*-dev"]alongside asemver:range got every dev tag in the catalog rather than the bounded subset the range implied -- a footgun for the paired-variant mirror pattern (build + runtime tags within a version range).Glob includes now rescue matching tags from
glob:and the project-wide excludes and flow through the rest of the pipeline like any other tag. Literal includes (e.g.latest, exact tag names) keep today's bypass-everything behavior -- every existing recipe uses literals and behaves identically.The dispatch is by pattern shape:
*,?, or[makes it a glob; otherwise it is a literal. Mixed include lists route each pattern per its shape.What changed
crates/ocync-sync/src/filter.rs): partitioninclude:patterns by shape at pipeline build time. Globs bypassglob:and the soft-tier excludes; literals stay on the union-after-pipeline path. ~30 LOC of pipeline change.src/cli/commands/synchronize.rs): no logic changes; new integration tests pin the YAML round-trip end-to-end (parse → merge → apply).src/cli/config.rs,docs/public/config.schema.json):TagsConfig::includedoc comment updated; schema regenerated.configuration.md, "Build + runtime variants" subsection inrecipes/semver-tracking.md, "Tag filtering" section inregistries/chainguard.md. Stale descriptions incli-reference.md,observability.md, andrecipes/pin-literals-only.mdcorrected.Tests
Filter suite 79 → 89 (1 obsolete test inverted to assert constrained behavior, plus new tests for: literal-bypass through semver, glob rescue from
glob:, glob rescue from soft tier, hard-tier still blocks include, glob constrained by semver/sort/latest, mixed literal+glob, non-parseable tag handling, end-to-end YAML round-trip, and per-mappinginclude:field-replace semantics). Workspace 1361 → 1366.Test plan
cargo fmt --all -- --checkcleancargo clippy --workspace --all-targets --locked -- -D warningscleancargo test --workspace --locked1366 passedcargo deny checkcleannpm run --prefix docs buildclean (anchors#include-patternsand#build--runtime-variantsverified in generated HTML)configuration.md(the trace through3.12.5,3.12.5-dev,3.13.0-dev,3.12.5-r3) by reading it as a first-time user.recipes/semver-tracking.md("opt back into prereleases for in-range versions") matches expectations -- this is the one place existing recipe text adjusted for the new semantics.