Skip to content

Fix ephemeral runner label collisions#36

Merged
intel352 merged 2 commits into
mainfrom
codex/unique-ephemeral-runner-labels-20260630
Jun 30, 2026
Merged

Fix ephemeral runner label collisions#36
intel352 merged 2 commits into
mainfrom
codex/unique-ephemeral-runner-labels-20260630

Conversation

@intel352

Copy link
Copy Markdown
Contributor

Summary

Fixes ephemeral GitHub runner name/label generation so timestamped workflow-compute dogfood tasks do not collapse to the same runner label.

The STG dogfood runs showed different task IDs reusing wfc-stg-ghp-linux-runner-l-provider, which let a stale/previous ephemeral runner consume a target workflow while the current provider-side runner waited indefinitely. This keeps the fix in workflow-plugin-github, where provider-owned runner lifecycle belongs.

Changes

  • Replace first-hyphen suffix truncation with GitHub-safe sanitized ID tails plus a SHA-256 prefix.
  • Add a regression for the two observed STG dogfood task IDs that previously collided.
  • Update runner-job command expectations for the new deterministic label shape.

Verification

  • go test ./internal -run 'TestT594EphemeralRunnerJob|TestT594RunnerProviderInvokesEphemeralRunnerJobSpec' -count=1
  • go test ./cmd/github-actions-runner-job -count=1
  • go test ./... -count=1
  • git diff --check

Self-review

Adversarial self-review checked scope ownership, collision behavior, label charset/length, deterministic tests, boundary placement, and secret/artifact impact. The only issue found was that the initial regression only asserted inequality; it now asserts the exact non-colliding labels for the two observed STG dogfood task IDs.

Copilot AI review requested due to automatic review settings June 30, 2026 06:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates ephemeral GitHub runner name/label generation to avoid collisions observed in timestamped dogfood tasks, ensuring each task dispatch targets the correct ephemeral runner.

Changes:

  • Reworked shortEphemeralID to produce GitHub-safe alphanumeric tokens with a deterministic SHA-256-derived suffix for longer IDs.
  • Updated deterministic-name tests and added a regression covering the two STG dogfood task IDs that previously collided.
  • Updated github-actions-runner-job command/test expectations to match the new runner name/label shape.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
internal/ephemeral_runner_job.go Changes the ID-shortening algorithm used to build ephemeral runner names/labels to reduce collisions.
internal/ephemeral_runner_job_test.go Updates expected runner names/labels and adds a regression test for previously colliding task IDs.
cmd/github-actions-runner-job/main_test.go Updates CLI/dispatch expectations for the new runner name/label format.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/ephemeral_runner_job.go Outdated
@intel352
intel352 merged commit b8fedce into main Jun 30, 2026
5 checks passed
@intel352
intel352 deleted the codex/unique-ephemeral-runner-labels-20260630 branch June 30, 2026 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants