-
Notifications
You must be signed in to change notification settings - Fork 102
Add a feature that allows treating presubmit: false
as true
, conditionally.
#3256
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
Add a feature that allows treating presubmit: false
as true
, conditionally.
#3256
Conversation
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.
Code looks good to me. What happens if you add the label after all the presubmit tests have run? Will it trigger the missing tests?
I was thinking a comment in the description would scale better since it would allow you to specify what tests you want to promote. Relying on labels won't scale.
No, though @CaseyHillers has promised me he'd pair on a follow-up feature to do so. I figure this is better than nothing :)
This probably makes sense long term, but Casey's thought is we have a very tiny amount of post-submit targets today (in the engine in particular), so we could start with this feature and then later "graduate" to something else - my idea was something like: presubmit:
if-label: "label-name" One nice aspect of this is we could share labels across different targets. Comments could work too! |
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.
LGTM, modulo Casey's feedback. Thanks!
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.
Please get @ricardoamador's review on this as well. If this causes capacity issues, we can always delete the label + revert this change. This should be a good base for us to iterate on, and unblock the engine testing team.
I understand this is the easy path and gets you what you want you want now but you can handle the 'labeled' action on the 'pull request' event properly queue off the tests when a label is added. |
What does this do to the try pool in terms of usage? What is number of prod tests that could now be potentially added to the run? |
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.
Questions.
@matanlurey thank you for implementing this functionality. Giving that all the changes to cocoon can potentially impact the entire team we would like to first understand the implications of landing the PR. Some open questions:
|
Thanks for the questions. Replies inline, though I'll admit I'm motivated to see this land as soon as reasonable, because the alternatives to this PR is I do this manually by editing the
Partially, and partially I'm a fan of "PRs are small ... and just do exactly one thing". I'm not sure this is the right workflow, and I'm not sure if we'll cause other resource constraint issues (that you, Casey, and Godofredo all brought up), so I figured I'd go with a simpler approach until value was proven (might just take a few days I suppose).
No idea, but in practice I don't think it matters. The alternative to this feature is worse and likely uses as much, or even more, resources (and time):
According to
... but only PRs specifically tagged (for example, not the auto-rolls).
I thought this was obvious in the request, but this is for manually tagging a subset of PRs. See my comments above.
This is outside of my knowledge. My original PR had a check that only allowed this for |
If you add back the clause that checks that the repo is engine only we can give this a try. There is no way we can do this for flutter/flutter as there are currently 267 post-submit tasks and that would definitely affect the load on the try pool. Enabling for engine only should be a good place to start. I think there are less than 7 postsubmit tasks if I remember correctly in engine so we can see what the load is there before enabling on other repos.
|
@@ -462,6 +477,14 @@ class Scheduler { | |||
return getTargetsToRun(presubmitTargets, files); | |||
} | |||
|
|||
/// Returns `true` if [ciYaml.postsubmitTargets] should be ran during presubmit. | |||
static bool _includePostsubmitAsPresubmit(CiYaml ciYaml, PullRequest pullRequest) { |
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.
if (ciYaml.slug != Config.engineSlug) {
return false;
}
For now until the pool usage can be evaluated and we can see the effect, if any on our SLO.
Done and test (re-)added as well. |
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.
Send it!
Thanks! Out of curiosity, how long does it take to roll so I can try it? |
@matanlurey sorry did not see this earlier. It will be deployed in the morning at 8am. |
Good point about the reverts and relands. One minor nit is that editing the |
That's true, though we determined for the engine repo specifically it's not significant - it could be over time though and I'd be open to looking into something like outlined in #3256 (comment) if we get there.
It really depends (TM). The way I'd implement it today is by having the post-submit checks stay in the yellow (pending) state similar to Skia-gold, and once all other tests are passing and the change is LGTMd, run the tests before merging. Another option would be using a merge queue, which might be a better fit but is a bigger workflow change for the infra team. /cc @CaseyHillers |
I'm not sure merge queue is relevant in this case. The class of issues it solves revolve around out of sync issues, which we rarely face. Tree breakages happen as there is a gap in presubmit vs postsubmit testing (the framework being the best example of this). Around the capacity concerns, I would be interested in flutter/flutter#138511 where Cocoon throttles users consuming too much capacity. Instead of outright blocking this, the work will only get run when there is nothing else to do. For many people, I suspect it would be preferable to run tests in off-peak to prevent having to revert+reland their change. |
Closes flutter/flutter#138430 and I believe flutter/flutter#111418.
As @CaseyHillers mentions in flutter/flutter#138430, this would not be sufficient to understand the addition of a label (only if the PR is first created with a label, or a commit is pushed after the label is added), but it might be worth merging as-is (assuming I got all of the assumptions correct).