[PATCH] gitlab: compare CIRRUS_nn vars against 'null' not ""

Daniel P. Berrangé posted 1 patch 3 years, 8 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20220608160651.248781-1-berrange@redhat.com
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <f4bug@amsat.org>, Thomas Huth <thuth@redhat.com>, Wainer dos Santos Moschetta <wainersm@redhat.com>, Beraldo Leal <bleal@redhat.com>
.gitlab-ci.d/base.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] gitlab: compare CIRRUS_nn vars against 'null' not ""
Posted by Daniel P. Berrangé 3 years, 8 months ago
The GitLab variable comparisons don't have shell like semantics where
an unset variable compares equal to empty string. We need to explicitly
test against 'null' to detect an unset variable.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 .gitlab-ci.d/base.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.gitlab-ci.d/base.yml b/.gitlab-ci.d/base.yml
index f334f3ded7..69b36c148a 100644
--- a/.gitlab-ci.d/base.yml
+++ b/.gitlab-ci.d/base.yml
@@ -13,7 +13,7 @@
     #############################################################
 
     # Cirrus jobs can't run unless the creds / target repo are set
-    - if: '$QEMU_JOB_CIRRUS && ($CIRRUS_GITHUB_REPO == "" || $CIRRUS_API_TOKEN == "")'
+    - if: '$QEMU_JOB_CIRRUS && ($CIRRUS_GITHUB_REPO == null || $CIRRUS_API_TOKEN == null)'
       when: never
 
     # Publishing jobs should only run on the default branch in upstream
-- 
2.36.1


Re: [PATCH] gitlab: compare CIRRUS_nn vars against 'null' not ""
Posted by Alex Bennée 3 years, 8 months ago
Daniel P. Berrangé <berrange@redhat.com> writes:

> The GitLab variable comparisons don't have shell like semantics where
> an unset variable compares equal to empty string. We need to explicitly
> test against 'null' to detect an unset variable.
>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>

Queued to testing/next, thanks.

-- 
Alex Bennée
Re: [PATCH] gitlab: compare CIRRUS_nn vars against 'null' not ""
Posted by Thomas Huth 3 years, 8 months ago
On 08/06/2022 18.06, Daniel P. Berrangé wrote:
> The GitLab variable comparisons don't have shell like semantics where
> an unset variable compares equal to empty string. We need to explicitly
> test against 'null' to detect an unset variable.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>   .gitlab-ci.d/base.yml | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/.gitlab-ci.d/base.yml b/.gitlab-ci.d/base.yml
> index f334f3ded7..69b36c148a 100644
> --- a/.gitlab-ci.d/base.yml
> +++ b/.gitlab-ci.d/base.yml
> @@ -13,7 +13,7 @@
>       #############################################################
>   
>       # Cirrus jobs can't run unless the creds / target repo are set
> -    - if: '$QEMU_JOB_CIRRUS && ($CIRRUS_GITHUB_REPO == "" || $CIRRUS_API_TOKEN == "")'
> +    - if: '$QEMU_JOB_CIRRUS && ($CIRRUS_GITHUB_REPO == null || $CIRRUS_API_TOKEN == null)'
>         when: never
>   
>       # Publishing jobs should only run on the default branch in upstream

Reviewed-by: Thomas Huth <thuth@redhat.com>


Re: [PATCH] gitlab: compare CIRRUS_nn vars against 'null' not ""
Posted by Richard Henderson 3 years, 8 months ago
On 6/8/22 09:06, Daniel P. Berrangé wrote:
> The GitLab variable comparisons don't have shell like semantics where
> an unset variable compares equal to empty string. We need to explicitly
> test against 'null' to detect an unset variable.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>   .gitlab-ci.d/base.yml | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/.gitlab-ci.d/base.yml b/.gitlab-ci.d/base.yml
> index f334f3ded7..69b36c148a 100644
> --- a/.gitlab-ci.d/base.yml
> +++ b/.gitlab-ci.d/base.yml
> @@ -13,7 +13,7 @@
>       #############################################################
>   
>       # Cirrus jobs can't run unless the creds / target repo are set
> -    - if: '$QEMU_JOB_CIRRUS && ($CIRRUS_GITHUB_REPO == "" || $CIRRUS_API_TOKEN == "")'
> +    - if: '$QEMU_JOB_CIRRUS && ($CIRRUS_GITHUB_REPO == null || $CIRRUS_API_TOKEN == null)'
>         when: never
>   
>       # Publishing jobs should only run on the default branch in upstream

Tested-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~