Loading snippets/basop/branch-is-up-to-date-with-target-pre.sh +10 −1 Original line number Diff line number Diff line Loading @@ -28,10 +28,19 @@ # 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. float_ref_branchname="ivas-float-update" exit_code_follows_naming_conventions=0 # if branch does not follow the convention, there will be a printout which is irrelevant here, so redirect it to null bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/branch-follows-porting-naming-convention.sh $branchname_in >>/dev/null || exit_code_follows_naming_conventions=$? # 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-float-update, so skip everything if [[ "exit_code_follows_naming_conventions" == "0" ]]; then float_ref_branchname=$(${CI_PROJECT_DIR}/ivas-codec-ci/snippets/basop/get-float-ref-branch-name.sh $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME) fi # fetch all needed branches git fetch origin "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" git fetch origin ivas-float-update float_ref_branchname=$(${CI_PROJECT_DIR}/ivas-codec-ci/snippets/basop/get-float-ref-branch-name.sh $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME) git fetch origin "$float_ref_branchname" # then check if we are behind the merge target Loading snippets/basop/get-float-ref-branch-name.sh +9 −15 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ # the United Nations Convention on Contracts on the International Sales of Goods. # NOTE: this does not check e.g. for float_ref_branchname actually existing and will silently return ivas-float-update if not # Use branch-follows-porting-naming-convention.sh for that if [ $# -ne 1 ]; then echo "Usage: $0 <branchname>" Loading @@ -38,12 +39,6 @@ fi branchname_in="$1" branchname_out="ivas-float-update" exit_code=0 bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/branch-follows-porting-naming-convention.sh || exit_code=$? # 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-float-update, so skip everything if [[ "exit_code" == "0" ]]; then # 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 Loading @@ -54,7 +49,6 @@ if [[ "exit_code" == "0" ]]; then if [[ "$git_result" =~ "$float_ref_branchname" ]]; then branchname_out="${float_ref_branchname}" fi fi echo "$branchname_out" exit 0 Loading
snippets/basop/branch-is-up-to-date-with-target-pre.sh +10 −1 Original line number Diff line number Diff line Loading @@ -28,10 +28,19 @@ # 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. float_ref_branchname="ivas-float-update" exit_code_follows_naming_conventions=0 # if branch does not follow the convention, there will be a printout which is irrelevant here, so redirect it to null bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/branch-follows-porting-naming-convention.sh $branchname_in >>/dev/null || exit_code_follows_naming_conventions=$? # 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-float-update, so skip everything if [[ "exit_code_follows_naming_conventions" == "0" ]]; then float_ref_branchname=$(${CI_PROJECT_DIR}/ivas-codec-ci/snippets/basop/get-float-ref-branch-name.sh $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME) fi # fetch all needed branches git fetch origin "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" git fetch origin ivas-float-update float_ref_branchname=$(${CI_PROJECT_DIR}/ivas-codec-ci/snippets/basop/get-float-ref-branch-name.sh $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME) git fetch origin "$float_ref_branchname" # then check if we are behind the merge target Loading
snippets/basop/get-float-ref-branch-name.sh +9 −15 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ # the United Nations Convention on Contracts on the International Sales of Goods. # NOTE: this does not check e.g. for float_ref_branchname actually existing and will silently return ivas-float-update if not # Use branch-follows-porting-naming-convention.sh for that if [ $# -ne 1 ]; then echo "Usage: $0 <branchname>" Loading @@ -38,12 +39,6 @@ fi branchname_in="$1" branchname_out="ivas-float-update" exit_code=0 bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/branch-follows-porting-naming-convention.sh || exit_code=$? # 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-float-update, so skip everything if [[ "exit_code" == "0" ]]; then # 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 Loading @@ -54,7 +49,6 @@ if [[ "exit_code" == "0" ]]; then if [[ "$git_result" =~ "$float_ref_branchname" ]]; then branchname_out="${float_ref_branchname}" fi fi echo "$branchname_out" exit 0