Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.

Correctly Sanitize git Branch and Tag Names - #8882

Merged
kj4ezj merged 3 commits into
developfrom
/zach/sanitize/branch/name
Mar 26, 2020
Merged

kj4ezj merged 3 commits into
developfrom
/zach/sanitize/branch/name

Conversation

@kj4ezj

@kj4ezj kj4ezj commented Mar 25, 2020 •

Copy link
Copy Markdown
Contributor

Change Description

This pull request fixes an edge-case where git branch names with multiple forward-slash characters (/) in the name would cause the Docker - 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 the Git Submodule Regression Check to fail. See this Stack Overflow answer for more details on valid git branch and tag name syntax.

Examples

Here are the builds where we ran into this error:

  • Build 21180 failed here with /feature/fix-spurious-ignition-failures-again as the branch name given to Buildkite
  • Build 21181 failed here with /feature/fix-spurious-ignition-failures-again-develop as the branch name given to Buildkite

You 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 21199 passed with /zach/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:

Consensus Changes

  • Consensus Changes
    None.

API Changes

  • API Changes
    None.

Documentation Additions

  • Documentation Additions
    None.

@kj4ezj
kj4ezj requested a review from scottarnette March 25, 2020 22:50
@kj4ezj
kj4ezj marked this pull request as ready for review March 25, 2020 22:58

@scottarnette scottarnette left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@kj4ezj
kj4ezj merged commit 4584bd7 into develop Mar 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants