cekit / behave-test-steps

MIT License
0 stars 22 forks source link

s2i steps default to git ref "master", but not all git repositories have a master branch #49

Open jmtd opened 11 months ago

jmtd commented 11 months ago

In the absence of an explicit ref in the step "Given s2i build...", i.e., Given s2i build https://...somerepo.../ with no using branchname suffix, the S2I steps will default to try to check out a branch named master, which may not exist in the repository.

Instead I think it should use the repository's default branch name.

We hit this (side issue) by introducing a new repository for cekit/behave tests, https://github.com/jboss-container-images/openjdk-test-applications, which has the default branch name main. This is the new default, I think, for both Git and Github. (At the time of writing this, I'm about to push a master branch to that repository as a temporary mitigation).

The culprits are https://github.com/cekit/behave-test-steps/blob/e92a2391d866ee74a733cbc8bbb203dbbe452655/steps/s2i_steps.py#L14 and https://github.com/cekit/behave-test-steps/blob/e92a2391d866ee74a733cbc8bbb203dbbe452655/steps/s2i_steps.py#L59 and possibly a few other places.