Improvements to item versioning UI - #2011
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2011 +/- ##
==========================================
+ Coverage 80.24% 80.26% +0.02%
==========================================
Files 83 83
Lines 7637 7647 +10
==========================================
+ Hits 6128 6138 +10
Misses 1509 1509
🚀 New features to boost your workflow:
|
datalab
|
||||||||||||||||||||||||||||
| Project |
datalab
|
| Branch Review |
ml-evs/versioning-tests
|
| Run status |
|
| Run duration | 23m 37s |
| Commit |
|
| Committer | Matthew Evans |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
548
|
| View all changes introduced in this branch ↗︎ | |
23528d7 to
b7e4ea2
Compare
be-smith
left a comment
There was a problem hiding this comment.
I'm still going through the version history modal logic but it works well on my end. Couple of changes suggested based on what behaviour you want?
There was a problem hiding this comment.
Pull request overview
Improves item version auditing, deduplication, restoration, and history presentation.
Changes:
- Versions permission changes and normalizes restored timestamps.
- Reduces spurious snapshots and expands regression coverage.
- Shows version authors, user agents, actions, and field-level diffs.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
webapp/src/server_fetch_utils.js |
Updates version comparison API usage. |
webapp/src/components/VersionHistoryModal.vue |
Adds audit metadata and diff presentation. |
pydatalab/tests/server/test_item_versions.py |
Tests snapshot minting and permission changes. |
pydatalab/src/pydatalab/versioning.py |
Refines snapshot comparison and numbering. |
pydatalab/src/pydatalab/routes/v0_1/items.py |
Versions permissions and fixes restored timestamps. |
pydatalab/src/pydatalab/models/versions.py |
Adds the permissions-update action. |
Suppressed comments (2)
pydatalab/src/pydatalab/routes/v0_1/items.py:1529
- This storage-type correction is not covered by a raw-database assertion. An API response serializes both a BSON datetime and a string as text, so add a restore test that reads the item from MongoDB and verifies
last_modifiedis adatetime.datetime.
restored_data["last_modified"] = datetime.datetime.now(tz=datetime.timezone.utc)
webapp/src/components/VersionHistoryModal.vue:343
- A failed comparison is converted to
changes = [], causing the preview to state that no content changes were recorded after the error dialog closes. Preserve a distinct comparison-error state and render a retry/error message instead of presenting failure as an empty diff.
} catch (error) {
console.error("Failed to load version changes:", error);
this.changes = [];
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
246f22c to
1c178f7
Compare
…g a version rather than a isoformat string
Final tidying Remove potentially slow debug log Update docstring Linting Add request ID to handle potentially conflicting calls to compare versions
1c178f7 to
ae22d0a
Compare
Headline changes:
Closes #2010, closes #1784