refactor: isolate detail refresh planning#225
Draft
mariusvniekerk wants to merge 2 commits intomainfrom
Draft
Conversation
Move detail-drain queue input construction into a small phase module so Syncer only snapshots mutable state and handles orchestration. This keeps host defaulting, repo/watch keys, and planner outputs local to the phase, which makes callers more uniform and lets tests cover planning without GitHub client mocks or the full sync loop. Verified with: - go test ./internal/github -run 'TestDetailRefreshPlanner' -shuffle=on - go test ./internal/github -shuffle=on - git diff --check Note: go test ./... -shuffle=on currently fails in internal/server TestWorkspaceDeleteDirtyKeepsRuntimeSessionsE2E with an empty runtime session list; a direct rerun of that server test reproduces the failure outside the sync-module files.
roborev: Combined Review (
|
Collaborator
Author
|
This feels like it should use https://pkg.go.dev/slices#Clone |
The pending comment queue drain was using the append-to-nil slice clone idiom. Using slices.Clone makes the defensive copy explicit and follows the PR review suggestion without changing queue behavior. Validation: go test ./internal/github -run 'TestDetailRefreshPlanner|TestSyncer' -shuffle=on; git diff --check. Co-authored-by: OpenAI Codex <noreply@openai.com>
roborev: Combined Review (
|
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.
Syncersimpler: it snapshots mutable state and orchestrates the phase instead of rebuilding planner rules inline.QueueItemvalues, while tests can verify planning without GitHub client mocks or a full sync loop.Validation:
go test ./internal/github -run TestDetailRefreshPlannerBuildsItemsForTrackedRepos -shuffle=ongo test ./internal/github -run 'TestDetailRefreshPlanner' -shuffle=ongo test ./internal/github -shuffle=ongit diff --checkgo test ./internal/server -run TestWorkspaceListTmuxActivityStressDoesNotLeakProcesses -shuffle=onpasses in isolationNote:
go test ./... -shuffle=onandgo test ./internal/server -shuffle=oncurrently fail in unrelated workspace/tmux runtime tests under host process/runtime churn; the sync-module package verification passes.