From e542dfcd2f18111c2476a983e714c9296265b34e Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Tue, 25 Feb 2025 12:13:48 +0100 Subject: [PATCH 01/10] overwrite REFERENCE_BRANCH for merges to main-pc --- .gitlab-ci.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3487ad701..960a2fa77 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -986,12 +986,19 @@ build-codec-linux-debugging-make: # Short test jobs that run in merge request pipelines # --------------------------------------------------------------- +.set-reference-for-basop-port-branch: &set-reference-for-basop-port-branch + - if [ $CI_MERGE_REQUEST_TARGET_BRANCH_NAME = "main-pc" ]; then + - *update-scripts-repo + - REFERENCE_BRANCH=$(ci/get_float_ref_branch_name.sh) + - fi + ### jobs that test fx encoder -> flt decoder ivas-pytest-compare_to_main-short-enc: extends: - .rules-pytest-to-main-short - .test-job-linux before_script: + - *set-reference-for-basop-port-branch - USE_LTV=0 - DUT_DECODER_PATH=./IVAS_dec_ref - TEST_SUITE="$SHORT_TEST_SUITE_ENCODER" @@ -1004,6 +1011,7 @@ ivas-pytest-compare_to_main-short-enc-lev-10: - .rules-pytest-to-main-short - .test-job-linux before_script: + - *set-reference-for-basop-port-branch - USE_LTV=0 - DUT_DECODER_PATH=./IVAS_dec_ref - TEST_SUITE="$SHORT_TEST_SUITE_ENCODER" @@ -1016,6 +1024,7 @@ ivas-pytest-compare_to_main-short-enc-lev+10: - .rules-pytest-to-main-short - .test-job-linux before_script: + - *set-reference-for-basop-port-branch - USE_LTV=0 - DUT_DECODER_PATH=./IVAS_dec_ref - TEST_SUITE="$SHORT_TEST_SUITE_ENCODER" @@ -1029,6 +1038,7 @@ ivas-pytest-compare_to_main-short-dec: - .rules-mr-to-main-or-main-pc-or-manual - .test-job-linux before_script: + - *set-reference-for-basop-port-branch - USE_LTV=0 - DUT_ENCODER_PATH=./IVAS_cod_ref - TEST_SUITE="$SHORT_TEST_SUITE" @@ -1041,6 +1051,7 @@ ivas-pytest-compare_to_main-short-dec-lev-10: - .rules-mr-to-main-or-main-pc-or-manual - .test-job-linux before_script: + - *set-reference-for-basop-port-branch - USE_LTV=0 - DUT_ENCODER_PATH=./IVAS_cod_ref - TEST_SUITE="$SHORT_TEST_SUITE" @@ -1053,6 +1064,7 @@ ivas-pytest-compare_to_main-short-dec-lev+10: - .rules-mr-to-main-or-main-pc-or-manual - .test-job-linux before_script: + - *set-reference-for-basop-port-branch - USE_LTV=0 - DUT_ENCODER_PATH=./IVAS_cod_ref - TEST_SUITE="$SHORT_TEST_SUITE" @@ -1071,6 +1083,7 @@ ivas-pytest-compare_to_ref-short-enc: - .rules-mr-to-main-or-main-pc-or-manual - .test-job-linux before_script: + - *set-reference-for-basop-port-branch - USE_LTV=0 - ENCODER_TEST="true" - DUT_DECODER_PATH=./$REF_DECODER_PATH @@ -1084,6 +1097,7 @@ ivas-pytest-compare_to_ref-short-enc-lev-10: - .rules-mr-to-main-or-main-pc-or-manual - .test-job-linux before_script: + - *set-reference-for-basop-port-branch - USE_LTV=0 - ENCODER_TEST="true" - DUT_DECODER_PATH=./$REF_DECODER_PATH @@ -1097,6 +1111,7 @@ ivas-pytest-compare_to_ref-short-enc-lev+10: - .rules-mr-to-main-or-main-pc-or-manual - .test-job-linux before_script: + - *set-reference-for-basop-port-branch - USE_LTV=0 - ENCODER_TEST="true" - DUT_DECODER_PATH=./$REF_DECODER_PATH -- GitLab From 36ea560259dafb4e02837dae799f19da1170d56c Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Tue, 25 Feb 2025 13:48:11 +0100 Subject: [PATCH 02/10] make sure that script output is displayed on failure --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 960a2fa77..9f2773613 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -989,7 +989,8 @@ build-codec-linux-debugging-make: .set-reference-for-basop-port-branch: &set-reference-for-basop-port-branch - if [ $CI_MERGE_REQUEST_TARGET_BRANCH_NAME = "main-pc" ]; then - *update-scripts-repo - - REFERENCE_BRANCH=$(ci/get_float_ref_branch_name.sh) + - # this double call is there so the error printout is visible in case the schell script fails + - REFERENCE_BRANCH=$(ci/get_float_ref_branch_name.sh) || ci/get_float_ref_branch_name.sh - fi ### jobs that test fx encoder -> flt decoder -- GitLab From 66c69bc5f5393f5100b822df5bdb516c7914ad42 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Tue, 25 Feb 2025 13:51:59 +0100 Subject: [PATCH 03/10] fix script call and aadd redirectt --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9f2773613..9780e4341 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -989,8 +989,8 @@ build-codec-linux-debugging-make: .set-reference-for-basop-port-branch: &set-reference-for-basop-port-branch - if [ $CI_MERGE_REQUEST_TARGET_BRANCH_NAME = "main-pc" ]; then - *update-scripts-repo - - # this double call is there so the error printout is visible in case the schell script fails - - REFERENCE_BRANCH=$(ci/get_float_ref_branch_name.sh) || ci/get_float_ref_branch_name.sh + - # redirect to stdout so that the error message is visible in case of script failure + - REFERENCE_BRANCH=$(ci/get_float_ref_branch_name.sh | tee /dev/tty) - fi ### jobs that test fx encoder -> flt decoder -- GitLab From d82c7937826f9276410931737b0ca83fdfc66fa1 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Tue, 25 Feb 2025 13:52:53 +0100 Subject: [PATCH 04/10] hopefully fix invalid yml error --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9780e4341..5b9789138 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -989,7 +989,7 @@ build-codec-linux-debugging-make: .set-reference-for-basop-port-branch: &set-reference-for-basop-port-branch - if [ $CI_MERGE_REQUEST_TARGET_BRANCH_NAME = "main-pc" ]; then - *update-scripts-repo - - # redirect to stdout so that the error message is visible in case of script failure + # redirect to stdout so that the error message is visible in case of script failure - REFERENCE_BRANCH=$(ci/get_float_ref_branch_name.sh | tee /dev/tty) - fi -- GitLab From ae0ce593631e20e644b3628a998dfe325b7a3dd9 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Tue, 25 Feb 2025 14:05:11 +0100 Subject: [PATCH 05/10] try yet another variant --- .gitlab-ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5b9789138..2c8e1fa4f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -989,8 +989,9 @@ build-codec-linux-debugging-make: .set-reference-for-basop-port-branch: &set-reference-for-basop-port-branch - if [ $CI_MERGE_REQUEST_TARGET_BRANCH_NAME = "main-pc" ]; then - *update-scripts-repo - # redirect to stdout so that the error message is visible in case of script failure - - REFERENCE_BRANCH=$(ci/get_float_ref_branch_name.sh | tee /dev/tty) + # a bit awkward: write to file + standard out first so that the error message is visivle in case of failure. Then fill the variable from the file + - ci/get_float_ref_branch_name.sh | tee tmp_ref_branch.txt + - REFERENCE_BRANCH=$(cat tmp_ref_branch.txt) - fi ### jobs that test fx encoder -> flt decoder -- GitLab From c5c93ce4c8077616238afe577ed7ed5f4c834e9b Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Tue, 25 Feb 2025 14:08:21 +0100 Subject: [PATCH 06/10] add validation job for branch naming --- .gitlab-ci.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2c8e1fa4f..673d6393d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -804,6 +804,18 @@ fail-pipeline-if-in-draft: - echo "Your MR is still in Draft state, set it to ready to be mergable, then retrigger the pipeline." - exit 1 +# this branch runs on merges to main-pc only and will fail if the branch itself does not conform to the naming conventions +check-naming-of-branch-for-main-pc-merges: + extends: + - .rules-merge-request-to-main-pc + stage: prevalidate + tags: + - ivas-basop-linux + script: + - *update-scripts-repo + - ci/get_float_ref_branch_name.sh + + # --------------------------------------------------------------- # verification jobs # --------------------------------------------------------------- -- GitLab From 6418e7705aa671d063a525605573dd0f6b381955 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Tue, 25 Feb 2025 14:10:44 +0100 Subject: [PATCH 07/10] correct usage of script --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 673d6393d..e2ce45be0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -813,7 +813,7 @@ check-naming-of-branch-for-main-pc-merges: - ivas-basop-linux script: - *update-scripts-repo - - ci/get_float_ref_branch_name.sh + - ci/get_float_ref_branch_name.sh $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME # --------------------------------------------------------------- @@ -1002,7 +1002,7 @@ build-codec-linux-debugging-make: - if [ $CI_MERGE_REQUEST_TARGET_BRANCH_NAME = "main-pc" ]; then - *update-scripts-repo # a bit awkward: write to file + standard out first so that the error message is visivle in case of failure. Then fill the variable from the file - - ci/get_float_ref_branch_name.sh | tee tmp_ref_branch.txt + - ci/get_float_ref_branch_name.sh $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME | tee tmp_ref_branch.txt - REFERENCE_BRANCH=$(cat tmp_ref_branch.txt) - fi -- GitLab From a1087326945d9ab7ea1c25c46757dba5cff9b3df Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Tue, 25 Feb 2025 14:16:32 +0100 Subject: [PATCH 08/10] introduce MR tag for skipping the name check --- .gitlab-ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e2ce45be0..be883ccae 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -813,8 +813,9 @@ check-naming-of-branch-for-main-pc-merges: - ivas-basop-linux script: - *update-scripts-repo - - ci/get_float_ref_branch_name.sh $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME - + - if [ ! "$CI_MERGE_REQUEST_TITLE" =~ "\[skip[ -_]name[ -_]check\]" ]; then + - ci/get_float_ref_branch_name.sh $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME + - fi # --------------------------------------------------------------- # verification jobs @@ -999,7 +1000,7 @@ build-codec-linux-debugging-make: # --------------------------------------------------------------- .set-reference-for-basop-port-branch: &set-reference-for-basop-port-branch - - if [ $CI_MERGE_REQUEST_TARGET_BRANCH_NAME = "main-pc" ]; then + - if [ $CI_MERGE_REQUEST_TARGET_BRANCH_NAME = "main-pc" ] && [ ! "$CI_MERGE_REQUEST_TITLE" =~ "\[skip[ -_]name[ -_]check\]" ]; then - *update-scripts-repo # a bit awkward: write to file + standard out first so that the error message is visivle in case of failure. Then fill the variable from the file - ci/get_float_ref_branch_name.sh $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME | tee tmp_ref_branch.txt -- GitLab From b6cb533d4f3a9f046e9a6d30b6974fac8fe22126 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Tue, 25 Feb 2025 14:19:45 +0100 Subject: [PATCH 09/10] fix if --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index be883ccae..0a21e83d7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -813,7 +813,7 @@ check-naming-of-branch-for-main-pc-merges: - ivas-basop-linux script: - *update-scripts-repo - - if [ ! "$CI_MERGE_REQUEST_TITLE" =~ "\[skip[ -_]name[ -_]check\]" ]; then + - if [[ ! "$CI_MERGE_REQUEST_TITLE" =~ \[skip[[:space:]_-]name[[:space:]_-]check\] ]]; then - ci/get_float_ref_branch_name.sh $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME - fi @@ -1000,7 +1000,7 @@ build-codec-linux-debugging-make: # --------------------------------------------------------------- .set-reference-for-basop-port-branch: &set-reference-for-basop-port-branch - - if [ $CI_MERGE_REQUEST_TARGET_BRANCH_NAME = "main-pc" ] && [ ! "$CI_MERGE_REQUEST_TITLE" =~ "\[skip[ -_]name[ -_]check\]" ]; then + - if [ $CI_MERGE_REQUEST_TARGET_BRANCH_NAME = "main-pc" ] && [[ ! "$CI_MERGE_REQUEST_TITLE" =~ \[skip[[:space:]_-]name[[:space:]_-]check\] ]]; then - *update-scripts-repo # a bit awkward: write to file + standard out first so that the error message is visivle in case of failure. Then fill the variable from the file - ci/get_float_ref_branch_name.sh $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME | tee tmp_ref_branch.txt -- GitLab From ecc4b246021750b2c11eb1075e5a8449098790d8 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Tue, 25 Feb 2025 15:36:58 +0100 Subject: [PATCH 10/10] also exclude name check if branch is tagged as CI --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0a21e83d7..0c910a633 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -813,7 +813,7 @@ check-naming-of-branch-for-main-pc-merges: - ivas-basop-linux script: - *update-scripts-repo - - if [[ ! "$CI_MERGE_REQUEST_TITLE" =~ \[skip[[:space:]_-]name[[:space:]_-]check\] ]]; then + - if [[ ! "$CI_MERGE_REQUEST_TITLE" =~ \[skip[[:space:]_-]name[[:space:]_-]check\] ]] && [[ ! "$CI_MERGE_REQUEST_TITLE" =~ \[CI\] ]]; then - ci/get_float_ref_branch_name.sh $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME - fi @@ -1000,7 +1000,7 @@ build-codec-linux-debugging-make: # --------------------------------------------------------------- .set-reference-for-basop-port-branch: &set-reference-for-basop-port-branch - - if [ $CI_MERGE_REQUEST_TARGET_BRANCH_NAME = "main-pc" ] && [[ ! "$CI_MERGE_REQUEST_TITLE" =~ \[skip[[:space:]_-]name[[:space:]_-]check\] ]]; then + - if [ $CI_MERGE_REQUEST_TARGET_BRANCH_NAME = "main-pc" ] && [[ ! "$CI_MERGE_REQUEST_TITLE" =~ \[skip[[:space:]_-]name[[:space:]_-]check\] ]] && [[ ! "$CI_MERGE_REQUEST_TITLE" =~ \[CI\] ]]; then - *update-scripts-repo # a bit awkward: write to file + standard out first so that the error message is visivle in case of failure. Then fill the variable from the file - ci/get_float_ref_branch_name.sh $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME | tee tmp_ref_branch.txt -- GitLab