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

The PRs which are not approved run subset of tests #11828

Conversation

potiuk
Copy link
Member

@potiuk potiuk commented Oct 24, 2020

This PR is an implementation of optimisation - to only run
default values for build matrix in case PR does not have
"okay to test" label.

This "okay to test" label is set when the PR gets approved
but it was not approved before, also then a comment is generated
urging the committer to rebase the PR to run full set of tests.

Additionally a check is added (in-progress) that makes the PR
not yet ready to be merged. Only after re-running it it will
become truly ready to be merged.


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.

@potiuk
Copy link
Member Author

potiuk commented Oct 24, 2020

cc: @TobKed - > once we have the auto-labeling and re-triggering the workflow, this one implements only running one default combo of all tests.

@potiuk
Copy link
Member Author

potiuk commented Oct 24, 2020

@dimberman @ashb @kaxil @turbaszek -> once we have the labeling in place, this one limits not only the actual tests run but also the number of images prepared. We only need and run one image (the default one) for such build, so the savings will be rather cool.

@potiuk potiuk force-pushed the run-only-subset-of-tests-for-non-approved-prs branch from 5de4149 to 5cd3fbf Compare October 24, 2020 16:42
@potiuk potiuk added the full tests needed We need to run full set of tests for this PR to merge label Oct 24, 2020
@potiuk potiuk force-pushed the run-only-subset-of-tests-for-non-approved-prs branch from 5cd3fbf to 397740d Compare October 24, 2020 17:38
@potiuk potiuk force-pushed the run-only-subset-of-tests-for-non-approved-prs branch from 397740d to 66c98df Compare October 27, 2020 09:19
@potiuk
Copy link
Member Author

potiuk commented Oct 27, 2020

cc: @TobKed -> testing without the selective checks and comments for now :).

@potiuk potiuk force-pushed the run-only-subset-of-tests-for-non-approved-prs branch 10 times, most recently from 75760bb to 6a64d1a Compare October 27, 2020 19:18
@potiuk potiuk changed the title Run only subset of tests for non approved prs The PRs which are not approved run subset of tests Oct 27, 2020
@potiuk potiuk marked this pull request as ready for review October 27, 2020 19:19
@potiuk
Copy link
Member Author

potiuk commented Oct 27, 2020

OK. We have it working with @TobKed. Please take a look. I'd love to merge it for tomorrow to see whether we will have some improvements even before moving to self-hosted runners.

It works as follows (and I will describe it in separate PR):

  • by default when PR is not approved only "Default" variants of matrix are run as tests.

  • when a committer approves the PR (generally when the state changes to "approved by all committers who reviewed) the PR review workflow is run and it

    • sets the label to "ok to test" and
    • adds the comment, that you should rebase or rerun the workflow to run all the test

Screenshot from 2020-10-27 20-25-33

Also a new check is added that will remain "in-progress" until you actually rebase the request or commiter re-runs the check:

Screenshot from 2020-10-27 20-07-56

I think at this point we might even decide to merge such request in case of simple changes that do not introduce too big of a risk. Maybe even we can change the comment to explicitly say so and leave the decision to committer.

  • When someone rebases/reruns such PR with "okay to test" label, it will run with full suite of tests. This will continue with every rebase until some commiter "request changes" - in which case the label will be removed and the PR will return back to "selected tests only".

  • It is a bit different for "doc-only" PRs that do not run any tests. When commiter approves the PR the PR gets "okay to merge" label and comment indicating that the PR can be merged:

Screenshot from 2020-10-27 20-05-57

And it can be merged immediately

@potiuk potiuk force-pushed the run-only-subset-of-tests-for-non-approved-prs branch from 6a64d1a to 72cdcc0 Compare October 27, 2020 19:33
Copy link
Contributor

@TobKed TobKed left a comment

Choose a reason for hiding this comment

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

I released today v1.1 of TobKed/label-when-approved-action

.github/workflows/label_when_approved.yml Outdated Show resolved Hide resolved
.github/workflows/label_when_approved.yml Outdated Show resolved Hide resolved
@potiuk
Copy link
Member Author

potiuk commented Oct 28, 2020

I also realised that I have to do an exception for image building in v1-10-stable/test branch. Pushing a fixup with both shortly.

@potiuk potiuk force-pushed the run-only-subset-of-tests-for-non-approved-prs branch from 72cdcc0 to ab0edd3 Compare October 28, 2020 19:11
@github-actions
Copy link

The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.

@potiuk potiuk force-pushed the run-only-subset-of-tests-for-non-approved-prs branch from ab0edd3 to f47b09d Compare October 28, 2020 19:54
@potiuk
Copy link
Member Author

potiuk commented Oct 28, 2020

Shiny-new version! Here is the final description of how it works (note that we will not see that behavior here - only after we merge it)!

All the PRs before approval will run either "small" set of tests (default matrix values) or not at all (in case of doc-only changes).

Then interesting things will happen after PR gets approval from the committer:

  1. The doc-only tests will get "okay to merge" label and this comment: "The PR is ready to be merged. No tests are needed!" : 

Screenshot from 2020-10-28 20-41-53

  1. If the PR is not changing "Core" of airflow, the PR will get "okay to merge" label and this comment: "The PR should be OK to be merged with just subset of tests as it does not modify Core of Airflow. The committers might merge it or can add a label 'full tests needed' and re-run it to run all tests if they see it is needed!". 

Screenshot from 2020-10-28 20-48-27

  1. If the PR is changing "Core" of airflow, the PR will get "full tests needed" label and this comment:  "This PR requires a full set of tests. Please rebase the PR on the latest master or ask a committer to re-run the tests". And the "okay to test" label should change to "full tests needed". We will add the "in-progress" check, to make the button 'gray' until it gets rebased and the full set of tests will run for it. The PRs with this label will run "full matrix" tests. 

Screenshot from 2020-10-28 20-49-14

@github-actions
Copy link

The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.

@github-actions
Copy link

The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.

@potiuk potiuk force-pushed the run-only-subset-of-tests-for-non-approved-prs branch from f47b09d to 5b19c6a Compare October 28, 2020 20:22
This PR is an implementation of optimisation - to only run
default values for build matrix in case PR does not have
"okay to test" label.

This "okay to test" label is set when the PR gets approved
but it was not approved before, also then a comment is generated
urging the committer to rebase the PR to run full set of tests.

Additionally a check is added (in-progress) that makes the PR
not yet ready to be merged. Only after re-running it it will
become truly readty to be merged.
@potiuk potiuk force-pushed the run-only-subset-of-tests-for-non-approved-prs branch from 5b19c6a to 1864187 Compare October 28, 2020 21:44
@potiuk potiuk merged commit 37eaac3 into apache:master Oct 29, 2020
@potiuk potiuk deleted the run-only-subset-of-tests-for-non-approved-prs branch October 29, 2020 07:07
@potiuk
Copy link
Member Author

potiuk commented Oct 29, 2020

cc: @TobKed -> merged

michalmisiewicz pushed a commit to michalmisiewicz/airflow that referenced this pull request Oct 30, 2020
This PR is an implementation of optimisation - to only run
default values for build matrix in case PR does not have
"okay to test" label.

This "okay to test" label is set when the PR gets approved
but it was not approved before, also then a comment is generated
urging the committer to rebase the PR to run full set of tests.

Additionally a check is added (in-progress) that makes the PR
not yet ready to be merged. Only after re-running it it will
become truly readty to be merged.
szn pushed a commit to szn/airflow that referenced this pull request Nov 1, 2020
This PR is an implementation of optimisation - to only run
default values for build matrix in case PR does not have
"okay to test" label.

This "okay to test" label is set when the PR gets approved
but it was not approved before, also then a comment is generated
urging the committer to rebase the PR to run full set of tests.

Additionally a check is added (in-progress) that makes the PR
not yet ready to be merged. Only after re-running it it will
become truly readty to be merged.
potiuk added a commit that referenced this pull request Nov 14, 2020
This PR is an implementation of optimisation - to only run
default values for build matrix in case PR does not have
"okay to test" label.

This "okay to test" label is set when the PR gets approved
but it was not approved before, also then a comment is generated
urging the committer to rebase the PR to run full set of tests.

Additionally a check is added (in-progress) that makes the PR
not yet ready to be merged. Only after re-running it it will
become truly readty to be merged.

(cherry picked from commit 37eaac3)
@potiuk potiuk added the type:misc/internal Changelog: Misc changes that should appear in change log label Nov 14, 2020
@potiuk potiuk added this to the Airflow 1.10.13 milestone Nov 14, 2020
potiuk added a commit that referenced this pull request Nov 16, 2020
This PR is an implementation of optimisation - to only run
default values for build matrix in case PR does not have
"okay to test" label.

This "okay to test" label is set when the PR gets approved
but it was not approved before, also then a comment is generated
urging the committer to rebase the PR to run full set of tests.

Additionally a check is added (in-progress) that makes the PR
not yet ready to be merged. Only after re-running it it will
become truly readty to be merged.

(cherry picked from commit 37eaac3)
potiuk added a commit that referenced this pull request Nov 16, 2020
This PR is an implementation of optimisation - to only run
default values for build matrix in case PR does not have
"okay to test" label.

This "okay to test" label is set when the PR gets approved
but it was not approved before, also then a comment is generated
urging the committer to rebase the PR to run full set of tests.

Additionally a check is added (in-progress) that makes the PR
not yet ready to be merged. Only after re-running it it will
become truly readty to be merged.

(cherry picked from commit 37eaac3)
kaxil pushed a commit that referenced this pull request Nov 18, 2020
This PR is an implementation of optimisation - to only run
default values for build matrix in case PR does not have
"okay to test" label.

This "okay to test" label is set when the PR gets approved
but it was not approved before, also then a comment is generated
urging the committer to rebase the PR to run full set of tests.

Additionally a check is added (in-progress) that makes the PR
not yet ready to be merged. Only after re-running it it will
become truly readty to be merged.

(cherry picked from commit 37eaac3)
cfei18 pushed a commit to cfei18/incubator-airflow that referenced this pull request Mar 5, 2021
This PR is an implementation of optimisation - to only run
default values for build matrix in case PR does not have
"okay to test" label.

This "okay to test" label is set when the PR gets approved
but it was not approved before, also then a comment is generated
urging the committer to rebase the PR to run full set of tests.

Additionally a check is added (in-progress) that makes the PR
not yet ready to be merged. Only after re-running it it will
become truly readty to be merged.

(cherry picked from commit 37eaac3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:dev-tools full tests needed We need to run full set of tests for this PR to merge type:misc/internal Changelog: Misc changes that should appear in change log
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants