Skip to content

refactor: isolate detail refresh planning#225

Draft
mariusvniekerk wants to merge 2 commits intomainfrom
architecture-sync-phases
Draft

refactor: isolate detail refresh planning#225
mariusvniekerk wants to merge 2 commits intomainfrom
architecture-sync-phases

Conversation

@mariusvniekerk
Copy link
Copy Markdown
Collaborator

@mariusvniekerk mariusvniekerk commented May 1, 2026

  • Move detail-drain queue construction into a focused planner module.
  • Keep host defaulting, tracked-repo filtering, watched-item keys, and queue item assembly in one place.
  • This makes Syncer simpler: it snapshots mutable state and orchestrates the phase instead of rebuilding planner rules inline.
  • The new module improves calling uniformity because callers pass typed snapshots and receive QueueItem values, while tests can verify planning without GitHub client mocks or a full sync loop.

Validation:

  • go test ./internal/github -run TestDetailRefreshPlannerBuildsItemsForTrackedRepos -shuffle=on
  • go test ./internal/github -run 'TestDetailRefreshPlanner' -shuffle=on
  • go test ./internal/github -shuffle=on
  • git diff --check
  • go test ./internal/server -run TestWorkspaceListTmuxActivityStressDoesNotLeakProcesses -shuffle=on passes in isolation

Note: go test ./... -shuffle=on and go test ./internal/server -shuffle=on currently fail in unrelated workspace/tmux runtime tests under host process/runtime churn; the sync-module package verification passes.

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-ci
Copy link
Copy Markdown

roborev-ci Bot commented May 1, 2026

roborev: Combined Review (c7531a6)

No Medium, High, or Critical issues found.

All review agents reported the change as clean.


Synthesized from 3 reviews (agents: codex, gemini | types: default, security)

@mariusvniekerk
Copy link
Copy Markdown
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-ci
Copy link
Copy Markdown

roborev-ci Bot commented May 1, 2026

roborev: Combined Review (aa233af)

No Medium, High, or Critical findings were reported.

All reviewers found the changes acceptable; the only reported issue was Low severity and has been omitted per the review rules.


Synthesized from 3 reviews (agents: codex, gemini | types: default, security)

@mariusvniekerk mariusvniekerk marked this pull request as draft May 1, 2026 23:51
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