Skip to content
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

Introduce new EventLabel type for webhook events #1595

Merged
merged 1 commit into from
Dec 10, 2022

Conversation

armsnyder
Copy link
Contributor

Description

I implemented option 2 from #1594, which replaces all Label webhook event fields with a new EventLabel type that contains the correct fields.

How it was tested

I updated the unmarshal tests for all event types that contain labels, without touching the testdata. (These tests were not previously inspecting labels.)

Notes

  • This is a breaking change to the package, by changing some field types to EventLabel.
  • In the EventLabel struct, I considered making ProjectID and GroupID of type *int because they are technically nullable. GitLab will populate whichever field matches the label Type. However, since this struct is never marshalled, I decided to keep them as int.

Closes #1594

Copy link
Member

@svanharmelen svanharmelen left a comment

Choose a reason for hiding this comment

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

LGTM 👍🏻

@svanharmelen svanharmelen merged commit f203bb0 into xanzy:master Dec 10, 2022
@armsnyder armsnyder deleted the 1594-labels branch December 12, 2022 08:07
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.

Label names are not unmarshalled from webhook events
2 participants