Skip to content

Commit c0564af

Browse files
authored
Update CI changelog checking script to ignore unstable components (#1342)
With this update to the script it should not be necessary to push a changelog fragment nor set the label whenever a change to `unstable-*` components is made.
2 parents 24e48cc + b8386a4 commit c0564af

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

scripts/ci/check-changelogs.sh

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55
# - BASE_REF: what to compare this branch against
66

77
packages=(ouroboros-consensus ouroboros-consensus-diffusion ouroboros-consensus-protocol ouroboros-consensus-cardano sop-extras strict-sop-core)
8+
tracked_libs=(ouroboros-consensus/src/ouroboros-consensus
9+
ouroboros-consensus-diffusion/src/ouroboros-consensus-diffusion
10+
ouroboros-consensus-protocol/src/ouroboros-consensus-protocol
11+
ouroboros-consensus-cardano/src/shelley
12+
ouroboros-consensus-cardano/src/byron
13+
ouroboros-consensus-cardano/src/ouroboros-consensus-cardano
14+
sop-extras
15+
strict-sop-core)
816

917
ok=1
1018

@@ -24,20 +32,34 @@ if [ "${NO_CHANGELOG_LABEL}" = "true" ] || [ "${RELEASE_LABEL}" = "true" ]; then
2432
echo "Label set: No new changelog fragments expected"
2533
else
2634
echo "Checking for new changelog fragments:"
27-
for p in "${packages[@]}"; do
35+
for p in "${tracked_libs[@]}"; do
2836
printf "\t- %s\n" "$p"
29-
if ! git diff --quiet --name-only "origin/${BASE_REF}" -- "$p/***.hs"|| ! git diff --quiet --name-only "origin/${BASE_REF}" -- "$p/***.cabal"; then
37+
if ! git diff --quiet --name-only "origin/${BASE_REF}" -- "$p/***.hs"; then
3038
if ! git diff --quiet --name-only --diff-filter=A "origin/${BASE_REF}" -- "$p/changelog.d" ; then
3139
printf "\t\tNew fragments found. OK.\n"
3240
git diff --name-only --diff-filter=A "origin/${BASE_REF}" -- "$p/changelog.d" | sed 's/^/\t\t- /g'
3341
else
3442
printf "\t\tNo new fragments found, but code changed. Please push a fragment or add the \"no changelog\" label to the PR. The diff follows:\n"
3543
git --no-pager -c color.diff=always diff "origin/${BASE_REF}" -- "$p/***.hs" | sed 's/^/diff> /g'
44+
ok=0
45+
fi
46+
else
47+
printf "\t\tNo haskell code changes\n"
48+
fi
49+
done
50+
for p in "${packages[@]}"; do
51+
printf "\t- %s\n" "$p"
52+
if ! git diff --quiet --name-only "origin/${BASE_REF}" -- "$p/***.cabal"; then
53+
if ! git diff --quiet --name-only --diff-filter=A "origin/${BASE_REF}" -- "$p/changelog.d" ; then
54+
printf "\t\tNew fragments found. OK.\n"
55+
git diff --name-only --diff-filter=A "origin/${BASE_REF}" -- "$p/changelog.d" | sed 's/^/\t\t- /g'
56+
else
57+
printf "\t\tNo new fragments found, but code changed. Please push a fragment or add the \"no changelog\" label to the PR. The diff follows:\n"
3658
git --no-pager -c color.diff=always diff "origin/${BASE_REF}" -- "$p/***.cabal" | sed 's/^/diff> /g'
3759
ok=0
3860
fi
3961
else
40-
printf "\t\tNo haskell/cabal code changes\n"
62+
printf "\t\tNo cabal code changes\n"
4163
fi
4264
done
4365
fi

0 commit comments

Comments
 (0)