Skip to content

Improvements to item versioning UI - #2011

Merged
ml-evs merged 5 commits into
mainfrom
ml-evs/versioning-tests
Aug 16, 2026
Merged

Improvements to item versioning UI#2011
ml-evs merged 5 commits into
mainfrom
ml-evs/versioning-tests

Conversation

@ml-evs

@ml-evs ml-evs commented Aug 13, 2026

Copy link
Copy Markdown
Member

Headline changes:

  • permissions updates now mint a new version with a special action
  • timestamps are properly written as timestamps when restoring
  • more computed fields are ignored to exclude extraneous version updates
  • new tests for this
  • updates version history UI to show who made the change, the user agent, and the diff

Closes #2010, closes #1784

@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 80.26%. Comparing base (f885624) to head (ae22d0a).

Files with missing lines Patch % Lines
pydatalab/src/pydatalab/routes/v0_1/items.py 83.33% 1 Missing ⚠️
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              
Files with missing lines Coverage Δ
pydatalab/src/pydatalab/models/versions.py 96.66% <100.00%> (+0.05%) ⬆️
pydatalab/src/pydatalab/versioning.py 91.25% <100.00%> (+0.46%) ⬆️
pydatalab/src/pydatalab/routes/v0_1/items.py 84.77% <83.33%> (+0.11%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cypress

cypress Bot commented Aug 13, 2026

Copy link
Copy Markdown

datalab    Run #5341

Run Properties:  status check passed Passed #5341  •  git commit d8a9a15330 ℹ️: Merge 1c178f7ff5135485063a2267c73f666bc5ac2d34 into f8856245f1b75666e50beb52fc82...
Project datalab
Branch Review ml-evs/versioning-tests
Run status status check passed Passed #5341
Run duration 23m 37s
Commit git commit d8a9a15330 ℹ️: Merge 1c178f7ff5135485063a2267c73f666bc5ac2d34 into f8856245f1b75666e50beb52fc82...
Committer Matthew Evans
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 548
View all changes introduced in this branch ↗︎

@ml-evs
ml-evs requested a review from be-smith August 13, 2026 12:00
@ml-evs
ml-evs marked this pull request as ready for review August 13, 2026 14:44
@ml-evs
ml-evs force-pushed the ml-evs/versioning-tests branch from 23528d7 to b7e4ea2 Compare August 13, 2026 22:52

@be-smith be-smith left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Comment thread pydatalab/src/pydatalab/routes/v0_1/items.py
Comment thread webapp/src/components/VersionHistoryModal.vue

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_modified is a datetime.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.

Comment thread pydatalab/src/pydatalab/routes/v0_1/items.py
Comment thread pydatalab/src/pydatalab/versioning.py Outdated
Comment thread webapp/src/components/VersionHistoryModal.vue
Comment thread pydatalab/src/pydatalab/models/versions.py
@ml-evs
ml-evs force-pushed the ml-evs/versioning-tests branch 2 times, most recently from 246f22c to 1c178f7 Compare August 16, 2026 16:02
@ml-evs
ml-evs force-pushed the ml-evs/versioning-tests branch from 1c178f7 to ae22d0a Compare August 16, 2026 21:10
@ml-evs
ml-evs merged commit ee964b7 into main Aug 16, 2026
19 checks passed
@ml-evs
ml-evs deleted the ml-evs/versioning-tests branch August 16, 2026 21:31
@ml-evs ml-evs added API For issues/PRs pertaining to the API webapp For issues/PRs pertaining to the web interface usability labels Aug 16, 2026
@ml-evs ml-evs changed the title Improvements to item versioning Improvements to item versioning UI Aug 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API For issues/PRs pertaining to the API usability webapp For issues/PRs pertaining to the web interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spurious item versions generated Show creator of "diff" in top-level versioning UI

3 participants