Repository navigation
feat(backstage-template-execution): pitch run checkpoints to homerun2 - #68
Merged
Merged
Conversation
…#55) Every checkpoint of a template run -- started, scaffolder-failed, build-started, build-failed, build-succeeded, merged, merge-refused, watch-failed, timeout -- goes to omni-pitcher as a homerun.Message with system backstage-template-execution, so request-vm / request-vm-deletion runs reach Teams through notification-catcher like cluster builds do. Same env contract as cluster-build-watch's sink (HOMERUN_PITCH_URL, HOMERUN_AUTH_TOKEN_FILE over HOMERUN_AUTH_TOKEN, https for a token, token scrubbed); a copy, the workflows are separate modules. Best effort: the Pitch activity is retried three times and its error dropped, and it is always scheduled so the history never depends on the env. The watched run now carries its PR number (pull_requests[0]) for title and link. deploy/main.k: optional -D homerunPitchURL / -D homerunTokenSecret, as in cluster-build-watch's deploy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016TtmNGbCHXQGtqnrT926ZN
This branch was successfully deployed
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.
Closes #55.
What:
backstage-template-executionpitches every checkpoint of a run to homerun2's omni-pitcher, sorequest-vm/request-vm-deletionruns reach Teams through notification-catcher (system: backstage-template-execution) the way cluster builds do.startedscaffolder-failed(call failed / task failed or cancelled / task did not finish)build-started(watched run appeared; PR number + run link)build-failedbuild-succeeded(says whether auto-merge follows)mergedmerge-refused(gate refusal names the checks)watch-failedtimeoutTitle e.g.
VM cutover2: merged (#3897),VM cutover2 deletion: build-failed (#3901); message carries template, lab/cloud/size/profile, PR, run and Backstage task links;url= PR, else run, else task. Not done: the name of the failed job (needs an extra jobs API call per failure) — the run link leads there.How:
homerun.go: same env contract as cluster-build-watch's sink (HOMERUN_PITCH_URL,HOMERUN_AUTH_TOKEN_FILEoverHOMERUN_AUTH_TOKEN, empty = off, token only over https, token scrubbed, URL dropped from transport errors). A copy with a pointer to the twin: the workflows are separate Go modules.Pitchactivity is retried 3× (10 s, 20 s);pitch()has no error return, so no checkpoint can change a run's result.HOMERUN_PITCH_URL— switching the sink on never changes a history.FetchGitHubRunnow returns the run's PR number (pull_requests[0]).deploy/main.k: optional-D homerunPitchURL/-D homerunTokenSecret, as in cluster-build-watch's deploy (default render unchanged).Tests:
go vet ./...clean,go test ./...ok — subject/title/link mapping, off switch, bearer from file over env, https refusal with token (nothing sent), plain http without token, 502 with the token echoed back → error without the token, unreachable URL not leaked, PR number parsed.Rollout caution: the workflow now schedules extra activities. An instance that is IN FLIGHT when the new image starts replays against a history without them — roll out when no BackstageTemplateRun is running (
kubectl -n backstage-workflows get backstagetemplaterun, worker logs idle).Follow-ups: release → argocd pin bump + chart wiring (stuttgart-things/argocd PR linked below) → catcher routing on sthings-app.
🤖 Generated with Claude Code
https://claude.ai/code/session_016TtmNGbCHXQGtqnrT926ZN