Skip to content

Commit

Permalink
Update CI changelog checking script to ignore unstable components
Browse files Browse the repository at this point in the history
  • Loading branch information
jasagredo committed Dec 10, 2024
1 parent 24e48cc commit b8386a4
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions scripts/ci/check-changelogs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
# - BASE_REF: what to compare this branch against

packages=(ouroboros-consensus ouroboros-consensus-diffusion ouroboros-consensus-protocol ouroboros-consensus-cardano sop-extras strict-sop-core)
tracked_libs=(ouroboros-consensus/src/ouroboros-consensus
ouroboros-consensus-diffusion/src/ouroboros-consensus-diffusion
ouroboros-consensus-protocol/src/ouroboros-consensus-protocol
ouroboros-consensus-cardano/src/shelley
ouroboros-consensus-cardano/src/byron
ouroboros-consensus-cardano/src/ouroboros-consensus-cardano
sop-extras
strict-sop-core)

ok=1

Expand All @@ -24,20 +32,34 @@ if [ "${NO_CHANGELOG_LABEL}" = "true" ] || [ "${RELEASE_LABEL}" = "true" ]; then
echo "Label set: No new changelog fragments expected"
else
echo "Checking for new changelog fragments:"
for p in "${packages[@]}"; do
for p in "${tracked_libs[@]}"; do
printf "\t- %s\n" "$p"
if ! git diff --quiet --name-only "origin/${BASE_REF}" -- "$p/***.hs"|| ! git diff --quiet --name-only "origin/${BASE_REF}" -- "$p/***.cabal"; then
if ! git diff --quiet --name-only "origin/${BASE_REF}" -- "$p/***.hs"; then
if ! git diff --quiet --name-only --diff-filter=A "origin/${BASE_REF}" -- "$p/changelog.d" ; then
printf "\t\tNew fragments found. OK.\n"
git diff --name-only --diff-filter=A "origin/${BASE_REF}" -- "$p/changelog.d" | sed 's/^/\t\t- /g'
else
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"
git --no-pager -c color.diff=always diff "origin/${BASE_REF}" -- "$p/***.hs" | sed 's/^/diff> /g'
ok=0
fi
else
printf "\t\tNo haskell code changes\n"
fi
done
for p in "${packages[@]}"; do
printf "\t- %s\n" "$p"
if ! git diff --quiet --name-only "origin/${BASE_REF}" -- "$p/***.cabal"; then
if ! git diff --quiet --name-only --diff-filter=A "origin/${BASE_REF}" -- "$p/changelog.d" ; then
printf "\t\tNew fragments found. OK.\n"
git diff --name-only --diff-filter=A "origin/${BASE_REF}" -- "$p/changelog.d" | sed 's/^/\t\t- /g'
else
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"
git --no-pager -c color.diff=always diff "origin/${BASE_REF}" -- "$p/***.cabal" | sed 's/^/diff> /g'
ok=0
fi
else
printf "\t\tNo haskell/cabal code changes\n"
printf "\t\tNo cabal code changes\n"
fi
done
fi
Expand Down

0 comments on commit b8386a4

Please sign in to comment.