Skip to content

feat: Support Changes and Enterprise fields on ReleaseEvent - #4558

Merged
gmlewis merged 3 commits into
google:masterfrom
rksharma-owg:feat-release-event-changes
Sep 17, 2026
Merged

gmlewis merged 3 commits into
google:masterfrom
rksharma-owg:feat-release-event-changes

Conversation

@rksharma-owg

Copy link
Copy Markdown
Contributor

The release webhook event is delivered when a release is published, unpublished, created, edited, deleted, prereleased, or released.

This PR adds:

  1. Changes *ReleaseChanges to ReleaseEvent (json:"changes,omitempty"):
    GitHub delivers a changes object when the edited action is triggered, containing previous values for body, name, tag_name, and the new value for make_latest.
  2. Enterprise *Enterprise to ReleaseEvent (json:"enterprise,omitempty"):
    Present when the webhook is triggered on a repository belonging to an enterprise.
  3. Updated godoc comments for ReleaseEvent to include the "released" action.
  4. Structs ReleaseChanges, ReleaseChangeFrom, and ReleaseChangeToBool.
  5. Generated accessors and tests via ./script/generate.sh.
  6. Unit test coverage in github/messages_test.go (TestParseWebHook_ReleaseEvent_Edited).

References:

@codecov

codecov Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.57%. Comparing base (64fb7f6) to head (75b7d21).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4558   +/-   ##
=======================================
  Coverage   98.57%   98.57%           
=======================================
  Files         197      197           
  Lines       18291    18291           
=======================================
  Hits        18030    18030           
  Misses        261      261           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gmlewis gmlewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you, @rksharma-owg!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.

cc: @stevehipwell - @Not-Dhananjay-Mishra

@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label Sep 16, 2026
@rksharma-owg

Copy link
Copy Markdown
Contributor Author

Thank you for the review and approval, @gmlewis!

Comment thread github/event_types.go Outdated

// ReleaseChangeFrom represents a release string field change containing the previous value.
type ReleaseChangeFrom struct {
From *string `json:"from,omitempty"`

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.

Suggested change
From *string `json:"from,omitempty"`
From string `json:"from"`

We don't use omitempty with required fields
Image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated ReleaseChangeFrom.From to non-pointer string with json:"from" and regenerated accessors/tests in 8efa573. Thanks for pointing this out!

Comment thread github/event_types.go Outdated

// ReleaseChangeToBool represents a boolean release field change containing the new value.
type ReleaseChangeToBool struct {
To *bool `json:"to,omitempty"`

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.

Suggested change
To *bool `json:"to,omitempty"`
To bool `json:"to"`

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated to bool with json:"to" and regenerated accessors/tests in 75b7d21. Thanks!

Comment thread github/messages_test.go Outdated

event, ok := got.(*ReleaseEvent)
if !ok {
t.Fatalf("ParseWebHook returned %T, want *ReleaseEvent", got)

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.

Suggested change
t.Fatalf("ParseWebHook returned %T, want *ReleaseEvent", got)
t.Fatalf("ParseWebHook returned %v, want *ReleaseEvent", got)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated format specifier to %v in 75b7d21. Thanks!

@Not-Dhananjay-Mishra Not-Dhananjay-Mishra 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.

LGTM

@gmlewis gmlewis removed the NeedsReview PR is awaiting a review before merging. label Sep 17, 2026
@gmlewis

gmlewis commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

Thank you, @Not-Dhananjay-Mishra!
Merging.

@gmlewis
gmlewis merged commit 72a2f27 into google:master Sep 17, 2026
13 checks passed
@rksharma-owg
rksharma-owg deleted the feat-release-event-changes branch September 17, 2026 12:00
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.

3 participants