Add job metadata labels + annotations to runner pods when a job is assigned#4486
Add job metadata labels + annotations to runner pods when a job is assigned#4486arjunmadan-toast wants to merge 3 commits into
Conversation
When the listener reports a job assignment via EphemeralRunner status, the reconciler now patches the runner pod with labels and annotations identifying the repository, job name, job ID, and workflow run ID. This enables cost attribution for shared org-level runner pools. Generated with Claude Code
- Move labelPodWithJobInfo before container status switch so labels are applied even when the job finishes before the next reconcile - Check JobRepositoryName instead of HasJob() since GHES doesn't populate JobID in the event payload - Replace character-by-character sanitizer with regex that handles all invalid label characters and enforces start/end constraints - Add patch verb to scale set manager role for pod resources Generated with Claude Code
…roller into label-pods-with-job-info
|
thanks for working on this! i have been hoping for this feature for a long time. it would really help my team to have better visibility into our users' usage of our self-hosted runners. i'm not a maintainer but i do have one suggestion that i hope you and the team will conisder. happy to defer to the maintainers on what the right shape for this opt-in mechanism would look like; maybe it could be similar to the thank you again for making the issue #4485 and this PR |
Addresses #4485 by patching pod labels/annotations with job metadata when the controller reconciles an EphemeralRunner that has been assigned a job:
actions.github.com/job-repository (label, sanitized)
actions.github.com/job-display-name (label, sanitized)
actions.github.com/job-repository-name (annotation, full value)
actions.github.com/workflow-run-id (annotation)