-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Improve validation in Release: Build ZIP file
workflow
#60262
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
Conversation
Testing GuidelinesHi @albarin @woocommerce/flux, Apart from reviewing the code changes, please make sure to review the testing instructions (Guide) and verify that relevant tests (E2E, Unit, Integration, etc.) have been added or updated as needed. Reminder: PR reviewers are required to document testing performed. This includes:
|
📝 WalkthroughWalkthroughThe release workflow for building ZIP files was refactored: verification jobs were consolidated into a single job with simplified shell-based checks, stricter branch requirements, and additional validations. Documentation was updated to reflect the new process, and the release code freeze workflow was slightly modified to stop clearing release notes during editing. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant GitHub Actions
participant GH CLI
participant GitHub API
User->>GitHub Actions: Trigger "Release: Build ZIP file" workflow (from trunk)
GitHub Actions->>GH CLI: Run verification shell scripts
GH CLI->>GitHub API: Check for open PRs by bot, against release branch, with milestone
GH CLI->>GitHub API: Check if release already exists
GitHub Actions-->>User: Fail workflow if any check fails
GitHub Actions->>GitHub Actions: Build ZIP file (if verification passes)
GitHub Actions->>GitHub API: Create GitHub release with version as notes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15–25 minutes Possibly related PRs
Note 🔌 MCP (Model Context Protocol) integration is now available in Early Access!Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context. ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (1)
docs/contribution/releases/building-and-publishing.md (1)
33-35
: Explicitly call out that verification must not be skippedThe workflow now blocks a run when
create_github_release = true
andskip_verify = true
, but the docs omit this. Please add a bullet (e.g. “Leave ‘Skip verification steps’ unchecked”) so operators don’t hit a confusing, preventable failure.
📜 Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/workflows/release-build-zip-file.yml
(7 hunks).github/workflows/release-code-freeze.yml
(0 hunks)docs/contribution/releases/building-and-publishing.md
(1 hunks)
💤 Files with no reviewable changes (1)
- .github/workflows/release-code-freeze.yml
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: prettyboymp
PR: woocommerce/woocommerce#59048
File: .github/workflows/cherry-pick-milestoned-prs.yml:118-131
Timestamp: 2025-07-11T13:05:08.440Z
Learning: In GitHub Actions workflows, when reviewing steps that access event data like `github.event.pull_request.milestone`, check the entire job dependency chain and conditional logic. If upstream jobs already validate the data exists (like checking `github.event.pull_request.milestone != null` in a prerequisite job), then downstream jobs don't need redundant null-checks since the data is guaranteed to exist by that point.
Learnt from: CR
PR: woocommerce/woocommerce#0
File: .cursor/rules/generate-pr-description.mdc:0-0
Timestamp: 2025-07-21T05:22:46.426Z
Learning: Provide clear, step-by-step instructions for how to test the changes in the PR description.
Learnt from: jorgeatorres
PR: woocommerce/woocommerce#60250
File: .github/workflows/release-compile-changelog.yml:165-166
Timestamp: 2025-08-07T10:34:27.702Z
Learning: In WooCommerce release workflows, the VERSION variable used in changelog generation comes from the `validate-selected-branch-version` step, which extracts the version from `plugins/woocommerce/woocommerce.php` using `grep -oP '(?<=Version: )(.+)'` and validates it matches the input version. This ensures the version is always in the correct format by the time it reaches the changelog generation step, making additional error handling for version format validation unnecessary.
Learnt from: CR
PR: woocommerce/woocommerce#0
File: .cursor/rules/generate-pr-description.mdc:0-0
Timestamp: 2025-07-21T05:22:46.426Z
Learning: Applies to .github/PULL_REQUEST_TEMPLATE.md : Preserve required markdown sections in the PR description, especially those used by automation (e.g., changelog entry details and comments). Do not remove or alter them.
Learnt from: CR
PR: woocommerce/woocommerce#0
File: .cursor/rules/git.mdc:0-0
Timestamp: 2025-07-18T14:54:55.592Z
Learning: Branch names should follow the structure: 'release/{version}' for release branches.
📚 Learning: 2025-08-07T10:34:27.702Z
Learnt from: jorgeatorres
PR: woocommerce/woocommerce#60250
File: .github/workflows/release-compile-changelog.yml:165-166
Timestamp: 2025-08-07T10:34:27.702Z
Learning: In WooCommerce release workflows, the VERSION variable used in changelog generation comes from the `validate-selected-branch-version` step, which extracts the version from `plugins/woocommerce/woocommerce.php` using `grep -oP '(?<=Version: )(.+)'` and validates it matches the input version. This ensures the version is always in the correct format by the time it reaches the changelog generation step, making additional error handling for version format validation unnecessary.
Applied to files:
docs/contribution/releases/building-and-publishing.md
.github/workflows/release-build-zip-file.yml
📚 Learning: 2025-07-23T19:42:10.564Z
Learnt from: jorgeatorres
PR: woocommerce/woocommerce#59946
File: .github/workflows/release-code-freeze.yml:108-124
Timestamp: 2025-07-23T19:42:10.564Z
Learning: WooCommerce trunk versions follow the pattern `X.Y.0-dev` where the patch version is always `0`. This means when calculating release branches, string operations like `slice(0, -2)` on the version after removing `-dev` will always work correctly since the input format is predictable (e.g., `10.2.0` → `10.2`).
Applied to files:
docs/contribution/releases/building-and-publishing.md
📚 Learning: 2025-07-15T15:39:21.856Z
Learnt from: jorgeatorres
PR: woocommerce/woocommerce#59675
File: .github/workflows/release-bump-as-requirement.yml:48-65
Timestamp: 2025-07-15T15:39:21.856Z
Learning: In WooCommerce core repository, changelog entries for all PRs live in `plugins/woocommerce/changelog/` directory and are processed during releases, not at the repository root level.
Applied to files:
docs/contribution/releases/building-and-publishing.md
📚 Learning: 2025-06-26T12:45:40.709Z
Learnt from: prettyboymp
PR: woocommerce/woocommerce#59048
File: .github/workflows/cherry-pick-milestoned-prs.yml:60-83
Timestamp: 2025-06-26T12:45:40.709Z
Learning: WooCommerce uses WordPress versioning conventions where minor versions in X.Y.Z format are constrained to 0-9 (Y cannot exceed 9). This means version increment logic should reset minor to 0 and increment major when minor reaches 9, rather than allowing two-digit minor versions like 9.10 or 9.11.
Applied to files:
docs/contribution/releases/building-and-publishing.md
📚 Learning: 2025-07-11T13:05:08.440Z
Learnt from: prettyboymp
PR: woocommerce/woocommerce#59048
File: .github/workflows/cherry-pick-milestoned-prs.yml:118-131
Timestamp: 2025-07-11T13:05:08.440Z
Learning: In GitHub Actions workflows, when reviewing steps that access event data like `github.event.pull_request.milestone`, check the entire job dependency chain and conditional logic. If upstream jobs already validate the data exists (like checking `github.event.pull_request.milestone != null` in a prerequisite job), then downstream jobs don't need redundant null-checks since the data is guaranteed to exist by that point.
Applied to files:
.github/workflows/release-build-zip-file.yml
📚 Learning: 2025-07-21T05:22:46.426Z
Learnt from: CR
PR: woocommerce/woocommerce#0
File: .cursor/rules/generate-pr-description.mdc:0-0
Timestamp: 2025-07-21T05:22:46.426Z
Learning: Applies to .github/PULL_REQUEST_TEMPLATE.md : Preserve required markdown sections in the PR description, especially those used by automation (e.g., changelog entry details and comments). Do not remove or alter them.
Applied to files:
.github/workflows/release-build-zip-file.yml
📚 Learning: 2025-07-18T14:54:55.592Z
Learnt from: CR
PR: woocommerce/woocommerce#0
File: .cursor/rules/git.mdc:0-0
Timestamp: 2025-07-18T14:54:55.592Z
Learning: Branch names should follow the structure: 'release/{version}' for release branches.
Applied to files:
.github/workflows/release-build-zip-file.yml
🪛 actionlint (1.7.7)
.github/workflows/release-build-zip-file.yml
23-23: input "branch" of workflow_call event has the default value "", but it is also required. if an input is marked as required, its default value will never be used
(events)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (2)
.github/workflows/release-build-zip-file.yml (2)
23-25
:skip_verify
input still inconsistent across triggers
workflow_call
now has a sensibledefault: false
, but theworkflow_dispatch
section (Lines 8-11) still marks the same inputrequired: true
with no default. Align both blocks to avoid confusing users who trigger the workflow from the UI.
125-130
: Search still uses full ref – verification can silently pass
$BRANCH
containsrefs/heads/...
; thebase:
qualifier expects just the branch name, so open PRs against the release branch won’t be detected. Re-usebranch_name
extracted above.
📜 Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/release-build-zip-file.yml
(7 hunks)
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: prettyboymp
PR: woocommerce/woocommerce#59048
File: .github/workflows/cherry-pick-milestoned-prs.yml:118-131
Timestamp: 2025-07-11T13:05:08.440Z
Learning: In GitHub Actions workflows, when reviewing steps that access event data like `github.event.pull_request.milestone`, check the entire job dependency chain and conditional logic. If upstream jobs already validate the data exists (like checking `github.event.pull_request.milestone != null` in a prerequisite job), then downstream jobs don't need redundant null-checks since the data is guaranteed to exist by that point.
Learnt from: CR
PR: woocommerce/woocommerce#0
File: .cursor/rules/generate-pr-description.mdc:0-0
Timestamp: 2025-07-21T05:22:46.426Z
Learning: Provide clear, step-by-step instructions for how to test the changes in the PR description.
Learnt from: jorgeatorres
PR: woocommerce/woocommerce#60250
File: .github/workflows/release-compile-changelog.yml:165-166
Timestamp: 2025-08-07T10:34:27.702Z
Learning: In WooCommerce release workflows, the VERSION variable used in changelog generation comes from the `validate-selected-branch-version` step, which extracts the version from `plugins/woocommerce/woocommerce.php` using `grep -oP '(?<=Version: )(.+)'` and validates it matches the input version. This ensures the version is always in the correct format by the time it reaches the changelog generation step, making additional error handling for version format validation unnecessary.
Learnt from: CR
PR: woocommerce/woocommerce#0
File: .cursor/rules/generate-pr-description.mdc:0-0
Timestamp: 2025-07-21T05:22:46.426Z
Learning: Applies to .github/PULL_REQUEST_TEMPLATE.md : Preserve required markdown sections in the PR description, especially those used by automation (e.g., changelog entry details and comments). Do not remove or alter them.
Learnt from: CR
PR: woocommerce/woocommerce#0
File: .cursor/rules/git.mdc:0-0
Timestamp: 2025-07-18T14:54:55.592Z
Learning: Branch names should follow the structure: 'release/{version}' for release branches.
📚 Learning: 2025-07-11T13:05:08.440Z
Learnt from: prettyboymp
PR: woocommerce/woocommerce#59048
File: .github/workflows/cherry-pick-milestoned-prs.yml:118-131
Timestamp: 2025-07-11T13:05:08.440Z
Learning: In GitHub Actions workflows, when reviewing steps that access event data like `github.event.pull_request.milestone`, check the entire job dependency chain and conditional logic. If upstream jobs already validate the data exists (like checking `github.event.pull_request.milestone != null` in a prerequisite job), then downstream jobs don't need redundant null-checks since the data is guaranteed to exist by that point.
Applied to files:
.github/workflows/release-build-zip-file.yml
📚 Learning: 2025-08-07T10:34:27.702Z
Learnt from: jorgeatorres
PR: woocommerce/woocommerce#60250
File: .github/workflows/release-compile-changelog.yml:165-166
Timestamp: 2025-08-07T10:34:27.702Z
Learning: In WooCommerce release workflows, the VERSION variable used in changelog generation comes from the `validate-selected-branch-version` step, which extracts the version from `plugins/woocommerce/woocommerce.php` using `grep -oP '(?<=Version: )(.+)'` and validates it matches the input version. This ensures the version is always in the correct format by the time it reaches the changelog generation step, making additional error handling for version format validation unnecessary.
Applied to files:
.github/workflows/release-build-zip-file.yml
📚 Learning: 2025-07-21T05:22:46.426Z
Learnt from: CR
PR: woocommerce/woocommerce#0
File: .cursor/rules/generate-pr-description.mdc:0-0
Timestamp: 2025-07-21T05:22:46.426Z
Learning: Applies to .github/PULL_REQUEST_TEMPLATE.md : Preserve required markdown sections in the PR description, especially those used by automation (e.g., changelog entry details and comments). Do not remove or alter them.
Applied to files:
.github/workflows/release-build-zip-file.yml
📚 Learning: 2025-07-18T14:54:55.592Z
Learnt from: CR
PR: woocommerce/woocommerce#0
File: .cursor/rules/git.mdc:0-0
Timestamp: 2025-07-18T14:54:55.592Z
Learning: Branch names should follow the structure: 'release/{version}' for release branches.
Applied to files:
.github/workflows/release-build-zip-file.yml
🔇 Additional comments (1)
.github/workflows/release-build-zip-file.yml (1)
6-7
: Good fix – removed misleading empty default forbranch
.
Eliminates the action-lint warning and clarifies that the input is mandatory.Also applies to: 19-21
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great!
✅ Tested all described scenarios in my fork and confirmed they all worked as described.
Submission Review Guidelines:
Changes proposed in this Pull Request:
This PR simplifies and enhances pre-build validation in the
Release: Build ZIP file
. In particular:trunk
or a release branch.Closes #60087.
How to test the changes in this Pull Request:
Fork this repository, ensuring both
release/10.1
andrelease/10.0
is included.Prepare your fork for testing by:
Release
exists in Issues > Labels or creating it as necessary.10.1.0
exists in Issues > Milestones or creating it as necessary.10.1.0-rc.2
in Code > Releases, with any target commit/branch. There's no need to upload a ZIP.Run Actions > Release: Build ZIP file and confirm that it fails with any of the following input combos:
release/10.0
, ☐ Skip verification steps, ☐ Create GitHub release.Fails because
10.0.4
is already tagged on wporg.release/10.1
, ☐ Skip verification steps, ☐ Create GitHub release.Fails because
10.1.0-rc.2
is already tagged on GitHub.release/10.1
, ☒ Skip verification steps, ☒ Create GitHub release.Fails because verification steps can't be skipped when creating a release.
Use Actions > Release: Bump version number with release branch
release/10.1
and bump typerc
to generate a PR bumping versions inrelease/10.1
to10.1.0-rc.3
. Merge the resulting PR.Use the GH UI to create a PR with any change against branch
release/10.1
. Do not merge this PR.Run Actions > Release: Build ZIP file with release branch
release/10.1
and confirm that it fails. It should complain about open PRs againstrelease/10.1
.Change the PR created in step 5 to have base branch
trunk
instead but apply the10.1.0
milestone to it.Run Actions > Release: Build ZIP file with release branch
release/10.1
and confirm that it fails. This time, it should complain about open PRs with milestone10.1.0
.Close the PR you opened in step 5.
Run Actions > Release: Build ZIP file with release branch
release/10.1
and ☒ Create GitHub release checked. Confirm that it succeeds and creates a draft release10.1.0-rc.3
after it's done.