Repository navigation
chore: validate rendered compose YAML in staging deploy - #209
Merged
Merged
Conversation
akandic47
requested review from
MakMuftic,
mpetrun5 and
mpetrunic
as code owners
August 31, 2026 10:04
|
Go Test coverage is 36.5 %\ ✨ ✨ ✨ |
The staging deploy runner is a container without docker, so the docker compose config check always failed and reported the rendered compose as invalid. Validate with a yq parse instead, which catches envsubst producing broken YAML and prints the parse error without echoing the rendered file. Requires yq in the actions-runner image.
akandic47
force-pushed
the
chore/compose-validation-action
branch
from
August 31, 2026 10:17
9e2da86 to
c54fdef
Compare
|
Go Test coverage is 36.5 %\ ✨ ✨ ✨ |
mpetrunic
approved these changes
Aug 31, 2026
mj52951
approved these changes
Aug 31, 2026
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.
Problem
The staging deploy has been failing on the
Rendered docker-compose is invalidcheck added in #206 (e.g. run 33368743093). The rendered compose file is actually valid — the check itself could never succeed because the self-hosted runner is a container without docker, sodocker compose configfails for environmental reasons, and the step suppressed all output, making it look like a compose problem.Change
Replace the
docker compose configcheck with a plain YAML parse usingyq:This catches the realistic failure mode (envsubst producing broken YAML from a secret value) and prints the parse error with line/column to the log on failure, while discarding stdout so the rendered file's secret values are never echoed. Full compose-schema validation still effectively happens at deploy time via the Portainer HTTP status check from #206.
Requires
yqin the actions-runner image:On the
ghcr.io/actions/actions-runnerbase (Ubuntu 24.04, python3 preinstalled) this adds onlypython3-yaml python3-argcomplete python3-toml python3-xmltodict yq.Verification
Tested in a clean
ubuntu:24.04container against renders ofdeploy/docker-compose.staging.yml(with dummy secret values):could not find expected ':' in ..., line 19, column 6