diff mbox series

[2/2] gitlab-ci: Convert check-dco/check-patch jobs to the 'rules' syntax

Message ID 20210525132418.4133235-3-f4bug@amsat.org (mailing list archive)
State New, archived
Headers show
Series Fix for the 'testing, gdbstub and plugin updates' pull request | expand

Commit Message

Philippe Mathieu-Daudé May 25, 2021, 1:24 p.m. UTC
Per GitLab documentation [*]:

  "rules replaces only/except and they can’t be used together
   in the same job."

Since the 'rules' syntax is more powerful and we are already using
it, convert the check-dco/check-patch jobs so no job use the 'only/
except' syntax.

[*] https://docs.gitlab.com/ee/ci/yaml/#rules

Inspired-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 .gitlab-ci.yml | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

Comments

Willian Rampazzo May 26, 2021, 4:25 p.m. UTC | #1
On Tue, May 25, 2021 at 10:24 AM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> Per GitLab documentation [*]:
>
>   "rules replaces only/except and they can’t be used together
>    in the same job."
>
> Since the 'rules' syntax is more powerful and we are already using
> it, convert the check-dco/check-patch jobs so no job use the 'only/
> except' syntax.
>
> [*] https://docs.gitlab.com/ee/ci/yaml/#rules
>
> Inspired-by: Daniel P. Berrangé <berrange@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  .gitlab-ci.yml | 16 +++++++++-------
>  1 file changed, 9 insertions(+), 7 deletions(-)
>

Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Alex Bennée May 27, 2021, 2:59 p.m. UTC | #2
Philippe Mathieu-Daudé <f4bug@amsat.org> writes:

> Per GitLab documentation [*]:
>
>   "rules replaces only/except and they can’t be used together
>    in the same job."
>
> Since the 'rules' syntax is more powerful and we are already using
> it, convert the check-dco/check-patch jobs so no job use the 'only/
> except' syntax.
>
> [*] https://docs.gitlab.com/ee/ci/yaml/#rules
>
> Inspired-by: Daniel P. Berrangé <berrange@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Queued to testing/next, thanks.
diff mbox series

Patch

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2b89143f81f..83e077d095c 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -786,12 +786,13 @@  check-patch:
   needs:
     job: amd64-centos8-container
   script: .gitlab-ci.d/check-patch.py
-  except:
-    variables:
-      - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
   variables:
     GIT_DEPTH: 1000
-  allow_failure: true
+  rules:
+    - if: '$CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH == "master"'
+      when: never
+    - when: on_success
+      allow_failure: true
 
 check-dco:
   stage: build
@@ -799,11 +800,12 @@  check-dco:
   needs:
     job: amd64-centos8-container
   script: .gitlab-ci.d/check-dco.py
-  except:
-    variables:
-      - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
   variables:
     GIT_DEPTH: 1000
+  rules:
+    - if: '$CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH == "master"'
+      when: never
+    - when: on_success
 
 build-libvhost-user:
   stage: build