-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
prow/plugins: prioritise repo level triggers over org level ones #30054
prow/plugins: prioritise repo level triggers over org level ones #30054
Conversation
749697f
to
98f1866
Compare
/hold |
Hey @MadhavJivrajani, thanks for the PR. Just trying to understand this better:
|
@Priyankasaggu11929 excellent points! Regarding your first point, I thought I had Regarding your second point, I agree that this might not help if the time window is outside of 30 days. What I thought we could do is: check if we get an appropriate error from the API, if we do, use prow to comment on the PR saying workflow is older than 30 days and link to GH docs, with a suggestion of what could be done. |
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.
We have a number of other places where either org or repo-level config is allowed, and I think our convention is to make the repo-level config win out, so the intent here makes sense. This also seems to parallel what we do in ApproveFor
and LgtmFor
above. I can't say if this change to TriggerFor
would be breaking in some way - @cjwagner can you think of anything?
@MadhavJivrajani can you make the implementation in TriggerFor
match those in the other functions, for cohesiveness?
@cjwagner 👋🏼 |
It could technically be breaking since it does change behavior, but I can't imagine this being surprising. The only configs that would be affected by this probably intended for this to be the behavior from the beginning so this seems more like a fix.
Generally LGTM, but please address Steve's feedback, especially the bit about matching the implementation in the other functions. |
So far, `TriggerFor` prioristised returning org level trigger configs. There might be cases where in a trigger would need to be configured specifically for a repo (ex: allowing `/retest` to trigger GH workflows). In cases like this, we should return the trigger that is defined at the repo level, rather than its corresponding org level trigger. We could "work around" the above constraint by simply defining the repo level trigger higher up in the config, but then this trigger config would shadow the org level trigger, which is not desirable. This change returns a repo level trigger if it finds one, if not, it returns the first org level trigger it sees (keeping in sync with the previous behaviour). Fwiw - I'm not sure why multiple org level or multiple repo level triggers for the same org or repo would be specified. Signed-off-by: Madhav Jivrajani <[email protected]>
98f1866
to
ab1703d
Compare
Thanks @cjwagner! @stevekuznetsov I've changed the implementation to how |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: MadhavJivrajani, stevekuznetsov The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold cancel |
After #30048 was merged, I wasn't sure why
/retest
triggers were not working, I think this is why.So far,
TriggerFor
prioristised returning org level trigger configs. There might be cases where in a trigger would need to be configured specifically for a repo (ex: allowing/retest
to trigger GH workflows). In cases like this, we should return the trigger that is defined at the repo level, rather than its corresponding org level trigger.We could "work around" the above constraint by simply defining the repo level trigger higher up in the config, but then this trigger config would shadow the org level trigger, which is not desirable.
This change returns a repo level trigger if it finds one, if not, it returns the first org level trigger it sees (keeping in sync with the previous behaviour).
Fwiw - I'm not sure why multiple org level or multiple repo level triggers for the same org or repo would be specified.
/sig contributor-experience
/sig testing
/assign @stevekuznetsov