-
Notifications
You must be signed in to change notification settings - Fork 53
Conversation
gitea/hook.go
Outdated
@@ -2,6 +2,10 @@ | |||
// Use of this source code is governed by a MIT-style | |||
// license that can be found in the LICENSE file. | |||
|
|||
// Copyright 2017 The Gitea Authors. All rights reserved. |
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.
This line is the only need and put it after the first line.
How about use the duplicated struct between |
For the computable? I'm sorry, I did not understand. Could you elaborate? |
gitea/hook.go
Outdated
Issue *Issue `json:"issue"` | ||
} | ||
|
||
// JSONPayload FIXME |
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.
comment
I mean maybe remove |
Yeah, that was how I originally thought about doing it (and the safest way, since it doesn't cause any breakage). However, it's a matter of convenience and code de-duplication. I'm gonna do as you said anyway, mostly because of what @tboerger said on Gitter. |
LGTM |
Since the Gitea webhooks currently mimic for a big part the way GitHub does webhook, issue comments HookIssueActions have been removed to be added again at a later stage and milestone_set and milestone_cleared have been changed to milestoned and demilestoned, respectively.
I've changed the HookIssueAction names of the ones I added, and removed the comment ones, to better mimic the GitHub webhooks. Issue comments will come at a later stage (and PR). |
LGTM |
This PR prepares for an upcoming pull request on the main repository that aims to implement go-gitea/gitea#132, adding webhook for issue events.
A small API breakage would be introduced in the SDK (though the API JSON objects' structure would remain untouched, if not for some shifting of the position of the fields). As most fields between the PullRequestPayload and the IssuePayload would be the same, the idea is to move the fields to a common BaseIssuePayload, although this would bring a small breakage to when constructing the struct of a PullRequestPayload:
However, accessing the struct fields would still be possible after the struct is initialised.
This would be, however, a very small issue, as the PullRequestPayload is only initialised by Gitea itself (see this github search), but Gitea vendors its dependencies anyway, so this would break only in the event of a vendor update with no update to models/issue.go's struct initialisations.