Commit d5cf34c3 authored by Jan Kiene's avatar Jan Kiene
Browse files

default to main as float ref always

there is no special naming convention only for parallel MRs anymore
parent a9c2a038
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -31,12 +31,18 @@
set -euxo pipefail

float_ref_branchname_in_ivas_codec="main"

# if the branch follows the naming conventions for parallel MRs and there is a branch of the same name in the float repo, set that branch as the float ref
# otherwise we default to main

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 $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME >>/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-codec main, so skip everything
if [[ "$exit_code_follows_naming_conventions" == "0" ]]; then

exit_code_companion_branch_exists=0
bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/check-float-ref-companion-branch-exists-for-porting-merge-requests.sh || exit_code_companion_branch_exists=$?

if [[ "$exit_code_follows_naming_conventions" == "0" ]] && [[ "$exit_code_companion_branch_exists" == "0" ]]; then
  float_ref_branchname_in_ivas_codec=$CI_COMMIT_REF_NAME
fi

+4 −1
Original line number Diff line number Diff line
@@ -45,10 +45,13 @@ 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_COMMIT_REF_NAME
cd $SCRIPTS_DIR

pushd $SCRIPTS_DIR
git fetch origin
exit_code_ls_remote=0
git ls-remote --exit-code --heads origin refs/heads/$float_ref_branchname || exit_code_ls_remote=$?
popd

if [ "$exit_code_ls_remote" != "0" ]; then
  set +x
  printf "$MSG_NO_FLOAT_REF_BRANCH_FOUND" "$CI_COMMIT_REF_NAME"