salt-bootstrap icon indicating copy to clipboard operation
salt-bootstrap copied to clipboard

Git installs are broken for many SHA ids

Open max-arnold opened this issue 3 years ago • 1 comments

Description of Issue/Question

curl -L https://bootstrap.saltproject.io | sudo sh -s -- -M -P -x python3 -f -D git 2c5865a15ca4c7bf57b24135771e69f401d67c9d

 * DEBUG: Installed git version: 2.25.1
 *  INFO: Forced shallow cloning of git repository.
 *  INFO: Attempting to shallow clone v2c5865a15ca4c7bf57b24135771e69f401d67c9d from Salt's repository https://github.com/saltstack/salt.git
Cloning into 'salt'...
warning: Could not find remote branch v2c5865a15ca4c7bf57b24135771e69f401d67c9d to clone.
fatal: Remote branch v2c5865a15ca4c7bf57b24135771e69f401d67c9d not found in upstream origin
 *  WARN: Failed to shallow clone.
 *  INFO: Resuming regular git clone and remote SaltStack repository addition procedure
Cloning into 'salt'...
 * DEBUG: Checking out v2c5865a15ca4c7bf57b24135771e69f401d67c9d
error: pathspec 'v2c5865a15ca4c7bf57b24135771e69f401d67c9d' did not match any file(s) known to git
 * ERROR: Failed to run install_ubuntu_git_deps()!!!
 * DEBUG: Cleaning up the Salt Temporary Git Repository
 * DEBUG: Removing the logging pipe /tmp/bootstrap-salt.logpipe
 * DEBUG: Removing the temporary apt error file /tmp/apt_error.lZh0GC
 * DEBUG: Killing logging pipe tee's with pid(s): 21784

This is happening because of too broad regular expression that matches many SHAs and adds the v prefix to them

echo "2c5865a15ca4c7bf57b24135771e69f401d67c9d" | sed 's/^.*\(v\?3[[:digit:]]\{3\}\(\.[[:digit:]]\{1,2\}\)\?\).*$/MATCH/'
MATCH

https://github.com/saltstack/salt-bootstrap/blob/develop/bootstrap-salt.sh#L1859-L1883

Cc: @s0undt3ch

P.S. Found this while trying to bisect the master branch and using salt-bootstrap.sh to install Salt in Vagrant Ubuntu 20.04 box

max-arnold avatar May 22 '22 10:05 max-arnold

/CC @krionbsd

s0undt3ch avatar May 23 '22 10:05 s0undt3ch