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

tide, Fix require_manually_triggered_jobs tide handling #31687

Merged
merged 1 commit into from
Feb 3, 2024

Conversation

oshoval
Copy link
Contributor

@oshoval oshoval commented Jan 21, 2024

When require_manually_triggered_jobs is used, tide doesn't wait for the jobs
that require manual trigger, nor adds them to batches.
This PR fix it, by checking the bp settings, and if the require_manually_triggered_jobs feature is enabled
for the branch, then force the jobs that have the following settings:

  • always_run=false
  • optional=false
  • skip_report=false
  • run_if_changed and skip_if_only_changed are empty

or has run_before_merge=true (as was already before this PR).

Fixes: #31686
Fixes: #31050

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 21, 2024
Copy link

linux-foundation-easycla bot commented Jan 21, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: oshoval / name: oscollabus (7cf1e9a)

@k8s-ci-robot
Copy link
Contributor

Hi @oshoval. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 21, 2024
@k8s-ci-robot k8s-ci-robot added area/prow Issues or PRs related to prow area/prow/tide Issues or PRs related to prow's tide component sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Jan 21, 2024
@oshoval
Copy link
Contributor Author

oshoval commented Jan 21, 2024

Hi @jmguzik @petr-muller
Can you please suggest if the direction is fine ?
I will add unit tests of course once we see it is on the right track

Thanks

@petr-muller
Copy link
Member

/ok-to-test

I think the idea is sound, happy to review when out of WIP and polished

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 24, 2024
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 30, 2024
@oshoval oshoval changed the title WIP: Fix require_manually_triggered_jobs tide handling tide, Fix require_manually_triggered_jobs tide handling Jan 30, 2024
@oshoval oshoval marked this pull request as ready for review January 30, 2024 12:44
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 30, 2024
@k8s-ci-robot k8s-ci-robot removed the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Jan 30, 2024
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 30, 2024
@oshoval
Copy link
Contributor Author

oshoval commented Jan 30, 2024

Thanks
Added unit tests
PR ready for review please

Copy link
Contributor

@jmguzik jmguzik left a comment

Choose a reason for hiding this comment

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

Many thanks for handling this edge-case. I added some comments.

prow/tide/tide.go Show resolved Hide resolved
prow/tide/tide_test.go Outdated Show resolved Hide resolved
prow/tide/tide.go Outdated Show resolved Hide resolved
@oshoval
Copy link
Contributor Author

oshoval commented Jan 31, 2024

Thanks
Addressed comments

Copy link
Contributor

@jmguzik jmguzik left a comment

Choose a reason for hiding this comment

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

From my POV
/lgtm
/assign @petr-muller
Let's wait on @petr-muller approval.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 31, 2024
@oshoval
Copy link
Contributor Author

oshoval commented Jan 31, 2024

Thanks

pull-test-infra-unit-test-race-detector-nonblocking isn't blocking iiuc, and also not due to this PR
https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/test-infra/31687/pull-test-infra-unit-test-race-detector-nonblocking/1752642590001336320

For visibility, there is the function GetBranchProtection, but in case the Org is not found, it doesn't fall back to the global BP settings, this why i didn't use it.

Btw not part of this PR scope, but aint it redundant that GetTideContextPolicy and presubmitsByPull have lots in common but still different implementation even on the common parts, and also their result is populated into different elements ?
(I am totally not into every detail, so of course i might miss the point)

@droslean
Copy link
Member

/retest

Tide didn't take into account jobs that require manual triggering,
on batches and when populating the subpool presubmits.
It resulted in missing protection for this kind of jobs.

Fix it by acting according the policy, and including
require manual triggering jobs in tide decisions.

Signed-off-by: Or Shoval <oshoval@redhat.com>
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 31, 2024
@oshoval
Copy link
Contributor Author

oshoval commented Jan 31, 2024

oops commit had the word WIP, removed it
btw aint it should be blocked if there is a word WIP on commit title ?

Copy link
Member

@petr-muller petr-muller left a comment

Choose a reason for hiding this comment

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

Thanks!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 3, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jmguzik, oshoval, petr-muller

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 3, 2024
@petr-muller
Copy link
Member

btw aint it should be blocked if there is a word WIP on commit title ?

I think the plugin only checks PR title, not commits

@k8s-ci-robot k8s-ci-robot merged commit 43e4bce into kubernetes:master Feb 3, 2024
7 checks passed
oshoval added a commit to oshoval/project-infra that referenced this pull request Feb 4, 2024
Now that kubernetes/test-infra#31687
is merged, we don't need the workaround anymore.
Required manually triggered jobs would be detected as required by
tide, and have the same effect as run_before_merge.

Signed-off-by: Or Shoval <oshoval@redhat.com>
kubevirt-bot pushed a commit to kubevirt/project-infra that referenced this pull request Feb 20, 2024
…in (#3221)

* phased plugin: Enable from-branch-protection

Signed-off-by: Or Shoval <oshoval@redhat.com>

* phased plugin: Remove run_before_merge workaround

Now that kubernetes/test-infra#31687
is merged, we don't need the workaround anymore.
Required manually triggered jobs would be detected as required by
tide, and have the same effect as run_before_merge.

Signed-off-by: Or Shoval <oshoval@redhat.com>

---------

Signed-off-by: Or Shoval <oshoval@redhat.com>
Barakmor1 pushed a commit to Barakmor1/project-infra that referenced this pull request Apr 24, 2024
…in (kubevirt#3221)

* phased plugin: Enable from-branch-protection

Signed-off-by: Or Shoval <oshoval@redhat.com>

* phased plugin: Remove run_before_merge workaround

Now that kubernetes/test-infra#31687
is merged, we don't need the workaround anymore.
Required manually triggered jobs would be detected as required by
tide, and have the same effect as run_before_merge.

Signed-off-by: Or Shoval <oshoval@redhat.com>

---------

Signed-off-by: Or Shoval <oshoval@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/prow/tide Issues or PRs related to prow's tide component area/prow Issues or PRs related to prow cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
5 participants