Skip to content

Label PRs merged after Feature Freeze #60250

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

Open
wants to merge 6 commits into
base: trunk
Choose a base branch
from

Conversation

jorgeatorres
Copy link
Member

@jorgeatorres jorgeatorres commented Aug 7, 2025

Changes proposed in this Pull Request:

This PR introduces changes to workflows and changelog utils in order to ensure that any PRs automatically generated by release workflows are tagged with the Release label, and also that any non-release PRs merged into the release branch (that is, after the feature freeze) are tagged as metric: post feature freeze.

This will allow us to better monitor and quantify what gets merged after the feature freeze, whether it is a backport or a direct PR against the release branch.

Warning

  • Label metric: post feature freeze must be created prior or after merging this PR.

Closes #60180.

How to test the changes in this Pull Request:

Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:

  1. Fork this repository, including the release/10.1 branch.
  2. Go to Issues > Labels in your fork and create labels Release and metric: post feature freeze.
  3. Run Actions > Release: Bump version number using release/10.1 as release branch and stable as bump type.
  4. Wait until the workflow finishes and ensure that the generated PR has label Release.
  5. Merge this PR and confirm that (after the associated Pull request post-merge processing job finishes) it doesn't get any new labels.
  6. Run Actions > Release: Compile changelog with 10.1 as argument. Ensure that the generated PRs have label Release.
  7. Merge the PRs and confirm that (after the associated Pull request post-merge processing job finishes) they don't get any new labels.
  8. Use the GitHub UI to make any change to plugins/woocommerce/woocommerce.php inside the release/10.1 branch and open a PR with this change in your fork.
  9. Merge the PR.
  10. Confirm that after a little while (once the associated Pull request post-merge processing job finishes) this PR has been labeled as metric: post feature freeze.

@github-actions github-actions bot added the focus: monorepo infrastructure Issues and PRs related to monorepo tooling. label Aug 7, 2025
@jorgeatorres jorgeatorres force-pushed the wooplug-5248-release-label-any-prs-merged-into-the-release-branch-after branch from 6fab5bb to 225f0ba Compare August 7, 2025 10:14
@jorgeatorres jorgeatorres marked this pull request as ready for review August 7, 2025 10:17
@jorgeatorres jorgeatorres requested a review from a team as a code owner August 7, 2025 10:17
@jorgeatorres jorgeatorres requested review from joshuatf and removed request for a team August 7, 2025 10:17
@woocommercebot woocommercebot requested a review from a team August 7, 2025 10:17
Copy link
Contributor

github-actions bot commented Aug 7, 2025

Testing Guidelines

Hi @joshuatf @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:

  • 🖼️ Screenshots or screen recordings.
  • 📝 List of functionality tested / steps followed.
  • 🌐 Site details (environment attributes such as hosting type, plugins, theme, store size, store age, and relevant settings).
  • 🔍 Any analysis performed, such as assessing potential impacts on environment attributes and other plugins, conducting performance profiling, or using LLM/AI-based analysis.

⚠️ Within the testing details you provide, please ensure that no sensitive information (such as API keys, passwords, user data, etc.) is included in this public issue.

@jorgeatorres jorgeatorres removed the request for review from a team August 7, 2025 10:17
Copy link
Contributor

coderabbitai bot commented Aug 7, 2025

📝 Walkthrough

Walkthrough

This update introduces and standardizes the use of the "Release" and "metric: post feature freeze" labels in workflows and utility scripts. It adds label management to GitHub Actions for merged PRs, updates label handling in release and changelog automation, and adjusts trend analysis queries to use the new label.

Changes

Cohort / File(s) Change Summary
GitHub Actions Labeling Workflows
.github/workflows/pull-request-post-merge-processing.yml, .github/workflows/release-bump-version.yml
Adds a workflow to label merged PRs as "metric: post feature freeze" if merged into release branches without a "Release" label; updates the release version bump workflow to add the "Release" label when creating PRs.
Release Trend Analysis Workflow
.github/workflows/release-trends-analysis.yml
Changes label filters in trend analysis jobs from "metric: code freeze exception" to "metric: post feature freeze" and applies minor whitespace fixes.
Changelog Automation Utilities
tools/monorepo-utils/src/code-freeze/commands/changelog/lib/index.ts
Updates changelog update functions to add the "Release" label to PRs after creation, changes their return types to return the PR number, and updates JSDoc comments.
GitHub Repo Utility
tools/monorepo-utils/src/core/github/repo.ts
Adds a new function addLabelsToIssue to add labels to issues or PRs using the GitHub API.

Sequence Diagram(s)

sequenceDiagram
    participant Workflow as GitHub Workflow
    participant GH_CLI as GitHub CLI
    participant PR as Pull Request

    Workflow->>GH_CLI: Create PR (with --label Release)
    GH_CLI->>PR: PR created with "Release" label

    Note over Workflow,PR: On PR merge to release/* without "Release" label
    Workflow->>GH_CLI: Add "metric: post feature freeze" label to PR
    GH_CLI->>PR: PR labeled with "metric: post feature freeze"
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 225f0ba and ec3a26c.

📒 Files selected for processing (5)
  • .github/workflows/pull-request-post-merge-processing.yml (1 hunks)
  • .github/workflows/release-bump-version.yml (1 hunks)
  • .github/workflows/release-trends-analysis.yml (3 hunks)
  • tools/monorepo-utils/src/code-freeze/commands/changelog/lib/index.ts (5 hunks)
  • tools/monorepo-utils/src/core/github/repo.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .github/workflows/release-bump-version.yml
🚧 Files skipped from review as they are similar to previous changes (4)
  • tools/monorepo-utils/src/core/github/repo.ts
  • tools/monorepo-utils/src/code-freeze/commands/changelog/lib/index.ts
  • .github/workflows/release-trends-analysis.yml
  • .github/workflows/pull-request-post-merge-processing.yml
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch wooplug-5248-release-label-any-prs-merged-into-the-release-branch-after

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3de58cd and 225f0ba.

📒 Files selected for processing (6)
  • .github/workflows/pull-request-post-merge-processing.yml (1 hunks)
  • .github/workflows/release-bump-version.yml (1 hunks)
  • .github/workflows/release-compile-changelog.yml (1 hunks)
  • .github/workflows/release-trends-analysis.yml (3 hunks)
  • tools/monorepo-utils/src/code-freeze/commands/changelog/lib/index.ts (5 hunks)
  • tools/monorepo-utils/src/core/github/repo.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{php,js,jsx,ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/code-quality.mdc)

**/*.{php,js,jsx,ts,tsx}: Guard against unexpected inputs
Sanitize and validate any potentially dangerous inputs
Ensure code is backwards compatible
Write code that is readable and intuitive
Ensure code has unit or E2E tests where applicable

Files:

  • tools/monorepo-utils/src/core/github/repo.ts
  • tools/monorepo-utils/src/code-freeze/commands/changelog/lib/index.ts
**/*.{php,js,ts,jsx,tsx}

⚙️ CodeRabbit Configuration File

**/*.{php,js,ts,jsx,tsx}: Don't trust that extension developers will follow the best practices, make sure the code:

  • Guards against unexpected inputs.
  • Sanitizes and validates any potentially dangerous inputs.
  • Is backwards compatible.
  • Is readable and intuitive.
  • Has unit or E2E tests where applicable.

Files:

  • tools/monorepo-utils/src/core/github/repo.ts
  • tools/monorepo-utils/src/code-freeze/commands/changelog/lib/index.ts
🧠 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.
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 : The changelog section in the PR description must keep the markdown structure from the PR template exactly as-is, including all checkboxes, comments, and headings. Only the appropriate checkbox may be checked, and the changelog message must be placed under the `#### Comment` heading and before the closing `</details>` tag. Do not add, remove, or reformat any part of the changelog section except for checking the box and adding the message in the correct place.
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.
📚 Learning: applies to .github/pull_request_template.md : the changelog section in the pr description must keep ...
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 : The changelog section in the PR description must keep the markdown structure from the PR template exactly as-is, including all checkboxes, comments, and headings. Only the appropriate checkbox may be checked, and the changelog message must be placed under the `#### Comment` heading and before the closing `</details>` tag. Do not add, remove, or reformat any part of the changelog section except for checking the box and adding the message in the correct place.

Applied to files:

  • .github/workflows/release-compile-changelog.yml
  • .github/workflows/release-trends-analysis.yml
  • tools/monorepo-utils/src/code-freeze/commands/changelog/lib/index.ts
📚 Learning: applies to .github/pull_request_template.md : preserve required markdown sections in the pr descript...
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-compile-changelog.yml
  • .github/workflows/release-trends-analysis.yml
  • .github/workflows/pull-request-post-merge-processing.yml
  • tools/monorepo-utils/src/code-freeze/commands/changelog/lib/index.ts
📚 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-trends-analysis.yml
  • .github/workflows/pull-request-post-merge-processing.yml
📚 Learning: when the user requests a pr description, always provide the output in markdown format, using the str...
Learnt from: CR
PR: woocommerce/woocommerce#0
File: .cursor/rules/generate-pr-description.mdc:0-0
Timestamp: 2025-07-21T05:22:46.426Z
Learning: When the user requests a PR description, always provide the output in markdown format, using the structure and sections from the PR template. The output should be copy-paste ready for a GitHub PR and must include all required sections unless the user specifies otherwise. Do not provide plain text or summary—always provide the markdown-formatted PR template filled out with the relevant details from the change, following these rules strictly.

Applied to files:

  • .github/workflows/release-trends-analysis.yml
📚 Learning: branch names should follow the structure: 'release/{version}' for release branches....
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-bump-version.yml
🧬 Code Graph Analysis (1)
tools/monorepo-utils/src/code-freeze/commands/changelog/lib/index.ts (1)
tools/monorepo-utils/src/code-freeze/commands/changelog/types.ts (1)
  • Options (1-10)
🔇 Additional comments (8)
.github/workflows/release-bump-version.yml (1)

173-174: LGTM! Correct implementation of Release label requirement.

The addition of --label Release properly implements the PR objective to label automatically generated release PRs with the "Release" label for better tracking and categorization.

.github/workflows/release-trends-analysis.yml (2)

18-18: LGTM! Correct label update for CFEs analysis.

The label filter correctly changes from "metric: code freeze exception" to "metric: post feature freeze" to align with the new labeling scheme introduced in this PR.


66-66: LGTM! Consistent label update for quality analysis.

The label filter is consistently updated to use "metric: post feature freeze" across all analysis jobs, maintaining functionality while aligning with the new labeling system.

.github/workflows/pull-request-post-merge-processing.yml (1)

60-73: LGTM! Correctly implements post-feature-freeze labeling logic.

The new job properly implements the PR objective to label non-Release PRs merged into release branches with "metric: post feature freeze". The conditional logic correctly identifies the target scenarios and the GitHub CLI usage is appropriate.

tools/monorepo-utils/src/code-freeze/commands/changelog/lib/index.ts (4)

15-18: LGTM!

The import addition is necessary for the new PR labeling functionality and follows the existing import pattern.


186-190: LGTM!

The PR labeling logic correctly adds the "Release" label after PR creation. The try-catch block appropriately handles labeling failures as non-critical errors, ensuring the main changelog workflow continues even if labeling fails.


210-210: LGTM!

The return type changes are consistent and well-documented. Updating both updateBranchChangelog and updateTrunkChangelog to return PR numbers allows callers to access the created PR number for further processing. The JSDoc comment is properly updated to reflect the new behavior.

Also applies to: 217-217, 272-272, 303-303


266-270: LGTM!

The PR labeling logic is consistent with the implementation in updateReleaseBranchChangelogs. It correctly adds the "Release" label after PR creation and handles failures gracefully as non-critical errors.

@jorgeatorres jorgeatorres force-pushed the wooplug-5248-release-label-any-prs-merged-into-the-release-branch-after branch from 225f0ba to ec3a26c Compare August 7, 2025 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus: monorepo infrastructure Issues and PRs related to monorepo tooling.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Release: label any PRs merged into the release branch after the feature freeze
1 participant