refactor: move pkg/units from orchestrator to shared#3230
Conversation
pkg/units holds byte-size helpers with no orchestrator-specific dependencies. Moving it to shared lets shared packages (e.g. storage) reuse them without importing orchestrator.
PR SummaryLow Risk Overview Reviewed by Cursor Bugbot for commit 4a1ed90. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Code Review
This pull request moves the units package from the orchestrator package (packages/orchestrator/pkg/units) to the shared package (packages/shared/pkg/units) and updates all corresponding import paths across multiple files in the orchestrator service. There are no review comments, and I have no additional feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
❌ 6 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
There was a problem hiding this comment.
LGTM — pure move of pkg/units to shared with import path updates only.
Extended reasoning...
Overview
This PR moves packages/orchestrator/pkg/units to packages/shared/pkg/units and updates import paths in 9 orchestrator files. The units.go file itself is renamed with 100% similarity (2 trivial helpers: MBToBytes and BytesToMB, both bit-shifts by 20). Split out from #3113 to enable shared packages (e.g. pkg/storage) to consume the helpers without importing orchestrator.
Security risks
None. The moved code is a pure utility with no I/O, no external inputs, and no security surface.
Level of scrutiny
Minimal. This is a mechanical file relocation with no behavior change — the only diffs beyond the rename are import statement swaps. I verified no stale references to the old path (orchestrator/pkg/units) remain anywhere in the tree, and the destination directory contains the expected file.
Other factors
No bugs were found by the bug hunting system. The bug hunter had no findings, and the PR description accurately describes the change. Compilation correctness is guaranteed by the Go toolchain — if any import were missed, the build would fail.
Split out from #3113.
pkg/unitsholds generic byte-size helpers with no orchestrator-specific dependencies. Moving it tosharedlets shared packages (notablypkg/storage) reuse them without importing orchestrator. Pure move + import-path updates; no behavior change.