Repository navigation
chore: validate rendered compose and surface Portainer errors in staging deploy - #206
Merged
Merged
Conversation
…ing deploy - validate docker-compose.rendered.yml with docker compose config before sending it to Portainer, failing early without printing the file - log the Portainer HTTP status code instead of failing with a bare curl exit 22 - drop stale SYG_RELAYER_COINMARKETCAPCONFIG_APIKEY from envsubst - always run cleanup so the rendered file is removed on failure
akandic47
requested review from
MakMuftic,
mpetrun5 and
mpetrunic
as code owners
August 21, 2026 14:16
mpetrun5
approved these changes
Aug 21, 2026
|
Go Test coverage is 36.5 %\ ✨ ✨ ✨ |
MakMuftic
approved these changes
Aug 24, 2026
akandic47
added a commit
that referenced
this pull request
Aug 31, 2026
## Problem The staging deploy has been failing on the `Rendered docker-compose is invalid` check added in #206 (e.g. [run 33368743093](https://github.com/sprintertech/sprinter-signing/actions/runs/33368743093/job/99414870056)). The rendered compose file is actually valid — the check itself could never succeed because the self-hosted runner is a container **without docker**, so `docker compose config` fails for environmental reasons, and the step suppressed all output, making it look like a compose problem. ## Change Replace the `docker compose config` check with a plain YAML parse using `yq`: ```yaml - name: Validate rendered docker-compose run: yq . docker-compose.rendered.yml > /dev/null ``` 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 `yq` in the actions-runner image: ``` sudo apt-get update && sudo apt-get install -y curl jq git gettext yq ``` On the `ghcr.io/actions/actions-runner` base (Ubuntu 24.04, python3 preinstalled) this adds only `python3-yaml python3-argcomplete python3-toml python3-xmltodict yq`. ## Verification Tested in a clean `ubuntu:24.04` container against renders of `deploy/docker-compose.staging.yml` (with dummy secret values): - valid render → exit 0, no output - render broken by a multiline secret → exit 1, `could not find expected ':' in ..., line 19, column 6`
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.
Description
Improves debuggability and safety of the staging Portainer deployment:
docker-compose.rendered.ymlwithdocker compose config -qbefore sending it to Portainer. A secret that corrupts the rendered YAML (e.g. a multi-line value) now fails fast in the render step, with validator output suppressed so no secret content can appear in public logs.--faildiscards the response), while still never printing the response body.SYG_RELAYER_COINMARKETCAPCONFIG_APIKEYfrom the envsubst list (secret removed in feat: replace coinmarketcap with pyth pricer #200).if: always()so the rendered file with secrets is removed even when the deploy fails.Related Issue Or Context
Staging deploys were failing with
Process completed with exit code 22and no further information.How Has This Been Tested? Testing details.
Render and validation logic exercised locally against
deploy/docker-compose.staging.yml: a valid render passes, a multi-line secret value fails validation before the Portainer call, and no file content is printed in either case.Types of changes