Skip to content

Fix a case where draft asset summaries could become stale #2231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 8, 2025

Conversation

danlamanna
Copy link
Contributor

There's an edge case where assets can be uploaded and the dandiset can transition into publishing before an appropriate asset summary for the draft version is computed. When generating the asset summary for the published version it can be copied to the draft to ensure the draft asset summary is always eventually correct.

@mvandenburgh mvandenburgh requested a review from Copilot March 26, 2025 19:20
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses an edge case where a draft asset summary might become stale by ensuring that when a dandiset is published, the associated asset summary from the published version is copied to the draft version. Key changes include:

  • Adding a test to verify that publishing a version updates the draft's asset summary.
  • Updating the publish service to copy the asset summary from the published version to the draft version.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
dandiapi/api/tests/test_version.py Adds tests to check asset summary consistency after publishing
dandiapi/api/services/publish/init.py Updates the publish routine to sync asset summaries between versions

@danlamanna danlamanna force-pushed the fix-draft-version-stale-summary branch from 4837ecc to 32ccbf4 Compare March 27, 2025 14:37
There's an edge case where assets can be uploaded and the dandiset can
transition into publishing before an appropriate asset summary is
computed. When generating the asset summary for the published version it
can be copied to the draft to ensure the draft asset summary is always
eventually correct.
@danlamanna danlamanna force-pushed the fix-draft-version-stale-summary branch from 32ccbf4 to 2989fb3 Compare March 27, 2025 14:38
@danlamanna danlamanna requested a review from mvandenburgh March 27, 2025 14:52
Copy link
Member

@mvandenburgh mvandenburgh left a comment

Choose a reason for hiding this comment

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

Sorry, thought I approved this

@danlamanna danlamanna merged commit bb31790 into master Apr 8, 2025
9 checks passed
@danlamanna danlamanna deleted the fix-draft-version-stale-summary branch April 8, 2025 16:54
@mvandenburgh mvandenburgh added the patch Increment the patch version when merged label Apr 16, 2025
@dandibot
Copy link
Member

🚀 PR was released in v0.5.0 🚀

@dandibot dandibot added the released This issue/pull request has been released. label Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Increment the patch version when merged released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants