Repository navigation
Show Pixi workspace version in UI - #515
Conversation
✅ Deploy Preview for nebi-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
tylerpotts
left a comment
There was a problem hiding this comment.
Thanks for this, the approach is clean and the test coverage is exactly right: parser table test, service-level derivation with a mutation-proof assertion, proxy round-trip, and a component test. Verified locally at 68d5d36: Go and vitest pass, and regenerating swagger produces no diff.
Requesting changes only because the branch conflicts with main in two files. Everything else inline is a suggestion. One decision I need to make as maintainer is called out in the summary comment below.
| } | ||
| } | ||
|
|
||
| func TestExtractWorkspaceVersion(t *testing.T) { |
There was a problem hiding this comment.
Nice table test. Precedence, project fallback, missing field, and malformed TOML are all pinned.
| ContentHash: "sha-test", | ||
| CreatedBy: userID, | ||
| Description: "Initial workspace creation", | ||
| ManifestVersion: "ignored", |
There was a problem hiding this comment.
Seeding ManifestVersion: "ignored" and asserting the derived value wins is a good way to prove this is read-derived and never persisted.
| var versions []models.WorkspaceVersion | ||
| err := s.db. | ||
| Select("id", "workspace_id", "version_number", "job_id", "created_by", "description", "created_at"). | ||
| Select("id", "workspace_id", "version_number", "manifest_content", "job_id", "created_by", "description", "created_at"). |
There was a problem hiding this comment.
Suggestion (non-blocking): this widens the list Select to pull manifest_content for every row and parse it. Fine at current sizes. If it ever shows up in profiles, the precedent is ContentHash: compute once at snapshot time and store a column.
| // Version tracking | ||
| VersionNumber int `gorm:"not null;index:idx_ws_version" json:"version_number"` // Auto-incrementing per workspace | ||
| // ManifestVersion is derived from the stored pixi.toml [workspace]/[project] version. | ||
| ManifestVersion string `gorm:"-" json:"manifest_version,omitempty"` |
There was a problem hiding this comment.
Suggestion: this is the first gorm:"-" field in models. The repo's pattern for computed fields is a wrapper type like WorkspaceResponse in internal/service/types.go. Not blocking, the approach works and avoids a migration, just noting the convention.
|
Fixes #508 as described: both local and remote views now show the pixi.toml version, with the internal counter kept visible as the snapshot number. Two things not tied to a line:
Once the rebase is in, I'll re-review quickly. |
|
Updating the docs now! |
Resolve conflicts with nebari-dev#565, which made src/lib/utils.ts registry-owned (cn() only) and split the app helpers into src/lib/status.ts and src/lib/strings.ts. getWorkspaceVersionLabel moves out of utils.ts into a new src/lib/versions.ts with its tests; VersionHistory and RemoteWorkspaceDetail import it from there, and RemoteWorkspaceDetail picks up main's relocated user-badge, status and strings imports.
|
@MUFFANUJ I took the liberty of resolving the conflicts on main and pushed to this branch |
tylerpotts
left a comment
There was a problem hiding this comment.
Re-reviewed at 94f3924. The conflicts are resolved (I pushed that merge), and every in-PR suggestion from the last round is applied in 5dbc301: the two rollback description strings, the slog.Warn on parse failure, the struct reuse in internal/pixi, the shared getWorkspaceVersionLabel helper (now in frontend/src/lib/versions.ts since main made utils.ts registry-owned), and the Description note in the PR body. Thanks for turning those around quickly.
Verified locally at 94f3924: Go tests pass, vitest 267/267, biome clean, swagger regeneration produces no diff, and the new versions.test.ts goes red if the "Snapshot N" fallback is changed.
One thing left, and it is the only reason this is still Changes Requested:
Blocker: the recaptured screenshots in 5cd238e show the wrong cards. docs/src/content/docs/examples/version-rollback.md walks the reader through expanding the v2.0 card and clicking Rollback, then shows the new rollback-created version marked Current. The previous images matched that (the "Pushed as ml-pipeline:v2.0" card, then "Version 6 / Rolled back to version 3 / Current"). The new ones do not:
docs/public/img/rollback.pngnow shows the v3.0 card (Snapshot 4, "Pushed as ml-pipeline:v3.0"), which is the broken release the tutorial is rolling back from.docs/public/img/active_version.pngnow shows the plain v4.0 push (Snapshot 5) as Current, not a rollback result.
Could you recapture both with the new UI? rollback.png should be the v2.0 card (Snapshot 3) expanded with the Rollback button visible, and active_version.png should be the card the rollback creates, which will read "Rolled back to snapshot 3" with the Current badge.
Suggestion (one line): cmd/nebi/workspace_version.go:82 help text still says the command creates a "Rolled back to version N" snapshot. This PR changed the actual description to "snapshot", so that sentence is now wrong. Since it is one word and this PR made it stale, I would fix it here. The rest of the CLI vocabulary (table headers, the rollback success message) is tracked in #569 as promised.
Once the screenshots are in I will approve.
tylerpotts
left a comment
There was a problem hiding this comment.
LGTM! Good work on this!


Reference Issues or PRs
Fixes #508
What does this implement/fix?
Put a
xin the boxes that applyTesting
Documentation
Access-centered content checklist
Text styling
H1or#in markdown).Non-text content
Any other comments?
Update the versions UI to show the workspace version from
pixi.tomlas the primary label, while keeping Nebi’s internal counter visible as the snapshot number. The backend now derivesmanifest_versionfrom storedpixi.tomlcontent and the remote proxy preserves it, so local and remote version views use the same clearer wording.Also fixes a pre-existing remote proxy issue where workspace version descriptions were dropped from the remote version history response.
Before
Screen.Recording.2026-08-18.at.3.23.31.PM.mov
After
Screen.Recording.2026-08-18.at.3.40.04.PM.mov