Repository navigation
Conversation
Fails on main: the comprehensive production stack and the compute smoke stack push a FileBucket name past S3's 63-character limit once PR numbers reach four digits.
…it PRs The stack name prefixes every derived resource name and the CI suffix carries the PR number. From PR 1000 the comprehensive app's production stack (bb-test-prod-pr-<n>-<attempt>-runner-<salt>) made the preset-balanced agent's session bucket 64 characters, and the compute smoke stack (bb-compute-smoke-<id>-compute-<n>-<attempt>) did the same to its artifacts bucket, so both failed at synth before any test ran. - comprehensive production stack: keep only the random half of the sandbox id; the user half is always 'runner' in CI. - compute smoke job: suffix pr-<n>-<attempt> instead of compute-<n>-...; the stack name already says compute-smoke. - run scripts/ci/stack-name-budget.test.mjs in Build, Unit Tests, E2E Local. Stack-name prefixes are unchanged (bb-test-, bb-compute-smoke-), so what the cleanup workflow and the CI role's prefix-scoped grants match is unchanged too. (bb-compute-smoke- is in neither list today; that predates this change.)
…udget test Fail when a pr-checks.yml job sets a stack suffix but is neither checked nor skipped with a reason; check RDS database names too; parse the suffix once per job (quotes and trailing comments stripped); bound each synth to 3 minutes.
Run tsx as an in-process loader so the spawn timeout stops the synth rather than only npx, and say why a synth died (timeout, signal) in the failure message.
|
| # Synthesizes each E2E app with its job's stack suffix at a 5-digit PR | ||
| # number, so a name that outgrows its AWS limit fails here, not at deploy. | ||
| - name: Test the E2E stack-name budget | ||
| run: node --test scripts/ci/stack-name-budget.test.mjs |
There was a problem hiding this comment.
is this an overkill? compute -> pr gives us plenty room, same as other changes bellow
|
Closing as superseded by #1031, which merged the same fix (production stack name keeps only the random half of the sandbox id; Compute Smoke suffix is pr--). The stack-name budget guard from this PR is not carried over. |
Problem
E2E Production fails at synth on every PR numbered 1000 or above, before any test runs. For example, on #1016:
The stack name is the prefix of every derived resource name, and the CI suffix
pr-<number>-<attempt>carries the PR number. In the comprehensive app's production mode the stack name isbb-test-prod-<suffix>-<user>-<random>, and<user>is alwaysrunnerin CI. The longest bucket name (thepreset-balancedagent's session bucket) was exactly 63 characters at three-digit PR numbers.E2E Compute Smoke has the same defect. It just hasn't reached synth on a four-digit PR yet. Its stack
bb-compute-smoke-<id>-compute-<n>-<attempt>makes...-compute-smoke-artifacts64 characters at PR 1016.Fix (CI and test app only, no published package changes)
test-apps/comprehensive/aws-blocks/index.cdk.ts: the production stack name keeps only the random half of the sandbox id, givingbb-test-prod-pr-1016-1-qb3cmv. That brings the longest bucket from 64 down to 57 characters.pr-checks.yml, E2E Compute Smoke: the suffix ispr-<n>-<attempt>instead ofcompute-<n>-<attempt>, because the stack name already starts withbb-compute-smoke-. That brings the bucket from 64 down to 59 characters.scripts/ci/stack-name-budget.test.mjs, run in Build, Unit Tests, E2E Local:BLOCKS_STACK_SUFFIX, it renders that job's real suffix for PR 99999, attempt 99, then synthesizes the job's app offline and fails on any S3 bucket, S3 Vectors or RDS database name over 63 characters.SKIPwith a reason fails the test.Names stay unique per PR, per attempt and per push, because the per-checkout random salt is kept. The stack-name prefixes (
bb-test-,bb-compute-smoke-) are unchanged, so the cleanup workflow and the CI role's prefix-scoped grants match the same stacks as before.Verification
--network none.cdk synthin production mode withpr-1016-1passes after the fix and failed before.npm run build,lint:deps,npm test,test:e2e:localandlintare green, and so areactionlintandcheck-actions-pinned.test-apps/, so every E2E job runs, E2E Production and E2E Compute Smoke included.Notes
test:productionstack name changes frombb-test-prod-default-<user>-<random>tobb-test-prod-default-<random>. A stack deployed under the old name before this change won't be found bynpm run destroy. The scheduled cleanup still sweepsbb-test-*.bb-compute-smoke-is in neither the cleanup workflow's prefix lists nor the CI role's prefix list..github/,scripts/ci/and the private comprehensive test app change.