Skip to content

Create stage-release-candidate.yml#1161

Merged
pjfanning merged 2 commits into
apache:1.4.xfrom
pjfanning:ci-1.4
Jul 13, 2026
Merged

Create stage-release-candidate.yml#1161
pjfanning merged 2 commits into
apache:1.4.xfrom
pjfanning:ci-1.4

Conversation

@pjfanning

Copy link
Copy Markdown
Member

part of releasing 1.4.0

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a new GitHub Actions workflow to automate staging Apache Pekko HTTP 1.4.0 release candidates (source artifacts to Apache dist/ATR, binary artifacts to Nexus staging, and generating a vote email template), aligning with the project’s documented release process.

Changes:

  • Introduces a workflow_dispatch workflow with toggles to stage source tarballs (SVN + ATR) and jars (Nexus).
  • Automates source tarball creation/signing and SVN/ATR staging.
  • Adds a job to generate a release vote email template by pulling context from ASF lists + GitHub.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/stage-release-candidate.yml Outdated
run: |-
sudo apt-get install graphviz

# We intentionally do not use the Coursier cache for release candiates,
REF: ${{ github.ref_name }}

- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v5.0.1
REF: ${{ github.ref_name }}

- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v5.0.1
REF: ${{ github.ref_name }}

- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v5.0.1
# reducing attack surface, but this seems to be the state of the art:
- name: Build, sign and stage artifacts
run: |-
VERSION=$(echo $REF | sed -e "s/.\(.*\)-.*/\\1/")
Comment on lines +106 to +112
export RC_VERSION=$(echo $REF | tail -c +2)
export DIR="HTTP-$RC_VERSION"

mkdir $DIR
cp ../archive/* $DIR
svn add $DIR
svn commit --username "$PEKKO_SVN_DEV_USERNAME" --password "$PEKKO_SVN_DEV_PASSWORD" --message "Stage Pekko HTTP $RC_VERSION" $DIR
Comment on lines +247 to +248
export VERSION=$(echo $REF | sed -e "s/.\(.*\)-.*/\\1/")
export RC_VERSION=$(echo $REF | tail -c +2)
Comment on lines +258 to +261
export DISCUSS=$(curl 'https://lists.apache.org/api/stats.lua?list=dev&domain=pekko.apache.org' | jq ".emails.[] | .subject, .mid" | grep -A1 "$MODULE $VERSION" | tail -1 | tr -d \")
echo "DISCUSS=$DISCUSS"
export DISCUSS_THREAD=https://lists.apache.org/thread/$(curl "https://lists.apache.org/api/thread.lua?id=$DISCUSS&find_parent=true" | jq .thread.mid | tr -d \")
echo "DISCUSS_THREAD=$DISCUSS_THREAD"
Comment on lines +263 to +267
export RELEASE_NOTES=https://github.com/apache/pekko-http/pull/$(curl https://api.github.com/repos/apache/pekko-http/pulls?state=all | jq ".[] | .title, .number" | grep -A1 "Release notes for $VERSION" | tail -1)
echo "RELEASE_NOTES=$RELEASE_NOTES"

export SENDER=$(curl "https://api.github.com/users/$ACTOR" | jq .name | tr -d \")
echo "SENDER=$SENDER"
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

@He-Pin He-Pin 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.

Reviewing line by line. The workflow structure is solid and follows the established pattern from the pekko repo. A few findings below.

echo "Trigger this workflow on an RC tag"
exit 1
fi
export VERSION=$(echo $REF | sed -e "s/\(.*\)-.*/\\1/")

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.

This sed pattern is missing the leading . that all the other jobs use. With tag v1.4.0-RC1:

# This step (line 194):
echo "v1.4.0-RC1" | sed -e "s/\(.*\)-.*/\1/"   → v1.4.0  ← keeps the v prefix

# Other jobs (lines 61, 136, 248):
echo "v1.4.0-RC1" | sed -e "s/.\(.*\)-.*/\1/"   → 1.4.0   ← correct

The "Build, sign and stage artifacts" step (line 230) uses the correct pattern, so artifacts are not mis-versioned — but this check step prints Version: v1.4.0 in the log, which is misleading when debugging. This same copy-paste bug also exists in apache/pekko line 193.

Suggest aligning with the other jobs:

export VERSION=$(echo $REF | sed -e "s/.\(.*\)-.*/\\1/")

export DISCUSS_THREAD=https://lists.apache.org/thread/$(curl "https://lists.apache.org/api/thread.lua?id=$DISCUSS&find_parent=true" | jq .thread.mid | tr -d \")
echo "DISCUSS_THREAD=$DISCUSS_THREAD"

export RELEASE_NOTES=https://github.com/apache/pekko-http/pull/$(curl https://api.github.com/repos/apache/pekko-http/pulls?state=all | jq ".[] | .title, .number" | grep -A1 "Release notes for $VERSION" | tail -1)

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 GitHub API default pagination is 30 items per page. This repo has 1000+ PRs, so if the "Release notes for $VERSION" PR isn't among the 30 most recently updated ones, this grep will fail silently and RELEASE_NOTES will be a broken URL.

Adding &per_page=100 helps but is still fragile. A more reliable approach would be the search API:

gh pr list --repo apache/pekko-http --state all \
  --search "Release notes for $VERSION in:title" \
  --json number --jq '"https://github.com/apache/pekko-http/pull/" + (.[0].number | tostring)'

Minor concern since for 1.4.0 the release-notes PR will likely be recent enough, but worth hardening before this workflow is reused for future releases.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this is a copy of a script we have in lots of places and it's been working ok - I'd prefer to keep the script as is since this PR does not target main and the improvements should go there first

The generated email is just a template, easily fixed by hand.

This CI script simply doesn't need to be bomb-proof.

@pjfanning pjfanning merged commit aed4d89 into apache:1.4.x Jul 13, 2026
10 checks passed
@pjfanning pjfanning deleted the ci-1.4 branch July 13, 2026 13:22
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