Skip to content

Conversation

@mbg
Copy link
Member

@mbg mbg commented Sep 5, 2025

I noticed that the Go autobuilder/extractor don't respect CODEQL_VERBOSITY and therefore the call to e.g. slog.Debug in registryproxy.go never has any effect. This PR sets the log level for slog based on the value of CODEQL_VERBOSITY.

@mbg mbg requested a review from a team as a code owner September 5, 2025 13:20
Copilot AI review requested due to automatic review settings September 5, 2025 13:20
@github-actions github-actions bot added the Go label Sep 5, 2025
Copy link
Contributor

Copilot AI left a comment

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 implements support for the CODEQL_VERBOSITY environment variable in the Go extractor and autobuilder to control logging levels. This ensures that debug logging (like slog.Debug calls) will be properly enabled based on the CodeQL CLI's verbosity settings.

  • Adds a new logging utility that maps CodeQL verbosity levels to slog levels
  • Integrates log level configuration into both the extractor and autobuilder entry points
  • Includes comprehensive tests for the verbosity level parsing logic

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
go/extractor/util/logging.go New utility module that defines verbosity constants and parsing logic to map CODEQL_VERBOSITY to slog levels
go/extractor/util/logging_test.go Comprehensive test coverage for the verbosity level parsing function
go/extractor/util/BUILD.bazel Updated build configuration to include the new logging module and tests
go/extractor/cli/go-extractor/go-extractor.go Calls the new SetLogLevel function at startup to configure logging
go/extractor/cli/go-extractor/BUILD.bazel Added dependency on the util package
go/extractor/cli/go-autobuilder/go-autobuilder.go Calls the new SetLogLevel function at startup to configure logging

@mbg mbg merged commit e18b049 into main Sep 5, 2025
16 checks passed
@mbg mbg deleted the mbg/go/use-codeql-verbosity branch September 5, 2025 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants