refactor: replace multi-server model with single-server model #87
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.
Closes #83
Summary
-sflags,Originsmap) with a single-server model where each CLI instance connects to one server at a time (like npm/docker)internal/localstore(JSON files) withinternal/store(GORM + SQLite), using the same ORM as the server for a shared model layermap[string]*Originto flat fields on the Workspace model (OriginName,OriginTag,OriginAction,OriginTomlHash,OriginLockHash)models.Workspaceinto separate server and CLI types:models.Workspace(server DB) andstore.LocalWorkspace(CLI local DB), so each type only contains fields relevant to its databaseCLI changes
-s/--serverflags from all commands (push,pull,diff,publish,registry list,workspace list/tags/remove)--remoteboolean flag forworkspace listandworkspace remove(replaces-s <server>)nebi loginto accept a URL directly (nebi login https://nebi.company.com)nebi servercommand (add/list/removenamed servers)Internal changes
internal/store/package: GORM-based SQLite store withstore_configandstore_credentialssingleton tablesstore.LocalWorkspacetype for CLI-side workspace tracking (Path, Source, IsGlobal, Origin* fields)models.Workspacestripped of CLI-only fields (Path, Source, IsGlobal, Origin*), keeping only server fields (OwnerID, Owner, Status, SizeBytes, etc.)internal/modelsinternal/localstore/(7 files)cmd/nebi/server.goDocs cleanup
docs/(CLI specs, design proposals, issue analysis)docs/CLI_WORKFLOWS.md, swagger files, anddocs.goTest plan
go vet ./...passesgo test ./internal/store/... ./cmd/nebi/...passes (unit + ref tests)go test -tags e2e ./cmd/nebi/...passes (all E2E tests updated for single-server)go test ./...passes (full test suite)cd frontend && npx tsc --noEmitpassesmodels.Workspacenot used in store/CLI,store.LocalWorkspacenot used in server code