Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the go/autobuilder/package-not-found diagnostic message to make it clearer and more helpful for users. The changes address user confusion about whether CodeQL analysis is working and provide environment-specific guidance for setting up access to private registries.
Changes:
- Added new utility functions (
IsActionsWorkflow()andIsDynamicActionsWorkflow()) to detect the execution environment - Updated the diagnostic message to emphasize that CodeQL can analyze code without missing packages before discussing limitations
- Implemented environment-specific guidance for configuring private registry access (different messages for dynamic workflows, custom Actions workflows, and other environments)
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| go/extractor/util/util.go | Added two new helper functions to detect GitHub Actions execution context |
| go/extractor/diagnostics/diagnostics.go | Refactored diagnostic message generation with environment-aware guidance for private registry access |
| go/extractor/cli/go-autobuilder/go-autobuilder.go | Refactored to use new IsActionsWorkflow() utility function instead of inline environment variable check |
| go/extractor/diagnostics/BUILD.bazel | Added dependency on util package (auto-generated by gazelle) |
| go/ql/integration-tests/diagnostics/package-not-found-without-go-mod/test.py | Updated test to set GITHUB_ACTIONS environment variable for consistent test output |
| go/ql/integration-tests/diagnostics/package-not-found-without-go-mod/diagnostics.expected | Updated expected diagnostic message to match new format |
| go/ql/integration-tests/diagnostics/package-not-found-with-go-mod/test.py | Updated test to set GITHUB_ACTIONS environment variable for consistent test output |
| go/ql/integration-tests/diagnostics/package-not-found-with-go-mod/diagnostics.expected | Updated expected diagnostic message to match new format |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7e91ac5 to
f837d90
Compare
owen-mc
approved these changes
Jan 25, 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.
This PR improves the
go/autobuilder/package-not-founddiagnostic based on experiences with the current version of it:severityWarning, users sometimes interpret it as an error and incorrectly assume that the Go analysis is not working at all.To address these points, I have made the following changes:
dynamicworkflows, the user is shown a link to the private registry docs. For other Actions workflows, they are told to add a step to configure access. For other environments, they are told to ensuregohas access.Since the diagnostic message now depends on the environment, I have updated the two affected integration tests to always pretend to run in an Actions environment.