This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
Correctly Sanitize git Branch and Tag Names #8885
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Change Description
This pull request fixes an edge-case where
git
branch names with multiple forward-slash characters (/
) in the name would cause theDocker - Build and Install
step in Buildkite to fail because the code which sanitizes the branch name before using it in a docker image tag only replaced the first occurrence.I have fixed this by replacing all forward-slash characters with underscore characters, instead of just the first one. I have also dropped any forward-slash which appears at the beginning of a branch name, as this is meaningless and it causes the
git checkout
in theGit Submodule Regression Check
to fail. See this Stack Overflow answer for more details on validgit
branch and tag name syntax.Examples
Here are the builds where we ran into this error:
/feature/fix-spurious-ignition-failures-again
as the branch name given to Buildkite/feature/fix-spurious-ignition-failures-again-develop
as the branch name given to BuildkiteYou can see I intentionally created this pull request with a branch name containing a leading forward-slash, and several more in the middle of the name. Build 21212 passed with
/zach/1.8/sanitize/branch/name
as the branch name given to Buildkite.See Also
This set of pull requests all make the same bug fix to different versions of EOSIO:
eos:develop
eos:release/2.0.x
eos:release/1.8.x
Consensus Changes
None.
API Changes
None.
Documentation Additions
None.