Skip to content

Move the woo-announcement notification to after stable tags are updated #59064

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

Merged
merged 20 commits into from
Jun 27, 2025

Conversation

albarin
Copy link
Contributor

@albarin albarin commented Jun 23, 2025

Submission Review Guidelines:

Changes proposed in this Pull Request:

This PR moves the release Slack announcement notification to trigger after stable tag updates are completed, rather than when the release is initially published.

Closes #59057

How to test the changes in this Pull Request:

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

⚠️ If you want to test on your own Slack workspace, follow the instructions from the Steps to set up a Slack app from #58417, otherwise follow these 👇

  1. Fork the woocommerce/woocommerce repo with all branches into your GH account.
  2. In your forked repo, go to Settings > Secrets and variables > Actions and create new repository secrets:
  • SVN_REPO_URL, SVN_USERNAME, and SVN_PASSWORD (you can get them from the secret store, search for Flux SVN test repo).
  • CODE_FREEZE_BOT_TOKEN: get the token value from the Test Assistant bot from the secret store.
  • WOO_ANNOUNCEMENTS_SLACK_CHANNEL: you can use the test channel test-woo-core-release-notifications.
  1. In the forked repo, create a PR with the branch 59057/announcement-notification and merge it (to get this new workflow into trunk).
  2. Go to the SVN repo URL and check the stage tag in the trunk readme.txt.
  3. Now go to Actions, click on the Release: Update stable tag, and run the flow with a version lower than the current trunk one from the previous step (for example, if current is 9.8.5, you can input 9.8.3 or 9.8.4). Check I confirm... and Allow revert checkboxes.
  4. When the flow finishes successfully, make sure no notification was sent to Slack.
  5. Run the Release: Update stable tag again with a higher version than current (for example, go back to 9.8.5).
  6. When the flow finishes successfully, make sure you get a notification in the Slack channel announcing the new release.

Testing that has already taken place:

Changelog entry

  • Automatically create a changelog entry from the details below.
  • This Pull Request does not require a changelog entry. (Comment required below)
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

Copy link
Contributor

coderabbitai bot commented Jun 23, 2025

📝 Walkthrough

Walkthrough

The changes update GitHub Actions workflows for release notifications. A Slack notification step for the announcements channel was removed from the release-new-release-published.yml workflow. Conversely, a new notify-release job was added to the release-update-stable-tag.yml workflow to send a Slack announcement after certain jobs complete, conditional on input parameters.

Changes

File(s) Change Summary
.github/workflows/release-new-release-published.yml Removed Slack notification step to the announcements channel; other notification steps unchanged.
.github/workflows/release-update-stable-tag.yml Added notify-release job to send Slack announcement after release, conditional on inputs.

Possibly related PRs


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.
    • @coderabbitai modularize this function.
  • 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.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

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

@github-actions github-actions bot added the focus: monorepo infrastructure Issues and PRs related to monorepo tooling. label Jun 23, 2025
@albarin albarin marked this pull request as ready for review June 23, 2025 10:11
@albarin albarin requested a review from a team as a code owner June 23, 2025 10:11
@albarin albarin requested review from prettyboymp and removed request for a team June 23, 2025 10:11
@woocommercebot woocommercebot requested a review from a team June 23, 2025 10:11
Copy link
Contributor

github-actions bot commented Jun 23, 2025

Testing Guidelines

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

Copy link
Contributor

@prettyboymp prettyboymp left a comment

Choose a reason for hiding this comment

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

Changes look good. Just one change request.

Base automatically changed from 58645/update-stable-workflow to trunk June 27, 2025 12:45
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: 1

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between fcffa9c and ac1b98b.

📒 Files selected for processing (2)
  • .github/workflows/release-new-release-published.yml (0 hunks)
  • .github/workflows/release-update-stable-tag.yml (1 hunks)
💤 Files with no reviewable changes (1)
  • .github/workflows/release-new-release-published.yml
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
PR: woocommerce/woocommerce#0
File: .cursor/rules/generate-pr-description.mdc:0-0
Timestamp: 2025-06-23T12:25:21.208Z
Learning: When generating a pull request (PR) description for this repository, always preserve the markdown structure of the PR template, especially sections required by automation such as the changelog entry details and comments. The changelog section must retain its exact markdown structure, 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-06-23T12:25:21.208Z
Learning: When generating a PR description, summarize the changes, testing steps, and rationale in a concise and clear manner to facilitate reviewer understanding. Provide clear, step-by-step instructions for how to test the changes.
🔇 Additional comments (1)
.github/workflows/release-update-stable-tag.yml (1)

241-241: Nice: action is pinned to a specific commit SHA

Using archive/github-actions-slack@a62d71… instead of a mutable tag mitigates supply-chain risks.

Comment on lines +240 to +247
- name: 'Notify to announcements channel'
uses: archive/github-actions-slack@a62d71a4ea93e68cbdc37581166b0298bea512e9 # v 2.10.0
with:
slack-bot-user-oauth-access-token: ${{ secrets.CODE_FREEZE_BOT_TOKEN }}
slack-channel: ${{ secrets.WOO_ANNOUNCEMENTS_SLACK_CHANNEL }}
slack-optional-unfurl_links: false
slack-text: |
:woo-bounce: *<${{ github.event.release.html_url }}|WooCommerce ${{ github.event.release.name }}>* has been released! :rocket:
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

github.event.release.* is undefined in workflow_dispatch — Slack message will break

This workflow is triggered via workflow_dispatch, which means the github.event payload contains only the inputs object and a few top-level fields. It does not include a release key.
Consequently ${{ github.event.release.html_url }} and ${{ github.event.release.name }} will resolve to empty strings, producing either an empty message or a runtime failure in the Slack step.

-            :woo-bounce: *<${{ github.event.release.html_url }}|WooCommerce ${{ github.event.release.name }}>* has been released! :rocket:
+            :woo-bounce: *<https://github.com/${{ github.repository }}/releases/tag/v${{ needs.validate-release.outputs.version }}|WooCommerce v${{ needs.validate-release.outputs.version }}>* has been released! :rocket:

If you still need the official release object, add a preceding step that calls the GitHub API (e.g., with actions/github-script) to fetch the release by tag and save the URL/name to outputs, then reference those outputs here.

📝 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
- name: 'Notify to announcements channel'
uses: archive/github-actions-slack@a62d71a4ea93e68cbdc37581166b0298bea512e9 # v 2.10.0
with:
slack-bot-user-oauth-access-token: ${{ secrets.CODE_FREEZE_BOT_TOKEN }}
slack-channel: ${{ secrets.WOO_ANNOUNCEMENTS_SLACK_CHANNEL }}
slack-optional-unfurl_links: false
slack-text: |
:woo-bounce: *<${{ github.event.release.html_url }}|WooCommerce ${{ github.event.release.name }}>* has been released! :rocket:
- name: 'Notify to announcements channel'
uses: archive/github-actions-slack@a62d71a4ea93e68cbdc37581166b0298bea512e9 # v 2.10.0
with:
slack-bot-user-oauth-access-token: ${{ secrets.CODE_FREEZE_BOT_TOKEN }}
slack-channel: ${{ secrets.WOO_ANNOUNCEMENTS_SLACK_CHANNEL }}
slack-optional-unfurl_links: false
slack-text: |
- :woo-bounce: *<${{ github.event.release.html_url }}|WooCommerce ${{ github.event.release.name }}>* has been released! :rocket:
+ :woo-bounce: *<https://github.com/${{ github.repository }}/releases/tag/v${{ needs.validate-release.outputs.version }}|WooCommerce v${{ needs.validate-release.outputs.version }}>* has been released! :rocket:
🤖 Prompt for AI Agents
In .github/workflows/release-update-stable-tag.yml around lines 240 to 247, the
Slack notification step uses github.event.release.html_url and
github.event.release.name, which are undefined when the workflow is triggered by
workflow_dispatch. To fix this, add a prior step that uses the GitHub API (for
example, with actions/github-script) to fetch the release details by tag, then
save the release URL and name as outputs. Update the Slack notification step to
reference these outputs instead of github.event.release properties.

@albarin albarin merged commit 5bb2bf3 into trunk Jun 27, 2025
12 checks passed
@albarin albarin deleted the 59057/announcement-notification branch June 27, 2025 13:01
shaybanshee pushed a commit that referenced this pull request Jul 2, 2025
…ated (#59064)

* Add `Release: Update stable tag` workflow

* Change version formats

* Create also a PR for the release branch

* Update svn secrets

* Remove the dry-run and add confirm-update

* Remove unnecessary apt-get update

* Use proper errors

* Use diff --quiet conditions

* Require the full version

* Checkout trunk only

* Merge validation steps into single job

* Verify current stable tag is diff from the target version

* Allow reverting with checkbox

* Remove compare version dep

* Move the woo-announcement notification to after stable tags are updated

* Notify only when it's not a revert

* Add link

* Pin to specific commit sha

* Fix mistake from resolving conflicts
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.

Send message to #woo-announcements after the stable tag is updated
2 participants