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

added issue comment hook support for Azure #200

Merged
merged 2 commits into from
Jun 28, 2022

Conversation

raghavharness
Copy link
Contributor

No description provided.

Copy link
Contributor

@tphoney tphoney left a comment

Choose a reason for hiding this comment

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

Are there any other types of events for the comment webhook eg for github there are a number of different actions

switch src.Action {
case "created":
dst.Action = scm.ActionCreate
case "edited":
dst.Action = scm.ActionEdit
case "deleted":
dst.Action = scm.ActionDelete
default:
dst.Action = scm.ActionUnknown
}
return dst, nil

@raghavharness
Copy link
Contributor Author

@tphoney Added

@@ -67,6 +67,8 @@ func (a Action) String() (s string) {
return "synchronized"
case ActionMerge:
return "merged"
case ActionEdit:
Copy link
Contributor

Choose a reason for hiding this comment

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

is this not really as update and edit are synonyms

case ActionUpdate:
		return "updated"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tphoney We can't keep this as Update since in triggers we have already defined an edit action on UI. We just checked since ActionEdit was not being passed Github IssueComment trigger with Edit action was not triggering so we need to pass this value. You can check below snippet.

case "edited":

@@ -67,6 +67,8 @@ func (a Action) String() (s string) {
return "synchronized"
case ActionMerge:
return "merged"
case ActionEdit:
Copy link
Contributor

Choose a reason for hiding this comment

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

@bradrydzewski how do you feel about adding this new action, it does seem to be referenced in some of the drivers.

Copy link
Member

@bradrydzewski bradrydzewski Jun 27, 2022

Choose a reason for hiding this comment

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

If this refers to updating pull request code we should use the synchronized action (which is the abstracted term we use for all providers) or if this refers to updating pull request metadata (tltle, description, status, etc) we should use the update action.

See some of the existing implementations for prior art:
https://github.com/drone/go-scm/blob/master/scm/driver/github/webhook.go#L159:L160

@@ -67,6 +67,8 @@ func (a Action) String() (s string) {
return "synchronized"
case ActionMerge:
return "merged"
case ActionEdit:
Copy link
Member

@bradrydzewski bradrydzewski Jun 27, 2022

Choose a reason for hiding this comment

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

If this refers to updating pull request code we should use the synchronized action (which is the abstracted term we use for all providers) or if this refers to updating pull request metadata (tltle, description, status, etc) we should use the update action.

See some of the existing implementations for prior art:
https://github.com/drone/go-scm/blob/master/scm/driver/github/webhook.go#L159:L160

@tphoney tphoney merged commit 71ecc3b into drone:master Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants