Skip to content

fix(ci): one stack-asset check, and derive what it needs from the compose file - #28

Open
allanice001 wants to merge 1 commit into
mainfrom
fix/one-stack-asset-check
Open

allanice001 wants to merge 1 commit into
mainfrom
fix/one-stack-asset-check

Conversation

@allanice001

Copy link
Copy Markdown
Contributor

ci.yml and release.yml each carried their own copy of the compose validation, including a hand-written list of the credentials to supply. #27 gave the compose file three new :? requirements; ci.yml was updated and release.yml was not, so the release job for v0.4.0 failed on a tag that had already been pushed — the one moment this repo is least able to absorb a mistake, since a tag is only undone by deleting a release.

Both jobs now call .github/scripts/check-stack-assets.sh, and the script reads the required variables out of the compose file rather than repeating them:

required=$(grep -oE '\$\{[A-Z_][A-Z0-9_]*:\?' "$compose" | sed 's/^\${//; s/:?$//' | sort -u)

A service added with a new credential is picked up with nothing to remember, which is the only version of this that survives the next service. Verified by temporarily adding a ${BRAND_NEW_CREDENTIAL:?} to the compose file — the script picked it up and still passed, with no edit to the script.

Together with TestWriteEnvCoversEveryRequiredComposeVariable from #27, both ends are held: the generator must emit every required variable, and the check must supply every one, and neither list is written down twice.

Nothing was published for v0.4.0 — verify gated goreleaser, so there is no release to undo. The tag will need re-cutting once this lands.

🤖 Generated with Claude Code

https://claude.ai/code/session_013uGZy72FJV4SV2xh3nTvU9

…pose file

ci.yml and release.yml each carried their own copy of the compose validation,
including a hand-written list of the credentials to supply. Adding keycloak,
openbao and dex gave the compose file three new `:?` requirements; ci.yml was
updated and release.yml was not, so the release job failed on a tag that had
already been pushed -- the one moment this repo is least able to absorb a
mistake, since a tag is only undone by deleting a release.

Both now call .github/scripts/check-stack-assets.sh, and the script reads the
required variables out of the compose file rather than repeating them. A
service added with a new credential is picked up with nothing to remember,
which is the only version of this that survives the next service.

Together with TestWriteEnvCoversEveryRequiredComposeVariable, both ends are
held: the generator must emit every required variable, and the check must
supply every one, and neither list is written down twice.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013uGZy72FJV4SV2xh3nTvU9
Signed-off-by: allanice001 <allanice001@gmail.com>
@dragonsecurity-ci

Copy link
Copy Markdown

✅ DragonGuard: PASS

Posture 93/100 (+0 from 93) · 5 findings

No blocking conditions.

Top findings
Risk Finding Location Fix
60 Image user should not be 'root' internal/stack/assets/pgbouncer/Dockerfile –
60 Image user should not be 'root' internal/stack/assets/postgres/Dockerfile –
42 Repository declares no asset context .dragon.yaml –
38 No HEALTHCHECK defined internal/stack/assets/postgres/Dockerfile –
38 No HEALTHCHECK defined internal/stack/assets/pgbouncer/Dockerfile –

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