Skip to content

Extract targetGraphComparer into separate module#131

Closed
yushan8 wants to merge 1 commit into
mainfrom
extract-compare
Closed

Extract targetGraphComparer into separate module#131
yushan8 wants to merge 1 commit into
mainfrom
extract-compare

Conversation

@yushan8

@yushan8 yushan8 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor
  • Extract targetGraphComparer into controller/comparer.go — moves the graph comparison logic (target diffing, BFS distance computation, ID remapping, seed classification, metadata chunking) out of getchangedtargets.go into a focused, self-contained type
  • GetChangedTargets calls newTargetGraphComparer(...).Compare(...) directly instead of going through a compareTargetGraphs wrapper method on the controller
  • Helper functions that only serve the comparison algorithm (transposeOptimizedTarget, computeDistances, changedDepStatus, hasChangedSourceFileDep, attributesChanged, getTargetsAndMetadata, buildNameIndex, detectSourceFileID, canonicalTargetName, validateTargetNames) move to comparer.go
  • Tests that exercised compareTargetGraphs now use newTestComparer().Compare(...) directly, removing the need for newTestController in those tests

@yushan8 yushan8 requested review from a team as code owners June 30, 2026 20:45
@yushan8 yushan8 marked this pull request as draft June 30, 2026 20:45
@yushan8 yushan8 closed this Jun 30, 2026
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.

1 participant