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

Correctly Sanitize git Branch and Tag Names #8884

Merged
merged 3 commits into from Mar 26, 2020

Conversation

kj4ezj
Copy link
Contributor

@kj4ezj kj4ezj commented Mar 25, 2020

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 21211 passed with /zach/2.0/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.

Copy link
Contributor

@scottarnette scottarnette left a comment

Choose a reason for hiding this comment

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

👍

@kj4ezj kj4ezj merged commit 58fe9c1 into release/2.0.x 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.

None yet

2 participants