Skip to content

Add new webhook event: on_version_created#24545

Merged
willdurand merged 1 commit intomasterfrom
on-version-created
Mar 2, 2026
Merged

Add new webhook event: on_version_created#24545
willdurand merged 1 commit intomasterfrom
on-version-created

Conversation

@willdurand
Copy link
Member

@willdurand willdurand commented Feb 27, 2026

Fixes mozilla/addons#15958


Once we have this webhook event, we can hook up the source builder to it. We'll also want this event to be blocking auto approval (see #24533).

@willdurand willdurand marked this pull request as ready for review February 27, 2026 14:39
@willdurand willdurand requested a review from eviljeff February 27, 2026 14:40
},
"url": "http://olympia.test/api/v5/addons/addon/85/versions/42/",
"download_source_url": "http://olympia.test/downloads/source/42"
},
Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, that's breaking scanners listening to this event, but we don't have any anyway. The source builder is the only one that will listen to this event, but it'll also have to listen to on_version_created so I'll update the source builder to account for that change.

Copy link
Member

@eviljeff eviljeff left a comment

Choose a reason for hiding this comment

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

I wasn't sure how to test (so I didn't) but r+

Comment on lines +18 to +19
license = CompactLicenseSerializer(read_only=True)
file = MinimalFileSerializer(read_only=True)
Copy link
Member

Choose a reason for hiding this comment

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

nit: doesn't hurt, but you don't need to specify read_only=True on the field too if the Meta read_only_fields is defined - it's the shortcut to defining it per field.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's what I assumed but then

def test_serializer_read_only_fields(serializer_class):
disagreed :D

Copy link
Member

Choose a reason for hiding this comment

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

Hah, I had a feeling there was some edge case so I read the drf code 🤷‍♂️

@willdurand willdurand merged commit 5b1fee0 into master Mar 2, 2026
45 checks passed
@willdurand willdurand deleted the on-version-created branch March 2, 2026 07:32
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.

[Task]: Call source builder when version has been created

3 participants