Repository navigation
fsx: stop panicking on a CREATING filesystem; quote the PERSISTENT_2 storage rate - #627
Merged
Merged
Conversation
…NT_2 storage rate #618: GetFSxFilesystem dereferenced DNSName, LustreConfiguration.MountName and StorageCapacity unconditionally. All three are optional in the API and a filesystem still CREATING has no DNSName and no LustreConfiguration at all, so reaching this during provisioning panicked instead of returning something usable — and CREATING is the exact window spawn#613 was reported from. The tag scan had the same shape (Tag.Key/Value are both optional). The mapping is extracted as a pure fsxInfoFrom so it can be tested against any lifecycle state without AWS; the new test panics against the pre-fix code. Empty DNSName/MountName is the meaningful answer — a mount cannot be built without them, so 'not ready' is reported rather than crashing. #619: fsx info multiplied capacity by a hardcoded 0.22, commented '$0.22/GB-month for SSD'. That is a PERSISTENT_1 rate applied to filesystems spawn creates as PERSISTENT_2, whose rate at the default 125 MB/s/TiB tier is $0.145 — overstating a 1200 GiB filesystem by ~52% ($264 vs $174). Since #617 made --estimate-only quote storage cost, two spawn commands disagreed about the same filesystem. It now reads the actual throughput tier off the filesystem and uses the single shared rate table in cmd/fsx_cost.go (fsxLustreMonthlyUSD), with both derefs guarded for the same CREATING case. A drift gate fails if any file in cmd/ names an FSx rate in code again, and pins the rate to the PERSISTENT_2 values so 'one source' cannot be satisfied by centralising the wrong number. Refs #618, #619
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
scttfrdmn
added a commit
that referenced
this pull request
Oct 1, 2026
Promote Unreleased to [0.112.1] and update compare links. Also adds the CHANGELOG entries for #618/#619, which PR #627 shipped without — CLAUDE.md requires the changelog in the same PR as the change, and that was missed. Recording it here rather than leaving the release unexplained. PATCH: a crash fix and a corrected cost figure; no flag, schema or behaviour change.
This was referenced Oct 1, 2026
Merged
scttfrdmn
added a commit
that referenced
this pull request
Oct 3, 2026
Third attempt at the presence half, and the first that actually runs. Attempt 1: 'git diff base...HEAD' at fetch depth 1 — died with 'no merge base' (exit 128) before reaching any logic, which would have failed EVERY pull request. Attempt 2: deepen main to 100 commits — still no merge base, because the PR branch is itself fetched at depth 1, so no shared object exists locally. The gate then took its warn-and-skip fail-safe on every run. That is the worse outcome: it reads as enforcement while enforcing nothing, which is exactly the defect #624 fixed in the reaper-coverage check. Attempt 3: 'gh api repos/{repo}/pulls/{n}/files'. GitHub already knows what the PR changed; no history needed, nothing to go shallow. All context still arrives via env, so there is no '${{ }}' in the script body and Semgrep's run-shell-injection rule stays satisfied. Validated against three real PRs rather than reasoned about: #638 (this one: test + CI + docs) -> SKIP, correct #636 (4 non-test .go + CHANGELOG.md) -> PASS #627 (2 non-test .go, no changelog) -> FAIL, the PR that prompted all of this The API-failure and empty-result paths still warn and pass: a gate must fail on a known violation, not on its own inability to measure one.
scttfrdmn
added a commit
that referenced
this pull request
Oct 3, 2026
* ci: enforce the changelog policy instead of trusting habit CLAUDE.md requires a CHANGELOG entry under [Unreleased] in the SAME PR as any user-facing change, and the release ritual promotes that section verbatim. Nothing checked either half, and both broke within a week. #627 merged with no entry at all. It surfaced at the next release, which hit an EMPTY [Unreleased] and had to reconstruct the entries from the diff at tag time — precisely when you least want to be reverse-engineering what a change did. Separately, three PRs each inserted their own '### Added' at the top of [Unreleased]. That merges cleanly for git and badly for Keep a Changelog: the section ended up with duplicate '### Added' and '### Fixed' headings, consolidated by hand at release time. Then it happened a second time. Two halves, because they need different things: - changelog_test.go (plain Go test, runs on push and locally): [Unreleased] has no duplicate groups, no unknown group names, no entries outside a group; and every single-version release heading has a compare link. - A CI step (PR-only, since it needs the base branch): a PR that changes non-test Go source must touch CHANGELOG.md. Test-only, CI-only and docs-gen-only changes are exempt — there is nothing user-facing to describe — and the failure message says what to write and why the gate exists. Format checks are scoped to [Unreleased] deliberately. Run over the whole file they report duplicate groups in roughly a dozen SHIPPED releases and two invented group names ('### CI', '### Changed (internal refactors — no behavior change)'). Gating frozen history would force either a mass rewrite of released notes or a permanently red test, and a permanently red test gets disabled — worse than no test. The job is to stop new occurrences in the one section still being edited, which is also the only place the problem creates work. The compare-link check skips range headings like '[0.36.0 – 0.36.13]', which summarise a span and have no single diff to point at; demanding a link there would be a false positive that teaches people to ignore the test. Each check was verified to fail on the real mistake it describes, and CLAUDE.md now says the policy is enforced rather than advisory. * fix(ci): the changelog gate had two bugs of its own 1. Shell injection. '${{ github.base_ref }}' interpolated into a run: block is a script-injection vector, and Semgrep's run-shell-injection rule blocked the PR — correctly. It is now passed via env: and referenced as $BASE_REF, with nothing from the github context in the script body. 2. It would have failed EVERY pull request. 'git diff base...HEAD' needs a merge base, the checkout is shallow, and a depth-1 fetch has no common ancestor — so the step died with 'fatal: origin/main...HEAD: no merge base' (exit 128) before any of the logic ran. Not a false positive: a total block on all work, shipped in CI. Caught on this PR's own first run. Now it deepens the fetch, resolves the merge base explicitly, and diffs from it, so the unresolvable case is detectable rather than fatal. When the merge base cannot be found (long-lived branch, force-pushed base) it WARNS and passes: a gate must fail on a known violation, not on its own inability to measure one. Both paths verified locally — the normal case computes the right file list and verdict, and a disconnected history warns and exits 0. * fix(ci): ask the API what the PR changed, not a shallow clone Third attempt at the presence half, and the first that actually runs. Attempt 1: 'git diff base...HEAD' at fetch depth 1 — died with 'no merge base' (exit 128) before reaching any logic, which would have failed EVERY pull request. Attempt 2: deepen main to 100 commits — still no merge base, because the PR branch is itself fetched at depth 1, so no shared object exists locally. The gate then took its warn-and-skip fail-safe on every run. That is the worse outcome: it reads as enforcement while enforcing nothing, which is exactly the defect #624 fixed in the reaper-coverage check. Attempt 3: 'gh api repos/{repo}/pulls/{n}/files'. GitHub already knows what the PR changed; no history needed, nothing to go shallow. All context still arrives via env, so there is no '${{ }}' in the script body and Semgrep's run-shell-injection rule stays satisfied. Validated against three real PRs rather than reasoned about: #638 (this one: test + CI + docs) -> SKIP, correct #636 (4 non-test .go + CHANGELOG.md) -> PASS #627 (2 non-test .go, no changelog) -> FAIL, the PR that prompted all of this The API-failure and empty-result paths still warn and pass: a gate must fail on a known violation, not on its own inability to measure one.
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.
Refs #618, #619. Both were found while implementing #613's visibility fixes (#617), which had to route around #618 rather than change shared behaviour.
#618 —
GetFSxFilesystempanicked on a provisioning filesystempkg/aws/fsx.godereferenced three optional fields unconditionally:A filesystem in
CREATINGhas noDNSNameand noLustreConfigurationat all, so this was a nil-pointer panic rather than an error return — on a code path otherwise about to do real work. The tag scan had the same shape (*tag.Key/*tag.Valueare both optional).CREATINGis not an edge case. FSx Lustre takes minutes to provision, and #613's reporter terminated their instance while the filesystem was stillCREATING— the exact window. Reachable fromcmd/launch_single.go:540andcmd/task.go:966.Verified, not assumed. I reintroduced the old derefs and ran the new test:
Fixed, it passes. The mapping is extracted as a pure
fsxInfoFrom(types.FileSystem)so it can be exercised against any lifecycle state without AWS — the existing tests here go through Substrate, which won't reliably reproduce a half-populatedCREATINGfilesystem.Empty
DNSName/MountNameis the meaningful result: a mount can't be constructed without them, so a not-ready filesystem reports as such instead of crashing the CLI.#619 —
fsx infoquoted a PERSISTENT_1 rate$0.22/GiB-monthis a PERSISTENT_1 figure. Every filesystem spawn creates is PERSISTENT_2, whose us-east-1 rate at the default 125 MB/s/TiB tier is $0.145 — and PERSISTENT_2 folds the throughput tier into the per-GiB price, so there is no single correct constant across tiers.fsx infobefore~52% high. And since #617 taught
--estimate-onlyto quote storage cost, two spawn commands disagreed about the same filesystem — which is worse than the previous silence, because a user reconciling against a real bill concludes the tool is guessing.It now reads the actual throughput tier off the filesystem and calls the single shared
fsxLustreMonthlyUSDfromcmd/fsx_cost.go, labels the figure approximate with its region, and prints "unknown (storage capacity not reported yet)" rather than$0.00when capacity isn't populated — the sameCREATINGcase as #618.Tests
pkg/aws/fsx_info_test.go— CREATING (panics pre-fix), nil tag Key/Value, and a fully-populated AVAILABLE filesystem so making the nil case safe can't have broken the normal one.cmd/fsx_rate_consistency_test.go— two gates, following thefsx_promise_gate_test.goprecedent from #617:cmd/names an FSx rate in code (comments are stripped, so prose explaining why0.22was wrong stays legal). Proven by reintroducing0.22intofsx.go, which fails the gate.fsxLustreUSDPerGiBMonth(125) == 0.145and the 1200 GiB floor at ~$174, so "one source" can't be satisfied by centralising the wrong rate.That second gate matters because the first one alone would have been happy with
0.22as long as it lived in one file.Gates
gofmtclean ·go vet ./...clean ·go build ./...clean ·go test ./...all green ·make check-docsclean ·staticcheck ./...61 on main, 61 here, zero added (diffed).Suggested bump: PATCH — a crash fix and a corrected number, no flag or behaviour change.