Skip to content

Add slack notifications for open issues prior to release build. #60272

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 2 commits into
base: trunk
Choose a base branch
from

Conversation

prettyboymp
Copy link
Contributor

Changes proposed in this Pull Request:

Closes WOOPLUG-5202 / #60059 .

The goal of this PR is to reduce the chances that a release DRI will need to reach out to individuals about the status of pending issues or PRs tagged for a release milestone when they are attempting to build the release.

This adds a daily workflow that will:

  1. Check the release calendar for the next upcoming release build. It is searching for any event within the next 3 days that matches the format of WooCommerce X.Y% except for feature freezes.
  2. Gather any existing issues or PRs that are still open and set for the milestone of the upcoming release build.
  3. Send a slack notification to the release notifications channel with the list of open issues.

Screenshots or screen recordings:

Screenshot 2025-08-08 at 8 53 25 AM

How to test the changes in this Pull Request:

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

Setup

  1. Create a fork of the WooCommerce Repo.
  2. In your forked repo, go to Settings > Secrets and variables > Actions and create 3 new repository secrets:
  • CODE_FREEZE_BOT_TOKEN, get the token value from the Test Assistant bot from the secret store.
  • WOO_RELEASE_SLACK_NOTIFICATION_CHANNEL: You can use the test channel test-woo-core-release-notifications.
  • RELEASE_CALENDAR_ID: Create a new public calendar under any Google account and set this to the calendar ID (follow this guide to get the ID).
  1. Merge the branch WOOPLUG-5202/add-open-issue-for-milestone-notification into trunk of your fork.

Testing

  1. In your fork, go to Actions and then the Release: Open Issue Warning workflow.
  2. Run the workflow.
  3. Since you don't yet have an upcoming release event, you should see output of No Code Freeze events found in the specified range. for the workflow run.
  4. Add a release event to the calendar for one of the next 3 days. The event should match one of the standard events from the WooCommerce Core Release calendar, e.g. WooCommerce 10.1 Release, WooCommerce 10.2 Beta 1, etc. But it should not be the feature freeze - that is excluded.
  5. Run the workflow again.
  6. You should see a log entry for "Found 0 open items in milestone ${milestone}", however, the slack message won't be sent since there were no open issues.
  7. In the fork, create a couple of issues or PRs and mark them for the milestone matching the version, e.g. 10.1.0 is the milestone for 10.0.
  8. Run the workflow another time.
  9. A slack message should be sent to the WOO_RELEASE_SLACK_NOTIFICATION_CHANNEL listing the open issues.

Changelog entry

  • Automatically create a changelog entry from the details below.
  • This Pull Request does not require a changelog entry. (Comment required below)
    Workflow change only.
Changelog Entry Details

Significance

  • Patch
  • Minor
  • Major

Type

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement - Improvement to existing functionality

Message

Changelog Entry Comment

Comment

@github-actions github-actions bot added the focus: monorepo infrastructure Issues and PRs related to monorepo tooling. label Aug 8, 2025
@prettyboymp prettyboymp marked this pull request as ready for review August 8, 2025 13:10
@prettyboymp prettyboymp requested a review from a team as a code owner August 8, 2025 13:10
@prettyboymp prettyboymp requested review from kalessil and removed request for a team August 8, 2025 13:10
Copy link
Contributor

github-actions bot commented Aug 8, 2025

Testing Guidelines

Hi @kalessil @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.

@woocommercebot woocommercebot requested a review from a team August 8, 2025 13:10
Copy link
Contributor

coderabbitai bot commented Aug 8, 2025

📝 Walkthrough

Walkthrough

A new GitHub Actions workflow has been introduced to monitor upcoming WooCommerce release events. It runs daily and on manual trigger, checks for imminent releases via a public calendar, identifies open issues and PRs assigned to the corresponding milestone, and sends a Slack notification if any are found.

Changes

Cohort / File(s) Change Summary
Release Open Issue Warning Workflow
.github/workflows/release-open-issue-warning.yml
Added a workflow to detect upcoming release events, collect open milestone issues/PRs, and notify Slack.

Sequence Diagram(s)

sequenceDiagram
    participant Scheduler as GitHub Actions (Scheduled/Manual)
    participant Calendar as Google Calendar (ICS)
    participant GitHub as GitHub API
    participant Slack as Slack API

    Scheduler->>Calendar: Fetch ICS feed for release events
    Calendar-->>Scheduler: Return upcoming events
    Scheduler->>Scheduler: Parse and filter for next release event
    alt Release event found
        Scheduler->>GitHub: Query open issues/PRs for release milestone
        GitHub-->>Scheduler: Return list of open items
        alt Open items found
            Scheduler->>Slack: Send formatted message with open items
            Slack-->>Scheduler: Acknowledge delivery
        else No open items
            Scheduler->>Scheduler: Skip Slack notification
        end
    else No release event
        Scheduler->>Scheduler: Exit workflow
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 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
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch WOOPLUG-5202/add-open-issue-for-milestone-notification

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: 4

🧹 Nitpick comments (7)
.github/workflows/release-open-issue-warning.yml (7)

60-60: Fix log message wording

This branch handles the absence of release events, not “Code Freeze”.

-                console.log(`No Code Freeze events found in the specified range.`);
+                console.log(`No release build events found in the specified range.`);

115-117: Include team reviewers in “waiting on …”

The API returns both users and teams; include teams so the message reflects all pending reviewers.

-                    if (reviewers.data.users && reviewers.data.users.length > 0) {
-                      waitingOn.push(...reviewers.data.users.map(r => r.login));
-                    }
+                    if (reviewers.data.users?.length) {
+                      waitingOn.push(...reviewers.data.users.map(r => r.login));
+                    }
+                    if (reviewers.data.teams?.length) {
+                      waitingOn.push(...reviewers.data.teams.map(t => `@${t.slug}`));
+                    }

135-135: Minor Slack formatting tweak

Square brackets don’t add value in Slack; simplify the bullet for readability.

-                const formattedItem = `• [#${item.number}] <${itemUrl}|${item.title}> (${author})\n  Created ${createdDate} · ${waitingOnText}`;
+                const formattedItem = `• #${item.number} <${itemUrl}|${item.title}> (${author})\n  Created ${createdDate} · ${waitingOnText}`;

145-148: If only 20 items are listed, indicate truncation in the header

You’re showing up to 20 but using total_count in the header. Make it explicit when truncated to avoid confusion.

-              const slackMessage = [
-                `🚨 Milestone ${milestone} has ${searchResults.data.total_count} open items for ${releaseEventTitle} on ${formattedDate}\n`,
+              const shown = items.length;
+              const total = searchResults.data.total_count;
+              const header = `🚨 Milestone ${milestone} has ${total} open items for ${releaseEventTitle} on ${formattedDate}${shown < total ? ` (showing first ${shown})` : ''}\n`;
+              const slackMessage = [
+                header,
                 ...items
               ].join('\n');

159-169: Simplify Slack step input and optionally gate posting to upstream repo

No need to pass SLACK_MESSAGE via env. Also consider gating posts to the main repo to avoid accidental posts from forks (manual runs).

-      - name: Send Slack Message
-        if: ${{ steps.get-milestone-items.outputs.has-items == 'true' }}
+      - name: Send Slack Message
+        if: ${{ steps.get-milestone-items.outputs.has-items == 'true' && github.repository == 'woocommerce/woocommerce' }}
         uses: archive/github-actions-slack@c643e5093620d65506466f2c9b317d5d29a5e517 # v2.10.1
-        env:
-          SLACK_MESSAGE: ${{ steps.get-milestone-items.outputs.slack-message }}
         with:
           slack-bot-user-oauth-access-token: ${{ secrets.CODE_FREEZE_BOT_TOKEN }}
           slack-optional-unfurl_links: false
           slack-channel: ${{ secrets.WOO_RELEASE_SLACK_NOTIFICATION_CHANNEL }}
-          slack-text: |
-            ${{ env.SLACK_MESSAGE }}
+          slack-text: ${{ steps.get-milestone-items.outputs.slack-message }}

If you prefer to allow forks to test Slack, drop the repository gate and keep the simplification.


12-15: Add concurrency control to prevent duplicate notifications

Avoid overlapping runs from schedule/manual triggers posting twice.

   check-upcoming-release-events:
     name: Check for upcoming release events
     runs-on: ${{ ( github.repository == 'woocommerce/woocommerce' && 'blacksmith-2vcpu-ubuntu-2404' ) || 'ubuntu-latest' }}
+    concurrency:
+      group: release-open-issue-warning
+      cancel-in-progress: true

36-36: Trim trailing whitespace to satisfy yamllint

YAMLlint flags trailing spaces on the listed lines. Please strip them.

If you use Prettier, enable trimming on save or run:

  • pnpm prettier --write .github/workflows/release-open-issue-warning.yml
  • or: yamllint -f colored .github/workflows/release-open-issue-warning.yml

Also applies to: 38-38, 41-41, 44-44, 74-74, 76-76, 80-80, 86-86, 88-88, 94-94, 96-96, 100-100, 105-105, 114-114, 122-122, 126-126, 127-127, 128-128, 130-130, 131-131, 136-136, 143-143, 149-149, 153-153

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between a7b4e7b and 3e59ed5.

📒 Files selected for processing (1)
  • .github/workflows/release-open-issue-warning.yml (1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: jorgeatorres
PR: woocommerce/woocommerce#60262
File: .github/workflows/release-build-zip-file.yml:133-138
Timestamp: 2025-08-08T08:14:35.037Z
Learning: WooCommerce milestone convention: The woocommerce/woocommerce repository only creates GitHub milestones in the x.y.0 format, and those milestones cover RCs and patch releases for that minor train. In .github/workflows/release-build-zip-file.yml, the pre-build verification that sets `milestone="$version_prefix.0"` is intentional and should remain as-is; using `$version_prefix` alone would be incorrect for this repo.
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: senadir
PR: woocommerce/woocommerce#59325
File: plugins/woocommerce/includes/wc-formatting-functions.php:1211-1226
Timestamp: 2025-07-01T16:24:23.871Z
Learning: Action Scheduler is bundled into WooCommerce and always available, so there's no need to add fallback logic to WordPress cron functions when using Action Scheduler functions like as_schedule_single_action() and as_unschedule_all_actions() in WooCommerce code.
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/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.
📚 Learning: 2025-08-08T08:14:35.037Z
Learnt from: jorgeatorres
PR: woocommerce/woocommerce#60262
File: .github/workflows/release-build-zip-file.yml:133-138
Timestamp: 2025-08-08T08:14:35.037Z
Learning: WooCommerce milestone convention: The woocommerce/woocommerce repository only creates GitHub milestones in the x.y.0 format, and those milestones cover RCs and patch releases for that minor train. In .github/workflows/release-build-zip-file.yml, the pre-build verification that sets `milestone="$version_prefix.0"` is intentional and should remain as-is; using `$version_prefix` alone would be incorrect for this repo.

Applied to files:

  • .github/workflows/release-open-issue-warning.yml
📚 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-open-issue-warning.yml
📚 Learning: 2025-08-08T08:15:10.569Z
Learnt from: jorgeatorres
PR: woocommerce/woocommerce#60262
File: .github/workflows/release-build-zip-file.yml:125-130
Timestamp: 2025-08-08T08:15:10.569Z
Learning: In .github/workflows/release-build-zip-file.yml, the env var BRANCH in the verify/build jobs is set from the required `branch` input (e.g., `release/x.y`) rather than a Git ref. Using `gh pr list --search "base:$BRANCH"` is valid because `branch` is always a plain branch name in this workflow.

Applied to files:

  • .github/workflows/release-open-issue-warning.yml
🪛 YAMLlint (1.37.1)
.github/workflows/release-open-issue-warning.yml

[error] 36-36: trailing spaces

(trailing-spaces)


[error] 38-38: trailing spaces

(trailing-spaces)


[error] 41-41: trailing spaces

(trailing-spaces)


[error] 44-44: trailing spaces

(trailing-spaces)


[error] 74-74: trailing spaces

(trailing-spaces)


[error] 76-76: trailing spaces

(trailing-spaces)


[error] 80-80: trailing spaces

(trailing-spaces)


[error] 86-86: trailing spaces

(trailing-spaces)


[error] 88-88: trailing spaces

(trailing-spaces)


[error] 94-94: trailing spaces

(trailing-spaces)


[error] 96-96: trailing spaces

(trailing-spaces)


[error] 100-100: trailing spaces

(trailing-spaces)


[error] 105-105: trailing spaces

(trailing-spaces)


[error] 114-114: trailing spaces

(trailing-spaces)


[error] 122-122: trailing spaces

(trailing-spaces)


[error] 126-126: trailing spaces

(trailing-spaces)


[error] 127-127: trailing spaces

(trailing-spaces)


[error] 128-128: trailing spaces

(trailing-spaces)


[error] 130-130: trailing spaces

(trailing-spaces)


[error] 131-131: trailing spaces

(trailing-spaces)


[error] 136-136: trailing spaces

(trailing-spaces)


[error] 143-143: trailing spaces

(trailing-spaces)


[error] 149-149: trailing spaces

(trailing-spaces)


[error] 153-153: trailing spaces

(trailing-spaces)

⏰ 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: label_project
🔇 Additional comments (1)
.github/workflows/release-open-issue-warning.yml (1)

72-75: Good: mapping X.Y to X.Y.0 milestone matches WooCommerce convention

Using ${version}.0 aligns with the repo’s milestone scheme and avoids false negatives.

Comment on lines +15 to +23
steps:
- name: Install node-ical
run: npm install node-ical
- name: Check for release events
id: check-upcoming-release-build
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #v7.0.1
with:
script: |
const ical = require('node-ical');
Copy link
Contributor

@coderabbitai coderabbitai bot Aug 8, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue

3p module in github-script is brittle; set up Node and load module reliably

actions/github-script often can’t require third‑party modules installed in a prior step. Make the module resolution deterministic and pin the dependency.

Apply this diff:

   steps:
+    - uses: actions/setup-node@v4
+      with:
+        node-version: '20'
-    - name: Install node-ical
-      run: npm install node-ical
+    - name: Install node-ical
+      run: |
+        npm init -y
+        npm install node-ical@0.18.0
@@
-          script: |
-            const ical = require('node-ical');
+          script: |
+            const { createRequire } = require('module');
+            const requireFromWorkspace = createRequire(process.cwd() + '/package.json');
+            const ical = requireFromWorkspace('node-ical');
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
steps:
- name: Install node-ical
run: npm install node-ical
- name: Check for release events
id: check-upcoming-release-build
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #v7.0.1
with:
script: |
const ical = require('node-ical');
steps:
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install node-ical
run: |
npm init -y
npm install node-ical@0.18.0
- name: Check for release events
id: check-upcoming-release-build
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #v7.0.1
with:
script: |
const { createRequire } = require('module');
const requireFromWorkspace = createRequire(process.cwd() + '/package.json');
const ical = requireFromWorkspace('node-ical');
🤖 Prompt for AI Agents
In .github/workflows/release-open-issue-warning.yml around lines 15 to 23, the
current use of actions/github-script to require the third-party module
'node-ical' is unreliable because github-script cannot always access modules
installed in previous steps. To fix this, explicitly set up Node.js using
actions/setup-node before installing 'node-ical', and then run the script within
a Node.js context where the module can be reliably loaded. Also, pin the version
of 'node-ical' in the npm install command to ensure deterministic dependency
resolution.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We use this elsewhere in workflows without any issue yet. We can review this if it becomes a problem.

Copy link
Contributor

Choose a reason for hiding this comment

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

@prettyboymp Understood—let’s keep it as-is. If you want a tiny, low-impact hedge against upstream changes in this scheduled job, you could just pin the lib version:

- name: Install node-ical
  run: npm install --no-save node-ical@0.18.0

Happy to revisit the fuller setup-node/createRequire change only if we see flakes.


✏️ Learnings added
Learnt from: prettyboymp
PR: woocommerce/woocommerce#60272
File: .github/workflows/release-open-issue-warning.yml:15-23
Timestamp: 2025-08-08T13:52:26.382Z
Learning: Repository: woocommerce/woocommerce
Context: .github/workflows/release-open-issue-warning.yml and similar workflows
Learning: Maintainers (per prettyboymp) are fine requiring third-party modules inside actions/github-script without adding setup-node/createRequire. Prefer to keep this pattern and defer structural changes unless it demonstrably causes issues; minor safeguards like version pinning are acceptable if needed.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: jorgeatorres
PR: woocommerce/woocommerce#60262
File: .github/workflows/release-build-zip-file.yml:133-138
Timestamp: 2025-08-08T08:14:35.037Z
Learning: WooCommerce milestone convention: The woocommerce/woocommerce repository only creates GitHub milestones in the x.y.0 format, and those milestones cover RCs and patch releases for that minor train. In .github/workflows/release-build-zip-file.yml, the pre-build verification that sets `milestone="$version_prefix.0"` is intentional and should remain as-is; using `$version_prefix` alone would be incorrect for this repo.

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: jorgeatorres
PR: woocommerce/woocommerce#60262
File: .github/workflows/release-build-zip-file.yml:125-130
Timestamp: 2025-08-08T08:15:10.569Z
Learning: In .github/workflows/release-build-zip-file.yml, the env var BRANCH in the verify/build jobs is set from the required `branch` input (e.g., `release/x.y`) rather than a Git ref. Using `gh pr list --search "base:$BRANCH"` is valid because `branch` is always a plain branch name in this workflow.

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: 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.

Comment on lines +81 to +86
const searchResults = await github.rest.search.issuesAndPullRequests({
q: searchQuery,
per_page: 20,
advanced_search: true
});

Copy link
Contributor

@coderabbitai coderabbitai bot Aug 8, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove unsupported advanced_search param from Search API call

Octokit’s search.issuesAndPullRequests doesn’t accept advanced_search; it may cause request validation errors.

               const searchResults = await github.rest.search.issuesAndPullRequests({
                 q: searchQuery,
-                per_page: 20,
-                advanced_search: true
+                per_page: 20
               });
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const searchResults = await github.rest.search.issuesAndPullRequests({
q: searchQuery,
per_page: 20,
advanced_search: true
});
const searchResults = await github.rest.search.issuesAndPullRequests({
q: searchQuery,
per_page: 20
});
🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 86-86: trailing spaces

(trailing-spaces)

🤖 Prompt for AI Agents
In .github/workflows/release-open-issue-warning.yml around lines 81 to 86, the
call to github.rest.search.issuesAndPullRequests incorrectly includes the
unsupported parameter advanced_search. Remove the advanced_search parameter from
the API call to prevent request validation errors and ensure the search query
works correctly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

@prettyboymp Thanks for the context—keeping advanced_search makes sense given the current API behavior. To be robust across environments, suggest trying with advanced_search and falling back without it if the API rejects the param. Also, we can add a brief code comment with the changelog link and trim the trailing space yamllint flagged.

Here’s a drop-in update for the github-script step’s search call:

// TEMP: advanced_search is required while Issues Advanced Search is gated.
// See: https://github.blog/changelog/2025-03-06-github-issues-projects-api-support-for-issues-advanced-search-and-more/#mag-api-support-for-issues-advanced-search
const baseParams = { q: searchQuery, per_page: 20 };
let searchResults;
try {
  searchResults = await github.rest.search.issuesAndPullRequests({
    ...baseParams,
    advanced_search: true,
  });
} catch (error) {
  // Fallback for environments that don’t yet accept the param
  if (error && (error.status === 400 || error.status === 422)) {
    core.warning(`advanced_search not accepted (status ${error.status}); retrying without it for compatibility.`);
    searchResults = await github.rest.search.issuesAndPullRequests(baseParams);
  } else {
    throw error;
  }
}

Minor: yamllint flagged trailing spaces around that block—worth trimming to quiet CI.

Would you like me to open a tracking issue to remove advanced_search once it’s no longer required?


✏️ Learnings added
Learnt from: prettyboymp
PR: woocommerce/woocommerce#60272
File: .github/workflows/release-open-issue-warning.yml:81-86
Timestamp: 2025-08-08T13:59:11.481Z
Learning: Repo: woocommerce/woocommerce — In .github/workflows/release-open-issue-warning.yml, the use of `advanced_search: true` in github.rest.search.issuesAndPullRequests is intentional and temporarily required per GitHub’s 2025-03-06 Issues Advanced Search API update. Prefer keeping it (with a brief inline comment and optional fallback) until GitHub removes the requirement.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: prettyboymp
PR: woocommerce/woocommerce#60272
File: .github/workflows/release-open-issue-warning.yml:15-23
Timestamp: 2025-08-08T13:52:26.382Z
Learning: Repository: woocommerce/woocommerce
Context: .github/workflows/release-open-issue-warning.yml and similar workflows
Learning: Maintainers (per prettyboymp) are fine requiring third-party modules inside actions/github-script without adding setup-node/createRequire. Prefer to keep this pattern and defer structural changes unless it demonstrably causes issues; minor safeguards like version pinning are acceptable if needed.

Learnt from: jorgeatorres
PR: woocommerce/woocommerce#60262
File: .github/workflows/release-build-zip-file.yml:133-138
Timestamp: 2025-08-08T08:14:35.037Z
Learning: WooCommerce milestone convention: The woocommerce/woocommerce repository only creates GitHub milestones in the x.y.0 format, and those milestones cover RCs and patch releases for that minor train. In .github/workflows/release-build-zip-file.yml, the pre-build verification that sets `milestone="$version_prefix.0"` is intentional and should remain as-is; using `$version_prefix` alone would be incorrect for this repo.

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: jorgeatorres
PR: woocommerce/woocommerce#60262
File: .github/workflows/release-build-zip-file.yml:125-130
Timestamp: 2025-08-08T08:15:10.569Z
Learning: In .github/workflows/release-build-zip-file.yml, the env var BRANCH in the verify/build jobs is set from the required `branch` input (e.g., `release/x.y`) rather than a Git ref. Using `gh pr list --search "base:$BRANCH"` is valid because `branch` is always a plain branch name in this workflow.

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: 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: 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.

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.

1 participant