Skip to content

Feat/support sideeffect imports - #9

Merged
bubunyo merged 6 commits into
masterfrom
feat/support-sideeffect-imports
Mar 20, 2026
Merged

Feat/support sideeffect imports#9
bubunyo merged 6 commits into
masterfrom
feat/support-sideeffect-imports

Conversation

@bubunyo

@bubunyo bubunyo commented Mar 13, 2026

Copy link
Copy Markdown
Owner

support sideeffect imports in build graph

Copilot AI review requested due to automatic review settings March 13, 2026 17:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for Go blank (side-effect) imports to the generated call graph so that changes in side-effect-only packages (via init()) correctly propagate to affected services during impact analysis.

Changes:

  • Add a synthetic dependency edge for blank imports by linking importer package init → imported package init in the call graph’s reverse index.
  • Introduce a testproject/core/sideeffect package and blank-import it from service-a as a concrete fixture.
  • Add/extend tests to validate blank-import impact propagation and reverse-index tracking.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
testproject/services/service-a/main.go Adds a blank import of the new side-effect package to exercise the behavior.
testproject/core/sideeffect/sideeffect.go New side-effect package with init() to simulate registration.
pkg/impact/impact_test.go Adds an impact test covering propagation from side-effect-only dependencies.
pkg/analyzer/analyzer_test.go Adds an integration-style test asserting the reverse index includes blank-import edges.
pkg/analyzer/analyzer.go Implements synthesis of blank-import dependency edges during graph construction.

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

Comment thread pkg/analyzer/analyzer.go
Comment thread pkg/analyzer/analyzer.go Outdated
Comment thread pkg/impact/impact_test.go Outdated
Comment thread pkg/analyzer/analyzer_test.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for Go side-effect (blank) imports to the build graph so that changes in packages imported via import _ "pkg" correctly trigger rebuilds of importing services.

Changes:

  • Add synthetic reverse-index edges for blank imports by linking importer init → imported init during graph build.
  • Add a new testproject/core/sideeffect package and blank-import it from service-a to exercise the behavior.
  • Add/extend analyzer + impact tests covering blank-import dependency propagation.

Reviewed changes

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

Show a summary per file
File Description
testproject/services/service-a/main.go Introduces a blank import of core/sideeffect to create a side-effect-only dependency.
testproject/core/sideeffect/sideeffect.go Adds a minimal side-effect package used by integration tests.
pkg/impact/impact_test.go Adds a unit test for impact propagation when a side-effect dependency changes.
pkg/analyzer/analyzer_test.go Adds an integration test asserting blank-import edges appear in the reverse index.
pkg/analyzer/analyzer.go Implements synthesiseBlankImportEdges() and supporting namedImports() helper.

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

Comment thread testproject/core/sideeffect/sideeffect.go Outdated
Comment thread pkg/impact/impact_test.go Outdated
Comment thread pkg/analyzer/analyzer_test.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for Go side-effect (blank) imports in the build graph so that changes in packages imported only via import _ "..." still propagate rebuild impact to importing services.

Changes:

  • Add a core sideeffect package and blank-import it from service-a to represent a side-effect-only dependency.
  • Extend the analyzer to synthesize reverse-index (and deps) edges for internal blank imports.
  • Add unit tests covering reverse-index tracking and impact propagation for side-effect-only dependencies.

Reviewed changes

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

Show a summary per file
File Description
testproject/services/service-a/main.go Adds a blank import of the new side-effect package to exercise the behavior.
testproject/core/sideeffect/sideeffect.go Introduces a minimal side-effect package via init() to simulate registration.
pkg/impact/impact_test.go Adds an impact propagation test for a side-effect-only dependency edge.
pkg/analyzer/analyzer_test.go Adds a BuildGraph test ensuring blank-import side-effect edges appear in the reverse index.
pkg/analyzer/analyzer.go Implements blank-import edge synthesis by inspecting loaded package syntax/imports.

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

Comment thread pkg/analyzer/analyzer.go Outdated
Comment thread pkg/analyzer/analyzer.go Outdated
Comment thread pkg/analyzer/analyzer_test.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for Go blank (_) imports (side-effect-only dependencies) so that the build graph can attribute init-time dependencies and schedule correct downstream service rebuilds when those packages change.

Changes:

  • Add blank-import edge synthesis to Analyzer.BuildGraph() to model side-effect dependencies in the call graph’s reverse index.
  • Extend the testproject fixture with a new core/sideeffect package and a blank import from service-a.
  • Add tests covering blank-import/side-effect impact propagation in both pkg/analyzer and pkg/impact.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/analyzer/analyzer.go Synthesizes reverse-index edges (and Deps) for blank imports to represent side-effect dependencies.
pkg/analyzer/analyzer_test.go Adds integration test asserting side-effect dependency appears in the reverse index.
pkg/impact/impact_test.go Adds unit test asserting blank-import side-effect changes rebuild only the importing service.
testproject/services/service-a/main.go Adds a blank import of the new side-effect package to exercise the behavior.
testproject/core/sideeffect/sideeffect.go Introduces a minimal side-effect package with init() for the fixture.

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

Comment thread pkg/analyzer/analyzer.go
Comment thread pkg/analyzer/analyzer.go

Copilot AI commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

@bubunyo I've opened a new pull request, #10, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

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


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

@bubunyo
bubunyo merged commit 08aff46 into master Mar 20, 2026
9 checks passed
@bubunyo
bubunyo deleted the feat/support-sideeffect-imports branch March 20, 2026 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants