ci(console): build per-PR canary console image (JITSU-159) - #1454
Open
absorbb wants to merge 1 commit into
Open
Conversation
…-159) Add .github/workflows/build-console-canary.yml. On a PR labeled `canary:console` it builds the console image from the PR head and pushes `jitsucom/console:canary-<short_sha>` for the ArgoCD canary ApplicationSet in jitsu-cloud-infra to deploy at pr<N>.use.jitsu.com. - pull_request (NOT pull_request_target): fork PRs get no DOCKERHUB_* secrets, so fork code cannot build a canary image — the canary trust boundary. - Tag suffix = first 7 chars of the head SHA == ArgoCD head_short_sha_7. - Single console target, arm64 (canaries inherit the prod purpose:sync/arm64 placement). Mirrors services.yaml login/buildx-cloud/build patterns. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Reviewed the new canary build workflow in .github/workflows/build-console-canary.yml across trigger conditions, trust boundary assumptions, secret usage, tagging contract, and build/push behavior.
I did not find actionable bugs, security issues, or correctness regressions in this changeset.
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.
Part of JITSU-159 — the build half of per-PR canary console deployments. Companion infra PR: jitsucom/jitsu-cloud-infra#73.
What
Adds
.github/workflows/build-console-canary.yml. When a PR is labeledcanary:console, it builds the console image from the PR head and pushesjitsucom/console:canary-<short_sha>. The ArgoCD ApplicationSet in jitsu-cloud-infra (k8s/canary-console) then deploys it atpr<N>.use.jitsu.comin read-only mode.Key decisions
pull_request, NOTpull_request_target— this is the trust boundary. GitHub withholdsDOCKERHUB_*secrets from fork-triggeredpull_requestruns, so a fork PR cannot build/push a canary image even if labeled. Combined with the maintainer-only label, canary code is always maintainer-opted-in code from a same-repo branch.${HEAD_SHA:0:7}), which is exactly ArgoCD'shead_short_sha_7and matches this repo's--short=7convention. The ApplicationSet referencescanary-{{.head_short_sha_7}}; the two must stay in lockstep or canariesImagePullBackOff. Deliberately notgit rev-parse --short(which can grow past 7 on ambiguity).consoletarget,linux/arm64— canaries inherit the prod console'snodeSelector: {purpose: sync}+ arm64 toleration, so they schedule on the arm64 sync pool. (Comment flags adding amd64 if that placement changes.)services.yamlpublish patterns:docker/login-action@v4(DOCKERHUB_USERNAME/TOKEN), buildx cloud driver (endpoint: jitsucom/newjitsu),docker buildx build --target console -f all.Dockerfile .with theJITSU_BUILD_*args.permissions: contents: read; per-PRconcurrencywithcancel-in-progress.Notes
canary-<sha>tags accumulate in Docker Hub across pushes (not garbage-collected here) — acceptable; can add cleanup later.canary:consolelabel to exist in the repo and the DNS/token/controller prerequisites tracked in the infra PR before canaries are live end-to-end.🤖 Generated with Claude Code