close
Skip to content

fix(filter): glob include respects the pipeline#91

Merged
bryantbiggs merged 1 commit into
mainfrom
feat/include-glob-pipeline
May 7, 2026
Merged

fix(filter): glob include respects the pipeline#91
bryantbiggs merged 1 commit into
mainfrom
feat/include-glob-pipeline

Conversation

@bryantbiggs
Copy link
Copy Markdown
Member

@bryantbiggs bryantbiggs commented May 7, 2026

Summary

Glob patterns in include: (like *-dev) used to bypass semver:, sort:, and latest:. Writing include: ["*-dev"] alongside a semver: 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

  • Filter (crates/ocync-sync/src/filter.rs): partition include: patterns by shape at pipeline build time. Globs bypass glob: and the soft-tier excludes; literals stay on the union-after-pipeline path. ~30 LOC of pipeline change.
  • Merge layer (src/cli/commands/synchronize.rs): no logic changes; new integration tests pin the YAML round-trip end-to-end (parse → merge → apply).
  • Schema (src/cli/config.rs, docs/public/config.schema.json): TagsConfig::include doc comment updated; schema regenerated.
  • Docs: new "Include patterns" section in configuration.md, "Build + runtime variants" subsection in recipes/semver-tracking.md, "Tag filtering" section in registries/chainguard.md. Stale descriptions in cli-reference.md, observability.md, and recipes/pin-literals-only.md corrected.

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-mapping include: field-replace semantics). Workspace 1361 → 1366.

Test plan

  • cargo fmt --all -- --check clean
  • cargo clippy --workspace --all-targets --locked -- -D warnings clean
  • cargo test --workspace --locked 1366 passed
  • cargo deny check clean
  • npm run --prefix docs build clean (anchors #include-patterns and #build--runtime-variants verified in generated HTML)
  • Reviewer: spot-check the worked example in configuration.md (the trace through 3.12.5, 3.12.5-dev, 3.13.0-dev, 3.12.5-r3) by reading it as a first-time user.
  • Reviewer: confirm the corrected prose in 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.

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.
@bryantbiggs bryantbiggs force-pushed the feat/include-glob-pipeline branch from f77b06c to afe4cf9 Compare May 7, 2026 21:29
@bryantbiggs bryantbiggs changed the title feat(filter): include patterns dispatch by shape fix(filter): glob include respects the pipeline May 7, 2026
@bryantbiggs bryantbiggs merged commit 7058616 into main May 7, 2026
16 checks passed
@bryantbiggs bryantbiggs deleted the feat/include-glob-pipeline branch May 7, 2026 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant