Repository navigation
Send the CI run id with GraphQL requests - #316
Merged
Merged
Conversation
Adds an X-Entitlements-Run-Id header from GITHUB_RUN_ID, when set, so a proxy such as entitlements-caches can tie its logs to a specific CI run. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
The narrowly scoped change includes unit coverage for both configured and unset GITHUB_RUN_ID cases, with no active review issues remaining.
No open issues 🎉
What changed in this PR
Adds optional CI run identification to GraphQL requests so entitlements-caches can associate requests with GitHub Actions runs, while preserving existing behavior when GITHUB_RUN_ID is unset.
Changes:
- Adds the
X-Entitlements-Run-Idheader to GraphQL requests whenGITHUB_RUN_IDis available. - Adds unit coverage for both configured and unset run-ID scenarios.
| File | Summary |
|---|---|
lib/​entitlements/​service/​github.rb |
Conditionally attaches the CI run ID header to GraphQL requests. The new comment should be revised into a complete sentence. |
spec/​unit/​entitlements/​service/​github_spec.rb |
Verifies header inclusion and omission behavior based on GITHUB_RUN_ID. |
Review effort: Lite (auto)
northrup
approved these changes
Nov 4, 2026
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.
What
When
GITHUB_RUN_IDis set, GraphQL requests now carry anX-Entitlements-Run-Idheader with its value. Without the variable, nothing changes.Why
entitlements-cachessits in front of GitHub for CI, but its logs only show the client IP, so we can't tell which CI run made a slow or missed request. With this header, the cache can log the run id (github/entitlements-caches companion PR).Notes
GITHUB_RUN_ATTEMPTisn't passed into the entitlements CI container.Testing
bundle exec rspec spec/unit/entitlements/service/github_spec.rb spec/unit/entitlements/backend/github_team/service_spec.rb: 90 examples, 0 failures. rubocop is clean.