Commit b7559e1
fix(dag): stop concurrent map crash in bulk terraform commands (#2831)
* fix(dag): stop concurrent map iteration/write crash in bulk terraform commands
FindStacksMap returns its cached stack config maps by reference, and
ProcessComponentConfig handed the shared component section straight to
callers. DAG-scheduled bulk commands (terraform --all/--affected/--query)
run ProcessStacks concurrently across workers, so one worker's writes
(atmos_component, workspace, sources, deps, merged auth, ...) raced with
another worker's reads of the same cached section, crashing with
`fatal error: concurrent map iteration and map write` at higher
--max-concurrency.
Shallow-clone the component section before mutating it, and apply the
same fix to two adjacent cache-corruption sites in the describe-stacks
processor that deleted keys from cache-owned maps in place. Add
regression tests that fail pre-fix both deterministically and under
-race.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(security): bump brace-expansion to patch CVE-2026-14257 (GHSA-mh99-v99m-4gvg)
brace-expansion <=5.0.7 lets expand() accumulate unbounded output length
from chained brace groups, causing an uncatchable OOM crash (high
severity, Dependabot alert #261). Bump the existing pnpm overrides for
both major lines in use here (transitive via minimatch, pulled in by
serve-handler/docusaurus and docusaurus-plugin-llms) to the patched
releases: 1.1.18 and 2.1.4, both published today with the
EXPANSION_MAX_LENGTH bound backported from the 5.0.8 fix. Verified by
diffing the published tarballs against the vulnerable versions.
Website builds clean with the bump; no Go code is affected.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* docs(fixes): add fix-log record for DAG concurrent map crash
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(ci): allowlist GHSA-mh99-v99m-4gvg pending advisory data update
The Dependency Review job still flags brace-expansion@1.1.18/2.1.4 (added
in the prior brace-expansion bump) because GHSA-mh99-v99m-4gvg's recorded
vulnerable range ("<=5.0.7") doesn't distinguish between brace-expansion's
parallel 1.x/2.x/5.x release lines. Both versions we use already contain
the same EXPANSION_MAX_LENGTH bound backported from the 5.0.8 fix,
verified by diffing the published tarballs against the CVE fix commit.
Upgrading further to the only version the advisory recognizes as patched
(5.0.8+) isn't safe here: brace-expansion 5.x's CommonJS build switched
from a callable default export to a named `exports.expand`, which breaks
minimatch@3.1.5's `require('brace-expansion')(...)` call convention
(transitive via serve-handler/@docusaurus/core) — a genuine breaking API
change, not just a semver-major label. Allowlisted following the existing
GHSA-fxhp-mv3v-67qp precedent in this same file, with the reasoning
recorded inline for removal once GitHub's advisory data or minimatch's
dependency catches up.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(describe): compute spacelift_stack/atlantis_project before templates
Acceptance tests started failing after the ProcessComponentConfig clone
(previous commit): describe component's tags.spacelift_stack/
tags.atlantis_project rendered as `<no value>` instead of the resolved
name, and path-resolved describe component (`.`/`./component`) showed an
empty imports list instead of the real one.
Both were pre-existing bugs masked by the exact cache-mutation issue just
fixed. `describe component` runs ProcessStacks twice per invocation (once
via resolveAuthManager's preliminary ExecuteDescribeComponent call, once
for the real result); pre-fix, the first call's completed computation
leaked into the second call's shared, unprotected cache entry, making
`{{ .spacelift_stack }}`/`{{ .atlantis_project }}` template references
resolve "by accident" and making a describe-stacks preliminary pass's
`delete(stackMap, "imports")` corruption invisible. Once ProcessStacks
stopped mutating the shared cache, each call started from a clean slate
and both latent bugs became visible and deterministic.
BuildSpaceliftStackNameFromComponentConfig/BuildAtlantisProjectNameFromComponentConfig
only depend on data already populated before template processing
(ComponentSettingsSection, ComponentVarsSection, ComponentFromArg, Stack),
so move both calls before the template-processing block instead of after
it. This makes `.spacelift_stack`/`.atlantis_project` genuinely available
to templates in a single pass, matching what the working
"describe component <name>" (backward-compatibility) golden snapshot
already showed, and consistent regardless of how many times ProcessStacks
runs per invocation.
Regenerated the 3 affected golden snapshots via `-regenerate-snapshots`
per repo convention (never hand-edited) — verified each diff against the
now-consistent, already-correct behavior on the other snapshot.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(ci): scope the brace-expansion GHSA allowlist to verified versions
Address CodeRabbit review feedback on PR #2831: allow-ghsas allowlists
GHSA-mh99-v99m-4gvg by ID only, so any future brace-expansion resolution
(an unpatched 3.x/4.x, or a 1.x/2.x release without the backported fix)
would silently bypass the vulnerability check. Add a CI step that parses
website/pnpm-lock.yaml and fails the job if any resolved brace-expansion
version isn't in the explicit verified-patched set (1.1.18, 2.1.4).
Also add regression tests closing the patch-coverage gap Codecov flagged
on the two Spacelift/Atlantis error-propagation lines moved earlier in
ProcessStacks: real, reachable error paths (a malformed name_template for
BuildSpaceliftStackNameFromComponentConfig; a type-mismatched
settings.atlantis.project_template for
BuildAtlantisProjectNameFromComponentConfig) that ProcessStacks must
surface rather than silently swallow.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(ci): make the brace-expansion guard's no-match diagnostic reachable
Address CodeRabbit review feedback on PR #2831: under `set -euo pipefail`,
grep's exit status 1 for "no matches" was propagating through the pipeline
into the `found=` assignment, aborting the step with a bare exit code
before the intended "No brace-expansion entries found" error message
ever printed. Convert grep's expected no-match status into empty input
while still preserving failures from a genuinely unreadable/missing file
(verified locally: exit 2 still aborts, exit 1 now reaches the diagnostic).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* docs(ci): correct override-pin wording in brace-expansion comment
Address CodeRabbit review feedback on PR #2831: the pnpm override
selectors (brace-expansion@^1/@^2) always carry a caret; only their
pinned target values (1.1.18/2.1.4) are exact. The prior comment
conflated the two, documenting an inaccurate contract.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(ci): drop brace-expansion lockfile re-verification step
The bash step re-parsing website/pnpm-lock.yaml on every PR was pure
defense-in-depth on top of the allow-ghsas suppression and has cost
four follow-up commits with no functional benefit over the one-line
allowlist entry. Investigated a real fix (traced the dependency chain
to serve-handler/minimatch, checked dependency-review-action's
suppression options, confirmed upstream status via
isaacs/minimatch#314 and #310): there isn't one currently reachable
from this repo, so the suppression is structurally required, not a
maintenance debt we're choosing to carry. Rewrote the allow-ghsas
comment with the upstream citations and a concrete removal condition
instead of dropping the extra verification step silently.
---------
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: Andriy Knysh <aknysh@users.noreply.github.com>1 parent b69113d commit b7559e1
9 files changed
Lines changed: 478 additions & 42 deletions
File tree
- .github/workflows
- docs/fixes
- internal/exec
- tests/snapshots
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
78 | 91 | | |
79 | 92 | | |
80 | 93 | | |
81 | 94 | | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
88 | 111 | | |
89 | 112 | | |
90 | 113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
259 | 260 | | |
260 | 261 | | |
261 | 262 | | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
262 | 268 | | |
263 | 269 | | |
264 | 270 | | |
| |||
974 | 980 | | |
975 | 981 | | |
976 | 982 | | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
977 | 988 | | |
978 | 989 | | |
979 | 990 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
0 commit comments