Skip to content

Commit

Permalink
scripts/promote-config: handle git submodules
Browse files Browse the repository at this point in the history
This script isn't quite doing the right thing now that we've added the
base-images repo as a submodule. We want to treat the git submodule just
like any other file; updates to it should also be promoted.

Tweak the `git reset` to make this happen. Squash a warning that
`git add -A` emits about this since it's expected.
  • Loading branch information
jlebon committed Nov 25, 2024
1 parent d18a30c commit 74cea47
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/promote-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ main() {
fi
head=$(git rev-parse HEAD)

# take all the changes from the src branch
git reset --hard "${fetch_head}"
# take all the changes from the src branch, including any submodules
git reset --hard "${fetch_head}" --recurse-submodules
git reset "${head}"

# except for manifest.yaml
Expand All @@ -40,7 +40,8 @@ main() {
# want changes in the executed tests over time for production streams
sed -E -i 's/^(\s+)((snooze:|warn:)\s+.*)/\1# \2 (disabled on promotion)/' kola-denylist.yaml

git add -A
# Add everything. If we happen to pick up a submodule, it's on purpose, so squash the warning.
git -c advice.addEmbeddedRepo=false add -A
if git diff --quiet --staged --exit-code; then
echo "nothing to promote! exiting..."
exit 0
Expand Down

0 comments on commit 74cea47

Please sign in to comment.