Skip to content

Conversation

@mbg
Copy link
Member

@mbg mbg commented Jan 25, 2026

Mostly a follow-up from (and based on) #21213 which:

  • Makes diagnostics.go more easily testable by abstracting over the diagnostics output mechanism.
  • Adds unit tests for EmitCannotFindPackages

@mbg mbg requested a review from a team as a code owner January 25, 2026 15:13
@mbg mbg added the no-change-note-required This PR does not need a change note label Jan 25, 2026
@mbg mbg requested a review from a team as a code owner January 25, 2026 15:13
Copilot AI review requested due to automatic review settings January 25, 2026 15:13
@mbg mbg added the Go label Jan 25, 2026
@mbg mbg force-pushed the mbg/go/improve-package-not-found branch from 7e91ac5 to f837d90 Compare January 25, 2026 15:18
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 makes the Go extractor diagnostics output mechanism injectable to enable unit testing, and adds unit tests for the go/autobuilder/package-not-found diagnostic emitted by EmitCannotFindPackages.

Changes:

  • Introduce a DiagnosticsWriter abstraction and a file-backed default writer for diagnostics emission.
  • Update the extractor to call EmitCannotFindPackages with an explicit writer.
  • Add unit tests for EmitCannotFindPackages and wire them into Bazel.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
go/extractor/diagnostics/diagnostics.go Adds DiagnosticsWriter + file writer and routes EmitCannotFindPackages through an injected writer.
go/extractor/extractor.go Updates call site to pass diagnostics.DefaultWriter into EmitCannotFindPackages.
go/extractor/diagnostics/diagnostics_test.go Adds unit tests covering default/dynamic/actions messaging variants.
go/extractor/diagnostics/BUILD.bazel Adds a go_test target for the new unit tests.
go/extractor/go.mod Adds new module deps needed for tests (testify + transitive deps).
go/extractor/go.sum Updates dependency checksums accordingly.

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

@mbg mbg force-pushed the mbg/go/diagnostics-unit-tests branch from f262616 to 1fba381 Compare January 25, 2026 15:20
@mbg mbg force-pushed the mbg/go/diagnostics-unit-tests branch from 1fba381 to 45e0a92 Compare January 25, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Go no-change-note-required This PR does not need a change note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants