automation: prevent eclair-ARM64-amd from running by mistake
PATCH 1/1 automation: prevent eclair-ARM64-amd from running by mistake
It seems unintentional that this job references .eclair-analysis instead of .eclair-analysis:triggered which does not apply the rules from that template. One effect is that it runs always instead of manually in my xen-project/people repo.
---
Cc: Nicola Vetrini <[email protected]>
Cc: Doug Goldstein <[email protected]>
Cc: Stefano Stabellini <[email protected]>
--- automation/gitlab-ci/analyze.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
automation/gitlab-ci/analyze.yaml +1 -1
@@ -165,7 +165,7 @@ eclair-ARM64-amd: rules: - if: $ECLAIR_SAFETY when: always - - !reference [.eclair-analysis, rules] + - !reference [.eclair-analysis:triggered, rules] .eclair-analysis:on-schedule: extends: .eclair-analysis
--
2.51.GIT
PATCH v2 1/1 automation: edit pipeline to prevent running non-selected jobs
Filtering jobs using the selected jobs regex is missing for qemu-export + yocto jobs when running regular pipelines and eclair jobs when running scheduled pipelines.
First, set a default value for the selected jobs regex to remove the need to always check if the variable is empty.
Then add the missing rules to filter out those jobs.
---
changes v2:
- rebase onto staging
with SELECTED_JOBS_ONLY="/alpine-3.18-gcc$/" ...
before push: https://gitlab.com/xen-project/people/victormlira/xen/-/pipelines/2212050840
after push: https://gitlab.com/xen-project/people/victormlira/xen/-/pipelines/2212063969
before schedule: https://gitlab.com/xen-project/people/victormlira/xen/-/pipelines/2212068543
after schedule: https://gitlab.com/xen-project/people/victormlira/xen/-/pipelines/2212066703
--- .gitlab-ci.yml | 1 + automation/gitlab-ci/analyze.yaml | 5 +++-- automation/gitlab-ci/build.yaml | 9 ++++++--- 3 files changed, 10 insertions(+), 5 deletions(-)
.gitlab-ci.yml +1 -0
@@ -2,6 +2,7 @@ variables: XEN_REGISTRY: registry.gitlab.com/xen-project/xen SELECTED_JOBS_ONLY: description: "Regex to select only some jobs, must be enclosed with /. For example /job1|job2/" + value: "/.*/" workflow: name: "$CI_PIPELINE_SCHEDULE_DESCRIPTION"
automation/gitlab-ci/analyze.yaml +3 -2
@@ -31,8 +31,7 @@ rules: - if: $CI_PIPELINE_SOURCE == "schedule" when: never - - if: $SELECTED_JOBS_ONLY && $CI_JOB_NAME =~ $SELECTED_JOBS_ONLY - - if: $SELECTED_JOBS_ONLY + - if: $CI_JOB_NAME !~ $SELECTED_JOBS_ONLY when: never - if: $WTOKEN && $CI_PROJECT_PATH =~ /^xen-project\/people\/.*$/ when: manual
@@ -172,6 +171,8 @@ eclair-ARM64-amd: rules: - if: $CI_PIPELINE_SOURCE != "schedule" when: never + - if: $CI_JOB_NAME !~ $SELECTED_JOBS_ONLY + when: never - !reference [.eclair-analysis, rules] eclair-x86_64-allrules:on-schedule:
automation/gitlab-ci/build.yaml +6 -3
@@ -226,6 +226,9 @@ - binaries/ when: always needs: [] + rules: + - if: $CI_JOB_NAME =~ $SELECTED_JOBS_ONLY + when: manual .yocto-test-arm64: extends: .yocto-test
@@ -261,6 +264,9 @@ .test-jobs-artifact-common: stage: build needs: [] + rules: + - if: $CI_JOB_NAME =~ $SELECTED_JOBS_ONLY + when: on_success # Arm test artifacts
@@ -468,20 +474,17 @@ yocto-qemuarm64: extends: .yocto-test-arm64 variables: YOCTO_BOARD: qemuarm64 - when: manual yocto-qemuarm: extends: .yocto-test-arm64 variables: YOCTO_BOARD: qemuarm YOCTO_OUTPUT: --copy-output - when: manual yocto-qemux86-64: extends: .yocto-test-x86-64 variables: YOCTO_BOARD: qemux86-64 - when: manual # Cppcheck analysis jobs
--
2.51.GIT
PATCH 1/1 automation: edit pipeline to fix blocked status
The original yocto config had a hidden default of allow_failure: true for the manual job while the hidden default for rules is false. This causes the stages with manual jobs to show as blocked.
Set it explicitly to true to avoid the analyze and build stages being shown as blocked.
---
https://gitlab.com/xen-project/people/victormlira/xen/-/pipelines/2212386023
(stuck because of hardware jobs)
--- automation/gitlab-ci/build.yaml | 1 + 1 file changed, 1 insertion(+)
automation/gitlab-ci/build.yaml +1 -0
@@ -229,6 +229,7 @@ rules: - if: $CI_JOB_NAME =~ $SELECTED_JOBS_ONLY when: manual + allow_failure: true .yocto-test-arm64: extends: .yocto-test
--
2.51.GIT
PATCH 1/1 automation: edit pipeline to fix hardware jobs running by mistake
The selected jobs regex was assumed to be possibly empty in some places and setting a default value for the regex caused the hardware jobs to bypass some rules checks.
To fix this, adjust the rules to remove the check for empty and instead just match the regex.
---
https://gitlab.com/xen-project/people/sstabellini/xen/-/pipelines/2212446508
https://gitlab.com/xen-project/people/victormlira/xen/-/pipelines/2212446409
--- automation/gitlab-ci/build.yaml | 7 ++----- automation/gitlab-ci/test.yaml | 27 +++++++++++---------------- 2 files changed, 13 insertions(+), 21 deletions(-)
automation/gitlab-ci/build.yaml +2 -5
@@ -13,11 +13,8 @@ when: always needs: [] rules: - - if: $SELECTED_JOBS_ONLY && $CI_JOB_NAME =~ $SELECTED_JOBS_ONLY - when: always - - if: $SELECTED_JOBS_ONLY - when: never - - when: on_success + - if: $CI_JOB_NAME =~ $SELECTED_JOBS_ONLY + when: on_success .gcc-tmpl: variables: &gcc
automation/gitlab-ci/test.yaml +11 -16
@@ -2,10 +2,8 @@ stage: test image: ${XEN_REGISTRY}/${CONTAINER} rules: - - if: $SELECTED_JOBS_ONLY && $CI_JOB_NAME =~ $SELECTED_JOBS_ONLY - - if: $SELECTED_JOBS_ONLY - when: never - - when: on_success + - if: $CI_JOB_NAME =~ $SELECTED_JOBS_ONLY + when: on_success .arm64-test-needs: &arm64-test-needs - project: xen-project/hardware/test-artifacts
@@ -113,10 +111,9 @@ - '*.dtb' when: always rules: - - if: $SELECTED_JOBS_ONLY && $CI_JOB_NAME =~ $SELECTED_JOBS_ONLY - - if: $SELECTED_JOBS_ONLY - when: never - - if: $XILINX_JOBS == "true" && $CI_COMMIT_REF_PROTECTED == "true" + - if: $CI_JOB_NAME =~ $SELECTED_JOBS_ONLY && $XILINX_JOBS == "true" + && $CI_COMMIT_REF_PROTECTED == "true" + when: on_success tags: - xilinx
@@ -134,10 +131,9 @@ - '*.log' when: always rules: - - if: $SELECTED_JOBS_ONLY && $CI_JOB_NAME =~ $SELECTED_JOBS_ONLY - - if: $SELECTED_JOBS_ONLY - when: never - - if: $XILINX_JOBS == "true" && $CI_COMMIT_REF_PROTECTED == "true" + - if: $CI_JOB_NAME =~ $SELECTED_JOBS_ONLY && $XILINX_JOBS == "true" + && $CI_COMMIT_REF_PROTECTED == "true" + when: on_success tags: - xilinx
@@ -157,10 +153,9 @@ - '*.log' when: always rules: - - if: $SELECTED_JOBS_ONLY && $CI_JOB_NAME =~ $SELECTED_JOBS_ONLY - - if: $SELECTED_JOBS_ONLY - when: never - - if: $QUBES_JOBS == "true" && $CI_COMMIT_REF_PROTECTED == "true" + - if: $CI_JOB_NAME =~ $SELECTED_JOBS_ONLY && $QUBES_JOBS == "true" + && $CI_COMMIT_REF_PROTECTED == "true" + when: on_success tags: - qubes-hw2
--
2.51.GIT
Re: [XEN PATCH v1] automation: edit pipeline to fix hardware jobs running by mistake
Quoted 9 lines · Victor Lira
The selected jobs regex was assumed to be possibly empty in some places and setting a default value for the regex caused the hardware jobs to bypass some rules checks.
To fix this, adjust the rules to remove the check for empty and instead just match the regex.
Fixes 485ab1b5db0f358625fafe2df4e41e3ef008aed8Signed-off-by Victor Lira <[email protected]>
Re: [XEN PATCH v1] automation: edit pipeline to fix hardware jobs running by mistake
In reply to Victor LiraQuoted 8 lines · Victor Lira
The selected jobs regex was assumed to be possibly empty in some places and setting a default value for the regex caused the hardware jobs to bypass some rules checks.
To fix this, adjust the rules to remove the check for empty and instead just match the regex.
Fixes 485ab1b5db0f358625fafe2df4e41e3ef008aed8
nit: the format should be
Quoted 90 lines
Signed-off-by Victor Lira <[email protected]>---
https://gitlab.com/xen-project/people/sstabellini/xen/-/pipelines/2212446508
https://gitlab.com/xen-project/people/victormlira/xen/-/pipelines/2212446409--- automation/gitlab-ci/build.yaml | 7 ++----- automation/gitlab-ci/test.yaml | 27 +++++++++++---------------- 2 files changed, 13 insertions(+), 21 deletions(-)automation/gitlab-ci/build.yaml +2
-5@@ -13,11 +13,8 @@ when: always needs: [] rules: - - if: $SELECTED_JOBS_ONLY && $CI_JOB_NAME =~ $SELECTED_JOBS_ONLY - when: always - - if: $SELECTED_JOBS_ONLY - when: never - - when: on_success + - if: $CI_JOB_NAME =~ $SELECTED_JOBS_ONLY + when: on_success .gcc-tmpl: variables: &gccautomation/gitlab-ci/test.yaml +3
-8@@ -2,10 +2,8 @@ stage: test image: ${XEN_REGISTRY}/${CONTAINER} rules: - - if: $SELECTED_JOBS_ONLY && $CI_JOB_NAME =~ $SELECTED_JOBS_ONLY - - if: $SELECTED_JOBS_ONLY - when: never - - when: on_success + - if: $CI_JOB_NAME =~ $SELECTED_JOBS_ONLY + when: on_success .arm64-test-needs: &arm64-test-needs - project: xen-project/hardware/test-artifacts@@ -113,10 +111,9 @@ - '*.dtb' when: always rules: - - if: $SELECTED_JOBS_ONLY && $CI_JOB_NAME =~ $SELECTED_JOBS_ONLY - - if: $SELECTED_JOBS_ONLY - when: never - - if: $XILINX_JOBS == "true" && $CI_COMMIT_REF_PROTECTED == "true" + - if: $CI_JOB_NAME =~ $SELECTED_JOBS_ONLY && $XILINX_JOBS =="true"
automation/gitlab-ci/test.yaml +3
-4+ && $CI_COMMIT_REF_PROTECTED == "true" + when: on_success tags: - xilinx@@ -134,10 +131,9 @@ - '*.log' when: always rules: - - if: $SELECTED_JOBS_ONLY && $CI_JOB_NAME =~ $SELECTED_JOBS_ONLY - - if: $SELECTED_JOBS_ONLY - when: never - - if: $XILINX_JOBS == "true" && $CI_COMMIT_REF_PROTECTED == "true" + - if: $CI_JOB_NAME =~ $SELECTED_JOBS_ONLY && $XILINX_JOBS =="true"
automation/gitlab-ci/test.yaml +5
-5+ && $CI_COMMIT_REF_PROTECTED == "true" + when: on_success tags: - xilinx@@ -157,10 +153,9 @@ - '*.log' when: always rules: - - if: $SELECTED_JOBS_ONLY && $CI_JOB_NAME =~ $SELECTED_JOBS_ONLY - - if: $SELECTED_JOBS_ONLY - when: never - - if: $QUBES_JOBS == "true" && $CI_COMMIT_REF_PROTECTED == "true" + - if: $CI_JOB_NAME =~ $SELECTED_JOBS_ONLY && $QUBES_JOBS == "true" + && $CI_COMMIT_REF_PROTECTED == "true" + when: on_success tags: - qubes-hw2 --2.51.GIT
Signature · 4 lines
Nicola Vetrini, B.Sc. Software Engineer BUGSENG (https://bugseng.com) LinkedIn: https://www.linkedin.com/in/nicola-vetrini-a42471253
Re: [XEN PATCH v1] automation: edit pipeline to fix blocked status
In reply to Victor LiraQuoted 9 lines · Victor Lira
The original yocto config had a hidden default of
allow_failure: true for the manual job while the hidden default for rules is false. This causes the stages with manual jobs to show as blocked.Set it explicitly to true to avoid the analyze and build stages being shown as blocked.
Fixes 485ab1b5db0f358625fafe2df4e41e3ef008aed8Signed-off-by Victor Lira <[email protected]>
Quoted 5 lines · Victor Lira
It seems unintentional that this job references .eclair-analysis instead of .eclair-analysis:triggered which does not apply the rules from that template. One effect is that it runs always instead of manually in my xen-project/people repo.
Indeed it was a typo. Maybe add a Fixes tag to 2d9908a1d0d3 ? Other than that
Quoted 1 line
Signed-off-by Victor Lira <[email protected]>
Quoted 23 lines
---
Cc: Nicola Vetrini <[email protected]>
Cc: Doug Goldstein <[email protected]>
Cc: Stefano Stabellini <[email protected]>--- automation/gitlab-ci/analyze.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)automation/gitlab-ci/analyze.yaml +1
-2@@ -165,7 +165,7 @@ eclair-ARM64-amd: rules: - if: $ECLAIR_SAFETY when: always - - !reference [.eclair-analysis, rules] + - !reference [.eclair-analysis:triggered, rules] .eclair-analysis:on-schedule: extends: .eclair-analysis --2.51.GIT
Signature · 4 lines
Nicola Vetrini, B.Sc. Software Engineer BUGSENG (https://bugseng.com) LinkedIn: https://www.linkedin.com/in/nicola-vetrini-a42471253