Skip to content

core: multi-value stage-1 filters and ATLAS_DISCOVERY_MAP mode - #78

Merged
max06 merged 9 commits into
mainfrom
review-subsetting
Oct 12, 2026
Merged

max06 merged 9 commits into
mainfrom
review-subsetting

Conversation

@max06

@max06 max06 commented Sep 12, 2026

Copy link
Copy Markdown
Owner

ATLAS_FILTER_CLUSTER / ATLAS_FILTER_DEPLOYMENT_NAME accept comma-separated
lists (items trimmed, empty items dropped, separators-only == unset; both
set = cross product), so an exact set of (cluster, deployment) pairs renders
with one invocation per cluster.

ATLAS_DISCOVERY_MAP=1 swaps the discovery OUTPUT: instead of one sub-helmfile
per pair, helmfile.all emits a single entry pointing at the release-less
carrier state templates/helmfile.discovery-map.yaml and hands it the discovery
result as values — every pair, its repo-relative deployment.yaml path and the
app templates it instantiates. helmfile build --allow-no-matching-release
prints it after one discovery pass (no release states, no values loader, no
SOPS). helmfile splits state files on --- before templating and requires
environments in a dedicated part, which rules out a conditional environments
block; sub-helmfile values need neither.

The deployment.yaml parse (hierarchy-templated, skipSecrets) moves into the
shared named template atlas.deployment.definition, used by the instance
fan-out and the map alike, so both see one parse.

Co-Authored-By: Claude Fable 5.1 [email protected]

@github-actions

github-actions Bot commented Sep 12, 2026 •

Copy link
Copy Markdown

ATLAS Review

No changes detected in rendered Kubernetes manifests.


Generated by ATLAS Review — Re-run

max06 and others added 4 commits October 11, 2026 14:15
ATLAS_FILTER_CLUSTER / ATLAS_FILTER_DEPLOYMENT_NAME accept comma-separated
lists (items trimmed, empty items dropped, separators-only == unset; both
set = cross product), so an exact set of (cluster, deployment) pairs renders
with one invocation per cluster.

ATLAS_DISCOVERY_MAP=1 swaps the discovery OUTPUT: instead of one sub-helmfile
per pair, helmfile.all emits a single entry pointing at the release-less
carrier state templates/helmfile.discovery-map.yaml and hands it the discovery
result as values — every pair, its repo-relative deployment.yaml path and the
app templates it instantiates. `helmfile build --allow-no-matching-release`
prints it after one discovery pass (no release states, no values loader, no
SOPS). helmfile splits state files on --- before templating and requires
environments in a dedicated part, which rules out a conditional environments
block; sub-helmfile values need neither.

The deployment.yaml parse (hierarchy-templated, skipSecrets) moves into the
shared named template atlas.deployment.definition, used by the instance
fan-out and the map alike, so both see one parse.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…ender, shadow check

discover.sh emits the discovery map of the checked-out tree (exit 2 when the
pinned ATLAS predates map mode → callers fall back to a full render).
classify.sh turns the maps of both revisions plus `git diff --name-status`
into the (cluster, deployment) pairs whose render can differ; rules follow the
directory convention, default-deny for anything else, pairs present on one
revision only are always selected, selection is deliberately over-approximate.
render.sh gains RENDER_PAIRS_FILE: one invocation per cluster with that
cluster's deployment list through the multi-value stage-1 filter.
diff.sh writes affected-paths.txt; shadow-check.sh asserts that every changed
release of a full diff lies inside the classifier's selection; comment.sh
inlines a render-scope fragment.

Tests: a standalone git fixture repo (helpers/subset.bash), 22 classifier
scenarios, and an equivalence oracle that runs the full and the subset pipeline
on the same scenarios and requires byte-identical diff output.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
New workflow inputs render-subset (off | shadow | on, default shadow) and
full-render-label (atlas-full-render). The target-branch tip is fetched into a
git worktree so its discovery map and the changed-file list exist before the
first render — no third checkout, render order unchanged. atlas-render gains the
modes discover / classify and a pairs-file input; atlas-diff gains subset-mode,
classify-dir and render-mode and builds the scope fragment + shadow check.

README: the stale fast-path section (described the withdrawn per-sub-helmfile
selectors) now documents ATLAS_FILTER_* lists and the discovery map; new
section on changed-file render subsetting.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
An ATLAS without ATLAS_DISCOVERY_MAP ignores the variable and runs its normal
discovery — on a large tree a full state build that also needs the SOPS key
this step does not have (seen on the first consumer run: a 'failed' baseline
map instead of 'unsupported'). Probe first with a stage-1 cluster filter that
matches nothing: a map-aware ATLAS still emits the carrier state with zero
pairs, an older one emits no sub-helmfile; one cheap state parse either way.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@max06
max06 force-pushed the review-subsetting branch from 29f7346 to e697eac Compare October 11, 2026 14:28
max06 and others added 5 commits October 12, 2026 09:27
A template may live in a subdirectory (templates/group/app, referenced as
`template: group/app`). The classifier took the first path segment as the
template name, so a change under such a template matched no known template
and selected nothing — the shadow check then flagged the deployment as
missed. Every known template whose directory contains the changed path is
now selected (nested templates match wide, on purpose); a path under no
known template still selects nothing.

Adds the subdirectory scenario to the classify tests.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…e files

A change to a local chart forced a full render, and a file inside the
templates root that belongs to no used template (a helper shared by
templates/<ns>/<app>/ siblings) selected nothing at all, so a change to it
passed review unrendered.

Discovery map v2: every pair carries "charts", the repo-relative local chart
directories its releases render from, plus file:// subcharts. ATLAS renders
each app template once per instance with the SOPS-free state-build context
to read the chart: fields. The template render moves into a shared helper
(atlas.instance.template) that helmfile.instance uses too, so the map and
the real render read the same release list.

classify.sh:
- <chart>/** of a chart in either map selects the pairs rendering from it;
  with a v1 map on either side, or for an unused chart, default-deny stays.
- a templates file under no known template selects every template under its
  nearest ancestor directory that holds known templates.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
classify.bats and subset-equivalence.bats check out and commit in one
shared fixture repo per file. `bats --jobs 4` (Action Tests) parallelizes
within files by default, so tests raced on .git/index.lock and saw each
other's working-tree changes. BATS_NO_PARALLELIZE_WITHIN_FILE keeps the
files parallel to each other and the tests of each file serial.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
An older ATLAS ignores an unknown ATLAS_* variable silently. With
ATLAS_SKIP_SECRETS set, it decrypts the SOPS files anyway. The map header
now lists the switches this version honors (skipSecrets, multiValueFilter,
redactSecrets). The no-match probe build returns the header too, so a
caller can check a switch in well under a second before it relies on it.

The list is additive: a new switch appends its name, the version stays 2.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Changed-file render subsetting stays available as "shadow" and "on",
but a consumer opts in. Shadow mode adds steps and a comment section, and
its coverage check is only meaningful when both sides render completely.
An unknown value now falls back to off.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max06
max06 force-pushed the review-subsetting branch from e543826 to f69e748 Compare October 12, 2026 09:27
@max06
max06 merged commit 3005d5c into main Oct 12, 2026
26 checks passed
@max06
max06 deleted the review-subsetting branch October 12, 2026 10:20
@max06
max06 restored the review-subsetting branch October 12, 2026 10:20
max06 added a commit that referenced this pull request Oct 12, 2026
…on lookups (#81)

- **CI matrix** (`tests.yml`): adds helm `v4.3.0` and helmfile `v1.8.1`,
so every supported minor is tested with its latest patch release, plus
`latest`.
- **Authenticated version lookups** (`tests.yml`, `test-actions.yml`):
the `api.github.com` calls that resolve `latest` send the workflow
token. Unauthenticated, they hit the rate limit (HTTP 403) and the job
failed with an empty version (seen twice on #78).
- **Action images**: atlas-render → helm 4.3.0, helmfile 1.8.1, sops
3.13.3, yq 4.54.1, kustomize 5.8.3; atlas-diff → yq 4.54.1.

## Verification

A/B render of a repository with 264 deployments (1830 files), old
against new tool versions:

- helm/helmfile/sops/yq: formatting only (blank lines, one trailing
space, one leading `---`); the parsed YAML is identical.
- kustomize 5.6.0 → 5.8.3: the `namespace` field is no longer set on the
cluster-scoped `ValidatingAdmissionPolicy` and
`ValidatingAdmissionPolicyBinding` of the gateway-api install.
Everything else is identical.

helmfile 1.8.1 includes the fix for the `helmfile list` deadlock with
more than 100 states (helmfile/helmfile#2773); its own image ships helm
4.3.0.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
@max06
max06 deleted the review-subsetting branch October 26, 2026 11:20
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