-
Bug
-
Resolution: Done
-
Undefined
-
None
-
None
Description of problem:
Because common.sh is sourced before git is installed, function get_build_branch() works incorrectly by falling back to `main` which can break presubmits on release-4.Y branches. Notice empty result of: `local -r cur_branch="$(git branch --show-current 2>/dev/null)"` +++ 13:18:47.246463813 microshift/test/bin/common.sh:186 get_build_branch ++++ 13:18:47.248178026 microshift/test/bin/common.sh:158 awk '{print $NF}' ++++ 13:18:47.248319570 microshift/test/bin/common.sh:158 awk -F. '{print $1"."$2}' +++++ 13:18:47.248464529 microshift/test/bin/common.sh:158 uname -m ++++ 13:18:47.250387050 microshift/test/bin/common.sh:158 grep '^OCP_VERSION' /home/ec2-user/microshift/Makefile.version.x86_64.var +++ 13:18:47.253051431 microshift/test/bin/common.sh:158 local -r ocp_ver=4.15 ++++ 13:18:47.254395656 microshift/test/bin/common.sh:159 git branch --show-current +++ 13:18:47.256099263 microshift/test/bin/common.sh:159 local -r cur_branch= ++++ 13:18:47.257465453 microshift/test/bin/common.sh:162 git rev-parse main +++ 13:18:47.259158102 microshift/test/bin/common.sh:162 local -r main_top= ++++ 13:18:47.260534195 microshift/test/bin/common.sh:163 git merge-base '' main +++ 13:18:47.262208582 microshift/test/bin/common.sh:163 local -r main_base= +++ 13:18:47.263269483 microshift/test/bin/common.sh:164 '[' '' = '' ']' +++ 13:18:47.264378259 microshift/test/bin/common.sh:165 echo main +++ 13:18:47.265496822 microshift/test/bin/common.sh:166 return ++ 13:18:47.266732813 microshift/test/bin/common.sh:186 SCENARIO_BUILD_BRANCH=main
Version-Release number of selected component (if applicable):
How reproducible:
Steps to Reproduce:
1. 2. 3.
Actual results:
Expected results:
Additional info:
- clones
-
USHIFT-2046 CI: common.sh is sourced before dependencies (git) are installed [main]
- Closed
- links to