Skip to content

Conversation

@bendichter
Copy link
Member

@bendichter bendichter commented Oct 20, 2025

fix #189

  • 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.
Screen.Recording.2025-10-20.at.11.25.55.AM.mov

Following dandi/dandi-schema#185

Requires dandi/dandi-schema#185 to be released

@bendichter bendichter requested a review from jjnesbitt October 20, 2025 18:29
@mvandenburgh mvandenburgh self-requested a review October 22, 2025 19:37
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.

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.

Comment on lines +177 to +187
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

Copy link
Member

Choose a reason for hiding this comment

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

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.


@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):
Copy link
Member

Choose a reason for hiding this comment

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

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



class PublishVersionSerializer(serializers.Serializer):
release_notes = serializers.CharField(required=False, allow_blank=True, source='releaseNotes')
Copy link
Member

Choose a reason for hiding this comment

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

We should set a max_length here.

@bendichter
Copy link
Member Author

Thanks for looking a this, @mvandenburgh!

@mvandenburgh mvandenburgh force-pushed the enh/add-release-notes branch 3 times, most recently from b2e86d8 to 268c4c9 Compare October 29, 2025 17:00
@mvandenburgh
Copy link
Member

I rebased this on master to resolve merge conflicts - I'll open another PR on top of this one with my suggested changes.

- 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add release notes to published Dandiset

3 participants