You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2024/02/13 23:01:39 UTC
(airflow) 01/01: Add capability of testin canary CI runs by apache/airflow PR
This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch add-capability-of-testing-canary-runs-in-prs
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit cf346cef3bc82a1df0e3b6198e7ea9359af7b05c
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Tue Feb 13 23:59:02 2024 +0100
Add capability of testin canary CI runs by apache/airflow PR
It's been impossible to test canary runs as they are only run when
you push to `main` or one of the `v2-*-test` branch in apache/airlfow
repo. This PR adds capability to run special PR with `canary` label
to test canary run workflow in a PR from committer run in the
apache/airflow repo.
---
dev/breeze/doc/ci/04_selective_checks.md | 5 +++--
dev/breeze/doc/ci/07_debugging.md | 8 ++++++++
dev/breeze/src/airflow_breeze/commands/ci_commands.py | 2 ++
3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/dev/breeze/doc/ci/04_selective_checks.md b/dev/breeze/doc/ci/04_selective_checks.md
index e4e1d8b3fc..b80969ba0f 100644
--- a/dev/breeze/doc/ci/04_selective_checks.md
+++ b/dev/breeze/doc/ci/04_selective_checks.md
@@ -272,11 +272,12 @@ am overview of possible labels and their meaning:
| Label | Affected outputs | Meaning |
|-------------------------------|-------------------------------|-------------------------------------------------------------------------------------------------------|
-| full tests needed | full-tests-needed | Run complete set of tests, including all Python all DB versions, and all test types. |
+| canary | is-canary-run | If set, the PR run from apache/airflow repo behaves as `canary` run (can only be run by maintainer). |
| debug ci resources | debug-ci-resources | If set, then debugging resources is enabled during parallel tests and you can see them in the output. |
-| use public runners | runs-on | Force using public runners even for Committer runs. |
+| full tests needed | full-tests-needed | Run complete set of tests, including all Python all DB versions, and all test types. |
| non committer build | is-committer-build | If set then even for non-committer builds, the scripts used for images are used from target branch. |
| upgrade to newer dependencies | upgrade-to-newer-dependencies | If set then dependencies in the CI image build are upgraded to the newer ones. |
+| use public runners | runs-on | Force using public runners even for Committer runs. |
-----
diff --git a/dev/breeze/doc/ci/07_debugging.md b/dev/breeze/doc/ci/07_debugging.md
index 64ee2d1e5a..fee9e17485 100644
--- a/dev/breeze/doc/ci/07_debugging.md
+++ b/dev/breeze/doc/ci/07_debugging.md
@@ -57,6 +57,14 @@ maintainer.
should push your branch as `main` branch in your local fork. This will
run changed `build-images.yml` workflow as it will be in `main` branch
of your fork
+- When you are a committer and you change build images workflow, together
+ with build scripts, your build might fail because your scripts are used
+ in `build-images.yml` workflow, but the workflow is run using the `main`
+ version. Setting `non committer build` label will make your PR run using
+ the main version of the scripts and the workflow
+- When you want to test how changes in your workflow affect `canary` run,
+ as maintainer, you should push your PR to `apache` repository not to your
+ fork and set `canary` label to the PR
-----
diff --git a/dev/breeze/src/airflow_breeze/commands/ci_commands.py b/dev/breeze/src/airflow_breeze/commands/ci_commands.py
index 3122cd5c1e..150ca16d76 100644
--- a/dev/breeze/src/airflow_breeze/commands/ci_commands.py
+++ b/dev/breeze/src/airflow_breeze/commands/ci_commands.py
@@ -323,6 +323,8 @@ class WorkflowInfo(NamedTuple):
and (self.ref_name == "main" or TEST_BRANCH_MATCHER.match(self.ref_name))
):
return "true"
+ if "canary" in self.pull_request_labels and self.head_repo == "apache/airflow":
+ return "true"
return "false"
def run_coverage(self) -> str: