-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Add support for beta prereleases in workflows #60193
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
9ea9b98
to
c6d3f78
Compare
c6d3f78
to
e4e047f
Compare
Testing GuidelinesHi @kalessil , 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 workflows for release management were updated to include "beta" as a recognized prerelease type alongside "dev" and "rc." This affects version parsing, prerelease detection, job triggering, and changelog handling across several GitHub Actions workflow files. Regex patterns, conditional logic, and documentation were adjusted accordingly. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant GH as GitHub Actions
participant CLI as GitHub CLI
Dev->>GH: Push tag or trigger release workflow
GH->>GH: Parse version (recognize dev, beta, rc)
GH->>GH: Determine bump type and validate transition
GH->>GH: Set IS_PRERELEASE if version contains dev, beta, or rc
GH->>CLI: Create GitHub release (with or without --prerelease)
GH->>GH: Trigger jobs based on release tag (dev, beta, rc, stable)
GH->>GH: Conditionally clear changelog and update files
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ 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: 0
🧹 Nitpick comments (5)
.github/workflows/release-build-zip-file.yml (1)
252-257
: Consolidate prerelease detection to avoid triplecontains()
repetition
Using threecontains()
calls is verbose and easy to forget when a new prerelease type is added. Consider computingis_prerelease
once in a smallgithub-script
step (or a reusable action) and reuse its output here. This keeps the expression short and future-proof..github/workflows/release-commits-and-contributors.yml (1)
8-15
: Input description & parser drift
The description still listsX.Y
but the regex now always allows an optional.Z
. Either drop the reference toX.Y
or accept only the documented forms to avoid surprising users..github/workflows/release-bump-version.yml (3)
64-74
: Duplicate semver regex across workflows
The same (or very similar) regex now lives in at least three files. Extracting it to a tiny JS module or a reusable composite action would remove copy-paste bugs when the version scheme changes again.
76-82
:invalidBump
condition is getting hard to reason about
The chained boolean expression is already five clauses long. A small state-transition map (current->allowed bumps) would be more readable and less error-prone.
133-135
: Perl one-liner risks wiping legitimate changelog content
Multi-line, greedy.*
can over-match if the readme header format ever changes. Consider a purpose-built script (or at least anchoring the look-behind to= Unreleased =
section) to safeguard historical entries.
📜 Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
.github/workflows/release-build-zip-file.yml
(1 hunks).github/workflows/release-bump-version.yml
(5 hunks).github/workflows/release-commits-and-contributors.yml
(2 hunks).github/workflows/release-new-release-published.yml
(3 hunks)
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
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#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.
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.
📚 Learning: in github actions workflows, when reviewing steps that access event data like `github.event.pull_req...
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
.github/workflows/release-new-release-published.yml
📚 Learning: in woocommerce core repository, changelog entries for all prs live in `plugins/woocommerce/changelog...
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:
.github/workflows/release-new-release-published.yml
.github/workflows/release-bump-version.yml
📚 Learning: woocommerce trunk versions follow the pattern `x.y.0-dev` where the patch version is always `0`. thi...
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:
.github/workflows/release-bump-version.yml
📚 Learning: to watch for changes, use 'pnpm --filter=@woocommerce/plugin-woocommerce watch:build' to ensure expe...
Learnt from: CR
PR: woocommerce/woocommerce#0
File: .cursor/rules/woo-build.mdc:0-0
Timestamp: 2025-07-28T05:05:41.091Z
Learning: To watch for changes, use 'pnpm --filter=@woocommerce/plugin-woocommerce watch:build' to ensure experimental features are active during development builds.
Applied to files:
.github/workflows/release-bump-version.yml
📚 Learning: woocommerce uses wordpress versioning conventions where minor versions in x.y.z format are constrain...
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:
.github/workflows/release-bump-version.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Remind reviewers to also review the testing instructions and test coverage
🔇 Additional comments (2)
.github/workflows/release-commits-and-contributors.yml (1)
39-42
: No “-rc” references found in workflows
Ran a repository-wide search in.github/workflows
for-rc.
and confirmed there are no hard-coded references remaining..github/workflows/release-new-release-published.yml (1)
14-15
: Conditions read clearly and match the new policy – looks good
@@ -36,7 +36,7 @@ jobs: | |||
update-global-changelog: | |||
name: 'Update changelog.txt after any stable release' | |||
runs-on: ${{ ( github.repository == 'woocommerce/woocommerce' && 'blacksmith-2vcpu-ubuntu-2404' ) || 'ubuntu-latest' }} | |||
if: ${{ github.event.action == 'published' && ! contains( inputs.release_tag_name, '-rc' ) }} | |||
if: ${{ github.event.action == 'published' && ! ( contains( inputs.release_tag_name, '-dev' ) || contains( inputs.release_tag_name, '-beta' ) || contains( inputs.release_tag_name, '-rc' ) ) }} |
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.
Any potential issues with relying on github.event.release.prerelease
instead?
Testing in progress:
|
This is indeed correct. I had the wrong version in the testing instructions. Apologies @kalessil! |
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.
LGTM and manual tests are passing as described!
Changes proposed in this Pull Request:
The new versioning scheme, bringing back beta 1 and beta 2 and using RCs for internal deployment only means we need to make some adjustments to our workflows.
This PR introduces those changes. In particular:
-dev
,-beta
or-rc
is now considered "prerelease" by the build workflow.-beta.N
versions and also between-beta
and-rc
. Checks to prevent invalid workflows were enhanced as well.-dev
,-beta
or-rc
release.Related to #60029.
How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:
Fork the WooCommerce repository and set the release-related secrets as indicated in Build
.0-dev
release at code freeze time #60001. Ensure thatrelease/10.1
is also included.Use the GH UI or the tool of your choice and replace
woocommerce/woocommerce
for<yourusername>/woocommerce
in both of these files:woocommerce/.github/workflows/release-release-events-proxy.yml
Line 11 in c183a34
woocommerce/.github/workflows/release-new-release-published.yml
Line 15 in e4e047f
Go to Actions > Release: Enforce Code Freeze and run the workflow. Confirm that after it finishes:
trunk
to10.3.0-dev
.release/10.2
and milestone10.3.0
have been created.10.2.0-dev
pre-release has been created and published.Go to Actions > Release: Bump version number and test the version bump logic (always using
release/10.2
as Release branch):dev
,stable
andrc
.beta
and confirm that it creates a PR bumping versions to10.2.0-beta.1
. Merge this PR.dev
andstable
.beta
and confirm that it creates a PR bumping version sto10.2.0-beta.2
. Merge this PR.rc
and confirm that it creates a PR bumping versions to10.2.0-rc.1
. Merge this PR.dev
orbeta
.stable
and confirm that it creates a PR bumping versions to10.2.0
. Merge this PR.Go to Actions > _Release: Build ZIP file:
release/10.1
as Release branch and make sure Create a draft GitHub release is checked. I suggest to Skip verification steps for testing purposes. Once the workflow completes, you should have a10.1.0-rc.2
draft release in Code > Releases. Confirm that this is marked as pre-release by default.release/10.2
as Release branch and Create a draft GitHub release is checked. Same as above, I suggest to Skip verification steps. Once the workflow completes, you should have a10.2.0
draft release in Code > Releases. Confirm that this is not marked as pre-release by default.Go to Code > Releases and create draft releases with the following names:
10.3.0-dev
,10.3.0-beta.1
,10.3.0-rc.1
and10.3.0
. There's no need to upload a ZIP. Confirm that:10.3.0-dev
and10.3.0-rc.1
don't trigger any Slack notification.10.3.0-beta.1
triggers a Slack notification and runs the Call release commits and contributors workflow job as part of its associated Release: Release events proxy workfllow run.10.3.0
triggers a Slack notifications as well, and in its Release: Release events proxy workfllow run it should not run the Call release commits and contributors workflow but should run the Update changelog.txt job.Testing that has already taken place: