Add PR edited event#5155
Conversation
|
Deployment of preview was successful: https://woodpecker-ci-woodpecker-pr-5155.surge.sh |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5155 +/- ##
==========================================
+ Coverage 26.36% 26.38% +0.01%
==========================================
Files 401 401
Lines 28537 28547 +10
==========================================
+ Hits 7525 7533 +8
- Misses 20323 20325 +2
Partials 689 689 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
6543
left a comment
There was a problem hiding this comment.
I'm agains a pull edit event and in fafour of an pull/issue_metadata event that can trigger if e.g. lables, asignees etc changes
else we will get a longer and longer event enum list ...
This comment was marked as off-topic.
This comment was marked as off-topic.
|
Perfect, so gitea / forgejo is already activated for those events. Github lgtm as well: Did some testing with GitHub for other actions (label, milestone, draft / ready for review) and received those events by now (the part after the Edited seems to be only triggered by title and description updates as stated in the description. Changing draft state is another event for GitHub. At least compared to GitLab where the draft state is set by adding the I would keep the implementation focused on the editing of title & description for now. We should however decide now if we want to add separate events like label added in the future as part of this linking #3425 |
This comment was marked as off-topic.
This comment was marked as off-topic.
Option A
Option B
I think I would prefer option b at as combining those events seems fine to me. Users would probably for example not need to filter secrets only for milestone events while allowing label change events. Use-cases for me would be:
|
|
If we go with B, we need to extend the when filters to support all these different metadata change types. Otherwise it wouldn't be possible to differentiate between these as @xoxys said. Just going with If we go with A, we just should improve the dev experience by using a single package for constants and not having to redefine every event x times. I don't really have a preference here.
We don't do this at all currently. If the "pull request" event is enabled, the secret is available if the PR is opened, edited, closed, merged, updated, whatever. For ux and implementation reasons, I'd keep this behaviour. From a security perspective, splitting won't improve that as well as you can trigger any of these events when having access to the PRs in the forge. |
|
thanks for not rushing it, Im aware of option A and B ... well i see the pros and cons of both ... I personally would go with B as the events for title change, milestone additions etc is probably mostly used to handled by code checking for compliance of lables/titles etc... just my usecases i would have:
|
|
anyway I'm looking forward to see labels-, milestones-, titles-changes trigger woodpecker automation :) |
|
-> feel free to remove my block once conclution has reached 🚀 |
|
in #5214 as as alternative for this ... i try to implement the gitea/forgejo + docs part only and then we can decide if we wana have a meta event or single events for each ... |
|
@qwerty287 @anbraten was an dessision already made to go for #5155 or #5214 ? |
|
I don't think so. There was no further discussion yet. I personally still would go with this one |
|
well my main argumen it is, that woodpecker should have all events forge independent ... while metadata on pulls can be different ineach forge, e.g. sone dont have projects etc ... |
This doesn't matter for the discussion at hand. You can integrate any underlying forge event to be possibly included as a valid trigger for the WP event One can discuss if users even want a build trigger on milestone or label change, or any other possibly related change to a PR, or if this should be restricted to the essential components, i.e. title and description. Arguments for both exists. The major downside of squashing all actions into one will result in a lack of fine tuning for users. For example, in some workflows of mine I use In general, I don't understand what is wrong with this PR and why the initial work in #5214 has been put into. You could have just built upon this PR/extended it, propose a name change or wait for a resolution for the meta discussion. Instead now, there are two PRs and you're pushing hard to get the other one in, for hard to understand reasons (at least to me). In case a voting is happening, I'd vote for option A.
I can't follow that argumentation as the current one is already forge-independent. However, your comment indicates it would not be? |
|
Thats why i want to just squash the meta events ... And introduce a New env var to fine Granulat filter in Thema if needed ... See my demo implementation |
Yes i used it as base, because i did want to have the test assets and if i would have done from scratch it would change/add similar lines so why not use it and by doing so also honor the init. work? I would vote vor B and to not argue around non existing impl. i created my pull - this should not be about wicht author can merge his pull.
well if we want to cover what github-, gitea- or forgejo-actions can do ... we have too |
|
if we dont ... well then we should define a clear scope and stick to it |
|
I would prefer option B, for usability reasons. The meta data on which this event might trigger could be very different for different forges. Bundle all meta data changes into a single event would allow Woodpecker to quickly handle new types of changes with that event. Documentation changes would be minimal if even needed. On the other hand having a single event for every type of change might does not scale well in the future. As a user of a CI it is might hard to bundle different events into a single handler. But as a user of Woodpecker it would be quiet easy to split that single event into different handlers using And still this would not prevent to handle some changes more special than others. But I would first like to have the generic one catches all approach. |
|
Thinking over this again, I actually agree to this... |
|
Ok looks like most people prefer this way, then Ill follow this opinion 👍 |
|
Should we close this one then for now? |
|
will finish my pull and your work is not forgotten It's in my pull commit history :) |




Basically cherry-pick https://codeberg.org/crowci/crow/pulls/82 with some improvements.
@pat-s your implementation contains a security issue. It is possible to bypass the approval requirement because it does not check for the pr edited event if you require PRs to be approved. This is fixed here.