-
Notifications
You must be signed in to change notification settings - Fork 17
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
Extend ParseIncomingWebhook function to handle tag related events #80
Conversation
@@ -228,14 +266,27 @@ type bitbucketPush struct { | |||
} | |||
|
|||
type bitbucketChange struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the "New" and the "Old" can be exported to a new struct to remove duplications.
I suggest doing the following:
- Create a new struct "bitbucketResourceChange" (or something equivalent) with Name, Target, Type, and Message
- Old and New will be of type bitbucketResourceChange
@@ -262,6 +265,79 @@ func TestBitbucketServerParseIncomingPrWebhook(t *testing.T) { | |||
}) | |||
} | |||
} | |||
func TestBitbucketServer_parseIncomingWebhookTagEvents(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func TestBitbucketServer_parseIncomingWebhookTagEvents(t *testing.T) { | |
func TestBitbucketServerParseIncomingWebhookTagEvents(t *testing.T) { |
@@ -328,6 +330,78 @@ func TestGithubParseIncomingPrWebhook(t *testing.T) { | |||
} | |||
} | |||
|
|||
func TestGitHub_parseIncomingWebhookTagEvents(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func TestGitHub_parseIncomingWebhookTagEvents(t *testing.T) { | |
func TestGitHubParseIncomingWebhookTagEvents(t *testing.T) { |
The general WebhookInfo is extended and now encapsulates information about the tag event. The webhook parsing logic is able to process tag event and return valid WebhookInfo for the GitLab VCS.
The general WebhookInfo is extended and now encapsulates information about the tag event. The webhook parsing logic is able to process tag event and return valid WebhookInfo for the Bitbucket Server VCS.
The general WebhookInfo is extended and now encapsulates information about the tag event. The webhook parsing logic is able to process tag event and return valid WebhookInfo for the Bitbucket Cloud VCS.
The general WebhookInfo is extended and now encapsulates information about the tag event. The webhook parsing logic is able to process tag event and return valid WebhookInfo for the GitHub VCS.
go fmt ./...
for formatting the code before submitting the pull request.The tag creation and removal webhook events now can be parsed by the
ParseIncomingWebhook()
function. The information about the tag is stored in the newTag
field of theWebhookInfo
type. Also, the two new events added:TagPushed
andTagRemoved
to represent each of these operations.