Add release notes functionality to dandiset publishing process#2606
Add release notes functionality to dandiset publishing process#2606bendichter wants to merge 6 commits intomasterfrom
Conversation
mvandenburgh
left a comment
There was a problem hiding this comment.
We may want to rethink how we're passing release_notes around, but I'll get back to you on that. Aside from that, this generally looks good.
Note - we will need dandi/dandi-schema#185 to be released before this PR can be merged.
dandiapi/api/views/serializers.py
Outdated
| def get_release_notes(self, version: Version) -> str | None: | ||
| """Extract release notes from version metadata.""" | ||
| return version.metadata.get('releaseNotes') | ||
|
|
||
| def to_representation(self, instance): | ||
| """Remove release_notes from representation if it's None.""" | ||
| representation = super().to_representation(instance) | ||
| if representation.get('release_notes') is None: | ||
| representation.pop('release_notes', None) | ||
| return representation | ||
|
|
There was a problem hiding this comment.
We should be able to access the releaseNotes directly from the metadata in the frontend, which would remove the need for this extra logic in this serializer. To do that, we'll first need dandi/dandi-schema#185 to be released so we can update https://github.com/dandi/dandi-archive/blob/master/web/src/types/schema.ts.
dandiapi/api/tasks/__init__.py
Outdated
|
|
||
| @shared_task | ||
| def publish_dandiset_task(dandiset_id: int, user_id: int): | ||
| def publish_dandiset_task(dandiset_id: int, user_id: int, release_notes: str | None = None): |
There was a problem hiding this comment.
I'm not sure about the implications of accepting an arbitrary string as a Celery task argument w.r.t. serialization/deserialization from RabbitMQ. Normally, we try to avoid this and store such values in the DB for the Celery task to query for itself, passing only primary keys to the tasks themselves. On the other hand, I don't see a natural way for release_notes to fit into that paradigm, so maybe this is the best solution. I'll look into this
dandiapi/api/views/serializers.py
Outdated
|
|
||
|
|
||
| class PublishVersionSerializer(serializers.Serializer): | ||
| release_notes = serializers.CharField(required=False, allow_blank=True, source='releaseNotes') |
There was a problem hiding this comment.
We should set a max_length here.
|
Thanks for looking a this, @mvandenburgh! |
b2e86d8 to
268c4c9
Compare
|
I rebased this on |
6427e5e to
7757d45
Compare
9472b1e to
fb5e66e
Compare
349810d to
1a5118d
Compare
|
@bendichter I feel like this one was "so close". github CI doesn't show me failing logs ATM (keeps scrolling... dunno) but I wondered if worth bringing it closer to finish line? little comments from trying on and actually issuing a release with (presumably) a changelog entry on https://deploy-preview-2606--sandbox-dandiarchive-org.netlify.app/dandiset/217838/0.260324.0110?page=5&sortOption=0&sortDir=-1&showDrafts=true&showEmpty=false&pos=34 (bug in itself that all navigation options carry into dandisets ... uff):
|
- Updated publish functions to accept optional release notes. - Introduced PublishVersionSerializer for handling release notes in requests. - Enhanced UI to allow users to input release notes during publishing. - Display release notes for published versions in the UI.
This is unnecessary, as we can simply set the field to `null` to simplify the response type interface
This has the benefits of not having to pass `release_notes` around through multiple nested function calls + trusting celery's python string (de)serialization functionality (since we were placing the entire `release_notes` string onto the queue before).
- Remove `test_version_publish_without_release_notes` test. This is just testing the existing publish functionality, which we already have tests for. - Fix `test_version_build_publishable_with_release_notes` so that it passes - Remove `test_version_rest_publish_empty_release_notes` test, as it is no longer applicable. `Version.release_notes` is no longer a nullable field, instead defaulting to empty string (best practice for CharField)
- Rename migration 0030 -> 0031 to resolve conflict with 0030_alter_asset_path - Always update release_notes on draft when publishing (clear old notes if none provided, preventing stale notes from carrying over) - Add releaseNotes to strip_metadata to prevent it leaking into draft metadata - Add max_length=5000 to PublishVersionSerializer (matching model field) - Add counter/maxlength to frontend textarea - Increase release_notes max_length from 512 to 5000 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1a5118d to
cbba7a8
Compare
|
Rebased onto master and fixed several issues:
|

fix #189
Screen.Recording.2025-10-20.at.11.25.55.AM.mov
Following dandi/dandi-schema#185
Requires dandi/dandi-schema#185 to be released