Add job metadata labels + annotations to runner pods when a job is assigned#4486
Open
arjunmadan-toast wants to merge 2 commits intoactions:masterfrom
Open
Add job metadata labels + annotations to runner pods when a job is assigned#4486arjunmadan-toast wants to merge 2 commits intoactions:masterfrom
arjunmadan-toast wants to merge 2 commits intoactions:masterfrom
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
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.
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)