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

Copy link
Copy Markdown
Owner

support sideeffect imports in build graph

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

CopilotAI 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
FileDescription
testproject/services/service-a/main.goAdds a blank import of the new side-effect package to exercise the behavior.
testproject/core/sideeffect/sideeffect.goNew side-effect package with init() to simulate registration.
pkg/impact/impact_test.goAdds an impact test covering propagation from side-effect-only dependencies.
pkg/analyzer/analyzer_test.goAdds an integration-style test asserting the reverse index includes blank-import edges.
pkg/analyzer/analyzer.goImplements synthesis of blank-import dependency edges during graph construction.

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

Comment threadpkg/analyzer/analyzer.go
Comment threadpkg/analyzer/analyzer.go Outdated
Comment threadpkg/impact/impact_test.go Outdated
Comment threadpkg/analyzer/analyzer_test.go Outdated

CopilotAI 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
FileDescription
testproject/services/service-a/main.goIntroduces a blank import of core/sideeffect to create a side-effect-only dependency.
testproject/core/sideeffect/sideeffect.goAdds a minimal side-effect package used by integration tests.
pkg/impact/impact_test.goAdds a unit test for impact propagation when a side-effect dependency changes.
pkg/analyzer/analyzer_test.goAdds an integration test asserting blank-import edges appear in the reverse index.
pkg/analyzer/analyzer.goImplements synthesiseBlankImportEdges() and supporting namedImports() helper.

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

Comment threadtestproject/core/sideeffect/sideeffect.go Outdated
Comment threadpkg/impact/impact_test.go Outdated
Comment threadpkg/analyzer/analyzer_test.go Outdated

CopilotAI 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
FileDescription
testproject/services/service-a/main.goAdds a blank import of the new side-effect package to exercise the behavior.
testproject/core/sideeffect/sideeffect.goIntroduces a minimal side-effect package via init() to simulate registration.
pkg/impact/impact_test.goAdds an impact propagation test for a side-effect-only dependency edge.
pkg/analyzer/analyzer_test.goAdds a BuildGraph test ensuring blank-import side-effect edges appear in the reverse index.
pkg/analyzer/analyzer.goImplements 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 threadpkg/analyzer/analyzer.go Outdated
Comment threadpkg/analyzer/analyzer.go Outdated
Comment threadpkg/analyzer/analyzer_test.go Outdated

CopilotAI 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
FileDescription
pkg/analyzer/analyzer.goSynthesizes reverse-index edges (and Deps) for blank imports to represent side-effect dependencies.
pkg/analyzer/analyzer_test.goAdds integration test asserting side-effect dependency appears in the reverse index.
pkg/impact/impact_test.goAdds unit test asserting blank-import side-effect changes rebuild only the importing service.
testproject/services/service-a/main.goAdds a blank import of the new side-effect package to exercise the behavior.
testproject/core/sideeffect/sideeffect.goIntroduces 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 threadpkg/analyzer/analyzer.go
Comment threadpkg/analyzer/analyzer.go

CopilotAI 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.

CopilotAI 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 masterMar 20, 2026
9 checks passed
@bubunyo
bubunyo deleted the feat/support-sideeffect-imports branch March 20, 2026 05:35
Sign up for freeto 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

@bubunyo