Skip to content

[CALCITE-5584] Publish website action only triggers for the last commit in the chain - #5136

Open
rubenada wants to merge 2 commits into
apache:mainfrom
rubenada:CALCITE-5584
Open

[CALCITE-5584] Publish website action only triggers for the last commit in the chain#5136
rubenada wants to merge 2 commits into
apache:mainfrom
rubenada:CALCITE-5584

Conversation

@rubenada

Copy link
Copy Markdown
Contributor

Jira Link

CALCITE-5584

Changes Proposed

Adjust publish-non-release-website-updates.yml to be able to process up to 20 commits (limit of github.event.commits); that should be enough for Calcite, where normally only one or a few commits land together.

@xuzifu666 xuzifu666 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zabetak zabetak left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for picking this up @rubenada ! I assume that you did all necessary testing on your private fork is that correct?

git status | sed -n 's/deleted by us://p' | xargs git add
git cherry-pick --continue --no-edit

# github.event.commits is capped at 20 entries. Warn loudly if we hit

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there some documentation around the 20 entries limit? I was looking at https://docs.github.com/en/webhooks/webhook-events-and-payloads#push and there it says that commits array contains at most 2048 entries.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right! I should've double checked that. It seems that 20 was an old cap, and nowadays is 2048 (i.e. virtually no limit for our purpose). I'll remove this check and warning.

Comment on lines 48 to 50
if [ "$(echo "$COMMITS" | jq 'length')" -ge 20 ]; then
echo "::warning::Push contains 20+ commits — github.event.commits may be truncated; some commits may not be cherry-picked."
fi

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have an example of how this looks?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block is actually unnecessary (see comment above), so it'll go away.

echo "Cherry-picking commit: $commit_sha"
echo "----------------------------------------"

if ! git cherry-pick --strategy=recursive -X theirs "$commit_sha"; then

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The if condition is slightly different than before. Did you test the action with cherry-pick conflicts to ensure it works?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that in the old code, the "if" block was actually never reachable, because github runs the command transparently with -e , so if the cherry-pick failed, the action was aborted and the "if" was never reached.
IIANM, inserting the command directly on the "if" condition will achieve the intended purpose.

@sonarqubecloud

sonarqubecloud Bot commented Aug 6, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants