Repository navigation
fix: harden release builds and helmfile hydration - #48
Merged
Merged
Conversation
A component directory with neither helmfile.yaml nor kustomization/ wrote a 0-byte manifest and exited 0. Flux with prune: true could then delete the live resources. The check runs before the manifest is truncated, so the committed manifest stays. render-diff.sh relied on that empty output for the side of a diff where a component does not exist yet or anymore, so it now writes the empty side itself. A directory that exists without an input reports a render failure there, as the hydrator would. Every kubernetes/components/*/production in platform's origin/main has one of the two inputs, so no current component starts failing. Claude-Session: https://claude.ai/code/session_01N1XYRqYewzhQfyJcM9zFjG Signed-off-by: panicboat <panicboat@gmail.com>
Deleting kubernetes/components/<c>/<env>/ labels the pull request deploy:<c>,
but the resolver returns no helmfile target, so the hydrate job was skipped.
kubernetes/manifests/<env>/<c>/ stayed and Flux kept deploying it.
helmfile-targets-group now also lists each environment with an orphan directory,
with no services, so the hydrator runs only hydrate-index.sh for it.
The job needs both checkouts and runs whenever resolve succeeded, including when
no pull request was found and the targets output is empty.
deploy-helmfile-hydrate skips an empty list because fromJson('[]') fails the matrix.
deploy-helmfile and deployment-summary keep their conditions.
The detection reads the default merge ref like the resolve job, so it adds no
failure mode for a branch that no longer exists.
Claude-Session: https://claude.ai/code/session_01N1XYRqYewzhQfyJcM9zFjG
Signed-off-by: panicboat <panicboat@gmail.com>
reusable--release--build.yaml read the config at the tag, but the image builder's checkout had no ref. A manual workflow_dispatch with tag=monolith-v0.9.0 therefore built main's code and overwrote :v0.9.0. The image builder takes an optional ref, whose empty default keeps the label flow's checkout, and the release build passes the tag. Claude-Session: https://claude.ai/code/session_01N1XYRqYewzhQfyJcM9zFjG Signed-off-by: panicboat <panicboat@gmail.com>
The release build parsed tags with [a-z-]+ and release-service.sh used [a-z0-9-]+, while a service name is [a-zA-Z0-9_-]+ in deploy-actions. route53 and oauth2-proxy could deploy but not build. release-service.sh now holds the one rule for both modes, and the release build calls it, which needs the shared workflows checkout that the plan and deploy workflows use. The version is what follows "<service>-" in the validated tag, so it needs no second rule, and greedy matching keeps the hyphens of a name such as github-oidc-auth. The ::error:: for a bad tag now comes from the script. The test that expected no checkout in detect-component now expects only the shared workflows checkout, which keeps its intent that the consumer tree is not checked out. Claude-Session: https://claude.ai/code/session_01N1XYRqYewzhQfyJcM9zFjG Signed-off-by: panicboat <panicboat@gmail.com>
A release build now checks out its tag, so a manual workflow_dispatch of an old tag from main would have pushed the old code as :latest. The latest tag now also requires an empty ref. A release event passes a ref as well, and is_default_branch is already false there because its ref is the tag, so its tags do not change. The sha and actor tags stay, because the release event's sha tag names the commit it builds. Claude-Session: https://claude.ai/code/session_01N1XYRqYewzhQfyJcM9zFjG Signed-off-by: panicboat <panicboat@gmail.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
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.
What This PR Does
release の build と helmfile の hydrate で、黙って誤った結果になる 4 つの問題を直します。
What Needs to Change
prune: trueで、実際のリソースが消えるおそれがある。tag=monolith-v0.9.0で実行すると、main のコードで:v0.9.0を上書きする。route53のような数字入りの service は、deploy はできても build ができない。What Changes for Users
kubernetes/manifests/<env>/<component>が残る。:latestも動く。:latestは動かさない。[a-zA-Z0-9_-]+になります。[a-z-]+、plan と deploy は[a-z0-9-]+。release-service.shの同じ規則を使う。What to Review Closely
helmfile-targets-groupが、helmfile の target がなくても毎回動くようになること。What Was Decided
hydrate-index.shと同じ定義で行う。render-diff.shは、片側に component がないときに空の manifest を自分で書く。hydrate-component.shの 0 byte の出力に頼っていて、新しい確認で動かなくなるため。:latestだけを手動の再 build から外し、sha と actor のタグは変えない。:latestで、release のイベントの sha のタグは残したいため。What Else Is Affected
Documents
Systems & Operations
ifとfromJsonの matrix の評価順、auto-commit が削除もコミットすること、:latestのenableの評価、手動の build がタグのソースを使うこと。How It Was Verified
for f in scripts/*/test.sh scripts/*/*.test.sh scripts/kubernetes-hydrate/tests/*.test.sh; do bash "$f"; done→ すべて PASShelmfile.yamlかkustomization/があることを確かめました。beyla/productionを消すと、orphan-environments.shが["production"]を返し、hydrate-index.shが manifest と index の行を消すことを確かめました。actionlintの増分は、既知のjob.workflow_repositoryとjob.workflow_shaの指摘だけでした。🤖 Generated with Claude Code
https://claude.ai/code/session_01N1XYRqYewzhQfyJcM9zFjG