diff --git a/README.md b/README.md index d17d5eb438477b60f94515cec75119ec7b4fe0e2..3428abe898a1c22c24d337737b125d7edc5d2f39 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,7 @@ before_script: ``` - use only one include section at the top of the main yml file to keep things clear, remember that later stuff overwrites earlier stuff +- in general prefer adding scripts here over using yaml anchors in a CI config file - if your script shall modify some environment variable, you need to run it with `source` instead of calling it. - the merge CI config in the ivas-* repos can be viewed in the pipeline editor under "full configuration" - this is especially useful when making changes which should not functionally affect the CI, then it is helpful to copy the full merged config with and without the changes and compare the files directly or as parsed yaml dict locally. diff --git a/snippets/basop/branch-follows-porting-naming-convention.sh b/snippets/basop/branch-follows-porting-naming-convention.sh index a3811b0ba2c92fcf793fc57bd7e313a2cf2bae58..3b4c035c966076581e81acfb8f27b880eb873fb9 100644 --- a/snippets/basop/branch-follows-porting-naming-convention.sh +++ b/snippets/basop/branch-follows-porting-naming-convention.sh @@ -30,16 +30,16 @@ set -euo pipefail -BASOP_PATTERN="^[0-9]+[_-]basop[_-].*" -MSG_DOES_NOT_MATCH="Your branch name %s does not match the template '_basop_', e.g. '123_basop_fix_this_one_bug-2'. -If this branch is porting a float MR with a corresponding float part, then +BASOP_PATTERN='^(float|basop)[_-][0-9]+[_-].+$' +MSG_DOES_NOT_MATCH="Your branch name %s does not match the template '[basop|float]--', e.g. 'basop-123-fix_this_one_bug-2'. +If this branch has a parallel companion MR in the float repo with a corresponding float part, then sticking to this naming convention is needed for the testing system to match this branch with its float-reference counterpart. Please rename your branch. You can easily do this by creating a new branch from this branch: - git checkout -b You then also need to create a new merge request and update the links in your issue. -See here for details on the porting work process: https://forge.3gpp.org/rep/sa4/audio/ivas-basop/-/wikis/Porting-MRs-from-floating-point-codec#workflow-for-porting-a-merge-request-from-floating-point-codec-to-basop-codec +See here for details on the naming conventions: https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec/-/wikis/Software-development/Development-workflow#workflow-for-parallel-changes-in-fixed--and-floating-point-code -If this is not a porting branch, ignore above message. +If this branch does not have a float companion merge request, ignore above message. " if [ $# -ne 1 ]; then diff --git a/snippets/basop/branch-is-up-to-date-with-target-pre.sh b/snippets/basop/branch-is-up-to-date-with-target-pre.sh index fec2592518bc3b31c81a5746e83075f10905de06..69c1c4e2a20222b11c22fdef5bdf2de4f2a0cb3e 100644 --- a/snippets/basop/branch-is-up-to-date-with-target-pre.sh +++ b/snippets/basop/branch-is-up-to-date-with-target-pre.sh @@ -37,7 +37,7 @@ bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/branch-follows-porting-nam # if this branch follows the naming convetions, we can try to get the corresponding float MR branch # if this branch does NOT follow the porting naming convention, the float ref is just ivas-codec main, so skip everything if [[ "$exit_code_follows_naming_conventions" == "0" ]]; then - float_ref_branchname_in_ivas_codec=$(${CI_PROJECT_DIR}/ivas-codec-ci/snippets/basop/get-float-ref-branch-name.sh $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME) + float_ref_branchname_in_ivas_codec=$CI_COMMIT_REF_NAME fi # fetch merge target and check if we are up-to-date diff --git a/snippets/basop/check-float-ref-companion-branch-exists-for-porting-merge-requests.sh b/snippets/basop/check-float-ref-companion-branch-exists-for-porting-merge-requests.sh index 7a4b921f28d1de3b2a74d64cc2eaab154700e6b5..04d1b610ef5417032dd0e60e0477c82a01452159 100644 --- a/snippets/basop/check-float-ref-companion-branch-exists-for-porting-merge-requests.sh +++ b/snippets/basop/check-float-ref-companion-branch-exists-for-porting-merge-requests.sh @@ -28,7 +28,7 @@ # accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and # the United Nations Convention on Contracts on the International Sales of Goods. -MSG_NO_FLOAT_REF_BRANCH_FOUND="Your branch name %s looks like it is a porting MR, but there is no corresponding float merge request (%s). +MSG_NO_FLOAT_REF_BRANCH_FOUND="Your branch name %s conforms to the naming convention for parallel work on float and basop, but there is no corresponding branch of the same name in ivas-codec. If this is intended (no changes on ivas-codec main), simply ignore this warning. If there should be a float ref branch for this MR, please check your spelling on your other branch and make sure that you pushed it.\n " @@ -44,11 +44,10 @@ if [ "$exit_code_is_porting_mr" == "1" ]; then fi # if this does indeed look like a porting branch, get the float companion branch - if that is the default, then warn about possible typo/missing branch -float_ref_branchname=$(${CI_PROJECT_DIR}/ivas-codec-ci/snippets/basop/get-float-ref-branch-name.sh $CI_COMMIT_REF_NAME) +float_ref_branchname=$CI_COMMIT_REF_NAME if [ "$float_ref_branchname" == "main" ]; then - expected_float_ref_branch="${CI_COMMIT_REF_NAME/basop/ref}" set +x - printf "$MSG_NO_FLOAT_REF_BRANCH_FOUND" "$CI_COMMIT_REF_NAME" "$expected_float_ref_branch" + printf "$MSG_NO_FLOAT_REF_BRANCH_FOUND" "$CI_COMMIT_REF_NAME" exit 123 fi diff --git a/snippets/basop/get-float-ref-branch-name.sh b/snippets/basop/get-float-ref-branch-name.sh deleted file mode 100755 index 6ba19f93cf6d20df08ef0dcb8d7b86745d9a7345..0000000000000000000000000000000000000000 --- a/snippets/basop/get-float-ref-branch-name.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash - -# (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, -# Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., -# Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, -# Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other -# contributors to this repository. All Rights Reserved. -# -# This software is protected by copyright law and by international treaties. -# The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, -# Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., -# Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, -# Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other -# contributors to this repository retain full ownership rights in their respective contributions in -# the software. This notice grants no license of any kind, including but not limited to patent -# license, nor is any license granted by implication, estoppel or otherwise. -# -# Contributors are required to enter into the IVAS codec Public Collaboration agreement before making -# contributions. -# -# This software is provided "AS IS", without any express or implied warranties. The software is in the -# development stage. It is intended exclusively for experts who have experience with such software and -# solely for the purpose of inspection. All implied warranties of non-infringement, merchantability -# and fitness for a particular purpose are hereby disclaimed and excluded. -# -# Any dispute, controversy or claim arising under or in relation to providing this software shall be -# submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in -# accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and -# the United Nations Convention on Contracts on the International Sales of Goods. - -set -euo pipefail - -# in this snippet, always print stuff to stderr and ONLY the final echo with of branchname_out should go to stdout -exec 3>&1 # save stdout on file desc 3 -exec 1>&2 # send all stdout to stderr - -if [ $# -ne 1 ]; then - echo "Usage: $0 " - exit 1 -fi - -branchname_in="$1" -# Note: this is ivas-codec ("float") main -branchname_out="main" - -# The float ref branch is just the same name, but with basop -> ref replacement -# Replace only the first occurrence, as "basop" may be present in the later description -# If the format is correct, then before "_basop", only numbers can occur -float_ref_branchname="${branchname_in/basop/ref}" - -# now check in ivas-codec repository if a branch with this name exists -exit_code_ls_remote=0 -pushd "${SCRIPTS_DIR}" -git fetch origin -git ls-remote --exit-code --heads origin refs/heads/$float_ref_branchname || exit_code_ls_remote=$? -popd - -# If the branch exists, we use it as ref name instead of main -# NOTE: "git ls-remote --exit-code" returns 2 if the given ref was not found -if [ "$exit_code_ls_remote" -eq "0" ]; then - branchname_out="${float_ref_branchname}" -fi - -printf '%s\n' "$branchname_out" >&3 -exit 0