feat(orbit): add 'glab orbit local' command + extract binarymgr package
Summary
Adds a new glab orbit local command that downloads, installs, updates, and runs the Orbit local CLI binary — same UX as glab duo cli (--install, --update, --yes, plus pass-through args).
To support both binaries without duplication, the managed-binary lifecycle that previously lived under internal/commands/duo/cli/cliutils is extracted into a reusable internal/binarymgr package driven by a Spec. Duo migrates onto it; orbit local plugs in with a tarball extractor for its .tar.gz distribution.
This MR is bootstrap-only — no query/status/etc. subcommands under orbit local. All other args are passed through to the binary.
Commits
refactor(binarymgr)— extract managed-binary lifecycle into sharedinternal/binarymgrpackage; migrateduo/clito use it; deleteduo/cli/cliutils. Behavior-preserving for duo.feat(orbit)— addglab orbit localcommand, executors, config keys (orbit_local_*), env-var mapping (GLAB_ORBIT_LOCAL_BINARY_PATH), regenerated config stub and docs.fix(scripts)— makechanged-test-pkgs.shskip dirs that no longer exist on disk somake test-changedworks after a package deletion (surfaced by deletingcliutils).
Distribution facts
- Project:
gitlab-org/orbit/knowledge-graph(ID77960826) - Generic package:
orbit-local, version omits leadingv(e.g.0.53.0) - Asset:
orbit-local-<os>-<arch>.tar.gzcontaining top-levelorbitbinary - Platforms:
darwin/linux×x86_64/aarch64. No Windows (not published upstream). - Pre-1.0, so
MaxCompatibleMajoris intentionally unset (uncapped). Add a cap when 1.0 ships.
Notable design choices
internal/binarymgr/:Specdescribes the binary;Managerowns registry/download/install;Runnerowns prompt + exec orchestration.TarGzExtractorplugs in for tarball-distributed binaries with zip-slip and absolute-path guards.Executoris a closure: each command package builds afunc(ctx, path, args)that closes over itsIOStreamsand adds its own distribution env var (GITLAB_DUO_DISTRIBUTION/GITLAB_ORBIT_DISTRIBUTION). Unix usessyscall.Exec; Windows uses subprocess.- Shared install dir: both binaries land in
<config-dir>/bin/(duo,orbit) — same package-manager-style layout, no PATH pollution.
Test plan
-
make build -
make test(3181 tests, 0 failed, 7 skipped) -
make lint(0 issues) -
make gen-docs -
go vet ./... - Ported all original duo
cliutilstests ontobinarymgr, plus new tests forTarGzExtractor(extraction, missing binary, zip-slip, absolute-path, symlink skip) - Integration test for
detectPlatformagainst the running host - Manual smoke test on macOS:
glab orbit local --install,glab orbit local --update, plainglab orbit local - Manual smoke test that
glab duo cli --install/--updatestill work unchanged
Configuration / env vars added
| Config key | Env var |
|---|---|
orbit_local_auto_run |
— |
orbit_local_auto_download |
— |
orbit_local_binary_path |
GLAB_ORBIT_LOCAL_BINARY_PATH |
orbit_local_binary_version |
— |
orbit_local_binary_checksum |
— |
orbit_local_last_update_check |
— |
Out of scope
glab orbit local query/status/ etc. — those will come in follow-up MRs.- Windows support — the binary isn't published for Windows yet.
- Sharing config-loading code between duo and orbit beyond the existing
config.Configinterface.
Edited by Jay McCure