[log] Add debug logging to GitHub token/URL resolution in envutil#3684
Draft
github-actions[bot] wants to merge 1 commit intomainfrom
Draft
[log] Add debug logging to GitHub token/URL resolution in envutil#3684github-actions[bot] wants to merge 1 commit intomainfrom
github-actions[bot] wants to merge 1 commit intomainfrom
Conversation
Add logGitHub logger to internal/envutil/github.go to provide visibility
into which environment variable supplies the GitHub token and which URL
source is used for the API base URL.
Changes:
- Add logger import and logGitHub = logger.New("envutil:github")
- LookupGitHubToken: log entry with candidate count, log which env var
key was used (not the value, for security), log when no token found
- LookupGitHubAPIURL: log whether URL came from GITHUB_API_URL env var
or the default URL
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
12 tasks
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.
Summary
Adds debug logging to
internal/envutil/github.goto improve visibility into GitHub token and API URL resolution during troubleshooting.Changes
File modified:
internal/envutil/github.gologgerimport andvar logGitHub = logger.New("envutil:github")LookupGitHubToken: 3 log callsLookupGitHubAPIURL: 2 log callsGITHUB_API_URLenv var is usedWhy This Is Useful
LookupGitHubTokenis called during auth setup and it's often unclear in production which env var is providing the token (or if one is missing). These logs make that immediately visible whenDEBUG=envutil:*is set, without leaking the token value.Similarly,
LookupGitHubAPIURLis called during server startup and knowing whether the URL came from env or defaults helps diagnose routing issues.Testing
Enable debug logging to see output: