Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CI changelog checking script to ignore unstable components #1342

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading