refactor(entity): promote Change + ChangeID to shared entity/change#240
Merged
Conversation
## Summary ### Why? `Change` (a code change identified by provider URIs) and the GitHub/Phabricator `ChangeID` parsers are pure identity-and-parsing types with no domain semantics and no persisted-as-shared schema. They are the one cluster genuinely common to every code-change pipeline — SubmitQueue today, and Stovepipe / Runway / Tango alignment going forward — so they belong in the shared top-level `entity/` tree rather than inside `submitqueue/entity/`. This is deliberately the *only* promotion: facts a domain persists (the change-provider model embedded in `ChangeRecord`), state machines, and pipeline types stay domain-local, since sharing them would couple every domain's storage schema and bend their state machines toward SubmitQueue's. ### What? Moves the canonical `Change` struct out of `submitqueue/entity/request.go` into a new `entity/change` package, and relocates the parser packages to `entity/change/github` and `entity/change/phabricator` (preserving git history). No alias shim: every consumer now references `change.Change` and imports the new path directly. JSON tags are unchanged, so queue payloads (`Request`, `LandRequest`, `PushResult`) remain byte-identical across a deploy. `submitqueue/entity` keeps its full pipeline and facts; `Request`, `LandRequest`, and `ChangeOutcome` now embed `change.Change`. ## Test Plan - ✅ `make build` - ✅ `make test` (51/51 pass) - ✅ `make fmt` / `make gazelle` (converged, no further changes) - ✅ `make check-tidy` (go.mod / MODULE.bazel unchanged — internal move, no new deps)
mnoah1
approved these changes
Jun 12, 2026
sbalabanov
approved these changes
Jun 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why?
Change(a code change identified by provider URIs) and the GitHub/PhabricatorChangeIDparsers are pure identity-and-parsing types with no domain semantics and no persisted-as-shared schema. They are the one cluster genuinely common to every code-change pipeline — SubmitQueue today, and Stovepipe / Runway / Tango alignment going forward — so they belong in the shared top-levelentity/tree rather than insidesubmitqueue/entity/.This is deliberately the only promotion: facts a domain persists (the change-provider model embedded in
ChangeRecord), state machines, and pipeline types stay domain-local, since sharing them would couple every domain's storage schema and bend their state machines toward SubmitQueue's.What?
Moves the canonical
Changestruct out ofsubmitqueue/entity/request.gointo a newentity/changepackage, and relocates the parser packages toentity/change/githubandentity/change/phabricator(preserving git history). No alias shim: every consumer now referenceschange.Changeand imports the new path directly. JSON tags are unchanged, so queue payloads (Request,LandRequest,PushResult) remain byte-identical across a deploy.submitqueue/entitykeeps its full pipeline and facts;Request,LandRequest, andChangeOutcomenow embedchange.Change.Test Plan
make buildmake test(51/51 pass)make fmt/make gazelle(converged, no further changes)make check-tidy(go.mod / MODULE.bazel unchanged — internal move, no new deps)