Skip to content

Remove uv and the package-manager abstraction; pixi is the only package manager - #522

Merged
tylerpotts merged 4 commits into
mainfrom
remove-uv-provider
Aug 26, 2026
Merged

tylerpotts merged 4 commits into
mainfrom
remove-uv-provider

Conversation

@tylerpotts

Copy link
Copy Markdown
Collaborator

Summary

uv was only ever stubbed out as a provider and never implemented. This removes it and the multi-package-manager abstraction that existed to support it. Pixi is the only package manager Nebi uses, and the extra indirection wasn't paying for itself.

Abstraction removal

  • Delete internal/pkgmgr (the PackageManager interface, factory, and registry). The pixi implementation moves up to internal/pixi and owns its option/result types directly.
  • The executor and services call *pixi.PixiManager concretely. internal/executor no longer type-asserts to find the binary path.
  • The old factory registry doubled as the test-injection seam. It's replaced by one narrow hook, service.SetPixiListPackagesForTests, which stubs pixi list — the only pixi dependency tests actually needed to fake (everything else goes through the injected Executor).

uv removal

  • package_manager.default_type and package_manager.uv_path config keys and their env bindings are gone. package_manager.pixi_path / NEBI_PACKAGE_MANAGER_PIXI_PATH still work unchanged.
  • docker/uv.Dockerfile and the build-docker-uv Makefile target are deleted; test-pkgmgr is now test-pixi.
  • UV_CACHE_DIR in internal/process/env.go intentionally stays — that's pixi's own uv cache for pypi-dependencies, not the provider.

package_manager field removal (end to end)

The workspace field could only ever hold "pixi", so it's dropped from the server model, the CLI local store, API requests/responses, the CLI client and nebi info, the Wails app, swagger (regenerated), and the frontend (types, create calls, and the Package Manager rows on both detail pages).

Migration note: the column was NOT NULL with no default, and GORM AutoMigrate never drops columns, so leaving it would break all workspace inserts on existing databases. Both db.Migrate (server) and store.Open (CLI local SQLite) now drop the column if present. Regression tests build the legacy schema and verify the drop plus a post-migration insert. Data loss is nil in practice — the column only ever held "pixi".

Compatibility: old CLIs that send package_manager on workspace create are silently ignored; an old CLI running nebi info against a new server shows no package-manager line.

Test plan

  • go build / go vet clean, including -tags=e2e
  • Full Go test suite passes (./internal/... ./cmd/...)
  • New regression tests for the legacy-column migrations in internal/db and internal/store
  • Frontend: tsc -b clean, all 233 vitest tests pass, biome CI check clean
  • Swagger regenerated via make swagger (zero package_manager references remain)

…ge manager

uv was only ever stubbed out as a provider and never implemented. Remove it
and the abstraction that existed to support multiple package managers:

- Delete the pkgmgr interface/factory/registry; move internal/pkgmgr/pixi to
  internal/pixi and give it the option/result types directly.
- Executor and services call pixi directly. A small test-replaceable
  pixiListPackages hook in the service package replaces the registry as the
  test seam for stubbing pixi list.
- Drop the package_manager field from the server workspace model, the CLI
  local store, API requests/responses, the CLI client, the Wails app, and
  the frontend. Both migrations drop the legacy NOT NULL column (it would
  otherwise break inserts on existing databases); regression tests cover
  the legacy-column path.
- Remove package_manager.default_type and uv_path config keys plus their env
  bindings (NEBI_PACKAGE_MANAGER_PIXI_PATH still works), docker/uv.Dockerfile,
  and the build-docker-uv Makefile target (test-pkgmgr is now test-pixi).
- Regenerate swagger docs; update AGENTS.md and CONTRIBUTING.md.
@netlify

netlify Bot commented Aug 24, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for nebi-docs canceled.

Name Link
🔨 Latest commit 58ad337
🔍 Latest deploy log https://app.netlify.com/projects/nebi-docs/deploys/6a8eaea4eb18c40008d55efc

Comment thread internal/config/config.go Resolved
Comment thread internal/executor/local.go Resolved
Comment thread internal/pixi/types.go Resolved
- Replace single-field PackageManagerConfig with top-level Config.PixiPath
  (pixi_path / NEBI_PIXI_PATH); NEBI_PACKAGE_MANAGER_PIXI_PATH kept as a
  legacy env alias
- OutputLimitError.Error() no longer substitutes hardcoded defaults for
  Command/Stream; every constructor sets both
@tylerpotts
tylerpotts requested a review from pmeier August 25, 2026 21:21
@tylerpotts
tylerpotts merged commit 46bf3ab into main Aug 26, 2026
17 checks passed
@tylerpotts
tylerpotts deleted the remove-uv-provider branch August 26, 2026 21:26
pmeier pushed a commit that referenced this pull request Aug 31, 2026
…ated databases (#550)

* Fix SQLite startup crash dropping workspaces.package_manager on populated databases

The glebarez/sqlite driver emulates DropColumn by rebuilding the table
(create workspaces__temp, copy rows, drop workspaces, rename), and
unlike DropTable/AlterColumn it does not suspend foreign_keys first, so
DROP TABLE on the old workspaces violates the foreign keys held by
jobs/publications rows and aborts startup on any pre-#522 database with
real usage history.

Run the drop pinned to a single connection with foreign_keys suspended
(the DSN pragma re-enables it on every new pooled connection, and
SQLite ignores the pragma inside a transaction), and drop any
workspaces__temp table stranded by a previously failed rebuild before
AutoMigrate runs.

Fixes #549

Co-Authored-By: Claude Fable 5 <[email protected]>

* Remove the stranded workspaces__temp cleanup; the premise was wrong

The driver's DropColumn rebuild (create temp, copy, drop, rename) runs
inside a single transaction, so the pre-fix FK failure rolls the temp
table back — a committed database can never contain a stranded
workspaces__temp from that path. Verified empirically: reproducing the
crash leaves no temp table, and a real pre-upgrade database that lived
through the crash has none either. Drop the startup cleanup and the
test's manufactured temp table, which guarded a state that cannot arise.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VGNXRuSFe8PvDQYyX1BVDS

---------

Co-authored-by: Claude Fable 5 <[email protected]>
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.

2 participants