Skip to content

Add pre-release prerequisite checks to perform-release.sh#11024

Draft
jbachorik wants to merge 5 commits intomasterfrom
jb/release_script_checks
Draft

Add pre-release prerequisite checks to perform-release.sh#11024
jbachorik wants to merge 5 commits intomasterfrom
jb/release_script_checks

Conversation

@jbachorik
Copy link
Copy Markdown
Contributor

What Does This Do

Adds automated pre-release prerequisite checks to tooling/perform-release.sh that validate the environment and repository state before creating a release tag:

  • GitHub CLI availability, authentication, and push permissions
  • Release tag does not already exist locally or remotely
  • Open GitHub milestone exists for the release version with no open issues/PRs
  • All closed PRs in the milestone carry required labels (comp:/inst: + type:, or tag: no release note)
  • GPG signing key is configured and available
  • For minor releases: prompts for manual dashboard verification acknowledgment

Motivation

Previously the release script had minimal pre-flight checks, allowing a release to fail partway through (e.g. missing permissions, duplicate tag, unsigned tag). These checks catch problems early, before the irreversible tag-and-push step.

Additional Notes

The confirmOrAbort function was refactored to accept a custom prompt parameter, enabling context-specific confirmation messages throughout the script.

Contributor Checklist

Jira ticket: [PROJ-IDENT]

Note: Once your PR is ready to merge, add it to the merge queue by commenting /merge. /merge -c cancels the queue request. /merge -f --reason "reason" skips all merge queue checks; please use this judiciously, as some checks do not run at the PR-level. For more information, see this doc.

jbachorik and others added 2 commits April 1, 2026 16:17
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jbachorik jbachorik added type: enhancement Enhancements and improvements tag: no release notes Changes to exclude from release notes comp: tooling Build & Tooling labels Apr 1, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@PerfectSlayer PerfectSlayer left a comment

Choose a reason for hiding this comment

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

That's a lot of change for a script that was supposed to set and push a tag 😓
I would stick with the step that can make the tag and follow up actions failed, ie

  • verify the user is part of the releaser (otherwise it creates a local tag)
  • verify the milestone for the release exists (otherwise the changelog generation will fail).

Some other parts are wrong or duplicate of the existing GH workflows.

Comment on lines +114 to +117
if git rev-parse "refs/tags/$NEXT_RELEASE_VERSION" &>/dev/null; then
echo "❌ Tag '$NEXT_RELEASE_VERSION' already exists locally. Has this release already been tagged?"
exit 1
fi
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

❔ question: ‏How is that even possible according how the next version tag is computed?

Comment on lines +118 to +121
if git ls-remote --tags "$REMOTE" "refs/tags/$NEXT_RELEASE_VERSION" | grep -q .; then
echo "❌ Tag '$NEXT_RELEASE_VERSION' already exists on remote '$REMOTE'. Has this release already been tagged?"
exit 1
fi
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

❔ question: ‏Same question. Tags are fetch just above

Comment on lines +145 to +162
# Check that the milestone has no open issues or PRs
if ! OPEN_ISSUES=$(gh api "repos/{owner}/{repo}/milestones/$MILESTONE_NUMBER" \
--jq ".open_issues"); then
echo "❌ Failed to query milestone '$MILESTONE_TITLE'. Check your network connection."
exit 1
fi
if [ -z "$OPEN_ISSUES" ] || ! [[ "$OPEN_ISSUES" =~ ^[0-9]+$ ]]; then
echo "❌ Unexpected response when querying open issue count for milestone '$MILESTONE_TITLE': '$OPEN_ISSUES'."
exit 1
fi
if [ "$OPEN_ISSUES" -gt 0 ]; then
echo "❌ Milestone '$MILESTONE_TITLE' still has $OPEN_ISSUES open issue(s) or PR(s):"
gh api "repos/{owner}/{repo}/issues?milestone=$MILESTONE_NUMBER&state=open&per_page=100" \
--jq '.[] | " #\(.number) \(.title)"' || true
echo " All PRs must be merged before tagging a release."
exit 1
fi
echo "✅ All issues and PRs in milestone '$MILESTONE_TITLE' are closed."
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔨 issue: ‏This is wrong. This is expected to have open issue on milestone.

Comment on lines +164 to +165
# Check that all closed PRs in the milestone carry the required labels.
# Required: (comp:* or inst:*) AND (type:*), OR 'tag: no release notes'.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

❔ question: ‏What's the point? It's a duplicate of the PR checks workflow.

echo " Only release owners are allowed to push release tags."
exit 1
fi
echo "✅ GitHub CLI authenticated with push permission."
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 suggestion: This should check the fact that you're part of the release owner teams.
Otherwise, the release must be done by a release owner.

jbachorik and others added 2 commits April 1, 2026 18:57
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: tooling Build & Tooling tag: no release notes Changes to exclude from release notes type: enhancement Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants