<NME> update_dep.sh
<BEF> #!/bin/bash

############################################################################
# What is this script?
#
# Chef uses a workflow tool called Expeditor to manage version bumps, changelogs
# and releases. When a dependency of chef is released, expeditor is triggered
# against this repository to run this script. It bumps our gem lock files and opens
# a PR. That way humans can do hard work and bots can open gem bump PRs.
############################################################################

set -evx

REPONAME=$(echo $EXPEDITOR_REPO | cut -d '/' -f 2)
git checkout -b "$branch"

bundle install
bundle exec rake dependencies:update

git add .
  bundle lock --update
  new_gem_included && break || sleep 20
  if [ $i -eq $tries ]; then
    echo "Searching for '${DEPNAME} (${EXPEDITOR_VERSION})' ${i} times and did not find it"
    exit 1
  else
    echo "Searched ${i} times for '${DEPNAME} (${EXPEDITOR_VERSION})'"
  fi
done

git add .

# give a friendly message for the commit and make sure it's noted for any future audit of our codebase that no
# DCO sign-off is needed for this sort of PR since it contains no intellectual property
git commit --message "Bump $DEPNAME to $EXPEDITOR_VERSION" --message "This pull request was triggered automatically via Expeditor when $DEPNAME $EXPEDITOR_VERSION was promoted to Rubygems." --message "This change falls under the obvious fix policy so no Developer Certificate of Origin (DCO) sign-off is required."

open_pull_request "$EXPEDITOR_BRANCH"

# Get back to main and cleanup the leftovers - any changed files left over at the end of this script will get committed to main.
git checkout -
git branch -D "$branch"

<MSG> Add a 120 second sleep to the dependency bumping

See if waiting 2 minutes gives rubygems time to catch up.

Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>

<DFF> @@ -15,6 +15,11 @@ branch="expeditor/${GEM_NAME}_${VERSION}"
 git checkout -b "$branch"
 
 bundle install
+
+# it appears that the gem that triggers this script fires off this script before
+# the gem is actually available via bundler on rubygems.org.
+sleep 120
+
 bundle exec rake dependencies:update
 
 git add .

{'addition_count': 5, 'commit_subject': 'Add a 120 second sleep to the dependency bumping', 'deletion_count': 0, 'file_extension': '.sh', 'lang': 'expeditor/update_dep', 'license': 'apache-2.0', 'repo_name': 'chef/chef'}