feat(cicd): Add Slack message on Manual SDK Release#35461
feat(cicd): Add Slack message on Manual SDK Release#35461KevinDavilaDotCMS wants to merge 4 commits intomainfrom
Conversation
… enrich auto-publish message - Add missing Slack notification step to cicd_manual-release-sdks.yml; the manual release workflow called the deploy action directly but never sent a Slack message - Include release type (patch/minor/major/custom) and triggering actor in the manual release notification, with a link to the workflow run - Add PR extraction step to cicd_comp_deployment-phase.yml that parses the merge commit message for a PR number and falls back to the short commit SHA - Enrich the auto-publish (next) Slack notification with an "Introduced by" link pointing to the PR or commit that triggered the SDK publish Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
❌ Issue Linking RequiredThis PR could not be linked to an issue. All PRs must be linked to an issue for tracking purposes. How to fix this:Option 1: Add keyword to PR body (Recommended - auto-removes this comment)
Why is this required?Issue linking ensures proper tracking, documentation, and helps maintain project history. It connects your code changes to the problem they solve.--- This comment was automatically generated by the issue linking workflow |
|
Claude finished @KevinDavilaDotCMS's task in 1m 23s —— View job PR Review
1. Repository guard inconsistency # line 374 — current
if: success() && steps.sdks_publish.outputs.published == 'true'
# suggested
if: github.repository == 'dotcms/core' && steps.sdks_publish.outputs.published == 'true'2. Shell interpolation style in "Extract PR" step # line 383-384 — mixes styles
echo "pr_url=${{ github.server_url }}/${{ github.repository }}/pull/$PR_NUMBER" >> $GITHUB_OUTPUT
echo "pr_ref=$(echo '${{ github.sha }}' | cut -c1-7)" >> $GITHUB_OUTPUT3.
4. Slack payload doesn't match the PR description examples But the template only emits 5. Notification fires before post-release PR opens Overall this is a narrow, low-risk addition. Issues 1 and 4 are the ones worth addressing before merge. The pipefail fix from the latest commit is correct. |
…ations - Move github.event.head_commit.message to env: block to prevent script injection (GitHub security best practice) - Replace always() with success() on manual release Slack notification step for correct conditional semantics - Add missing newline at end of cicd_comp_deployment-phase.yml Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…workflow A Slack failure (bad token, network error, wrong channel) would skip the post-release PR step, leaving the VERSION file stuck on the release version on main and causing @next builds to conflict with @latest. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| env: | ||
| COMMIT_MSG: ${{ github.event.head_commit.message }} | ||
| run: | | ||
| PR_NUMBER=$(echo "$COMMIT_MSG" | grep -oP '#\K[0-9]+' | head -1) |
There was a problem hiding this comment.
Hi @KevinDavilaDotCMS — nice addition, having the originating PR in the SDK announcement will be really useful. I think there's one edge case worth addressing here before merge.
GitHub Actions runs run: steps with bash --noprofile --norc -eo pipefail {0} by default. On this line:
PR_NUMBER=$(echo "$COMMIT_MSG" | grep -oP '#\K[0-9]+' | head -1)if grep finds no matches, it exits with status 1. With pipefail enabled, that non-zero status propagates through the pipeline and the whole step fails before reaching the if [ -n "$PR_NUMBER" ] check, so the SHA fallback in the else branch never gets a chance to run.
This matters in two scenarios:
- A
pushwhose head commit message simply has no#NNNreference. - Callers where
github.event.head_commit.messageis empty — e.g., theworkflow_dispatchpaths incicd_4-nightly.ymlandcicd_8-manual-deploy.yml, which also call this reusable workflow withpublish-npm-sdk-libsenabled.
Since the next Slack step is gated on if: success() && steps.sdks_publish.outputs.published == 'true', the practical effect is that no Slack notification is sent at all in those cases — the opposite of what the fallback is meant to do.
Minimal fix to let the fallback work as intended:
| PR_NUMBER=$(echo "$COMMIT_MSG" | grep -oP '#\K[0-9]+' | head -1) | |
| PR_NUMBER=$(echo "$COMMIT_MSG" | grep -oP '#\K[0-9]+' | head -1 || true) |
Thanks for picking this up!
There was a problem hiding this comment.
Good catch @dcolina! Fixed in the latest commit — added || true to let the SHA fallback run as intended when grep finds no match (including empty COMMIT_MSG on workflow_dispatch callers).
… Slack step - Add `|| true` to grep pipeline so a no-match exit code doesn't fail the step under bash pipefail, allowing the SHA fallback to run - Add `continue-on-error: true` to deployment-phase SDK Slack notification to match the guard already present in the manual release workflow Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Addressed the two actionable items from the reviews in the latest commit (
The remaining claude[bot] observations ( |
🔍 Platform Review — CI/CD
Domains scanned
[🔵 Info]
What looks good ✅
Legend — 🔴/🟠 fix before merge · 🟡 author triage · 🔵 advisory · updates on each push |
Here are examples of the types of messages
Auto-publish — next (PR merge)
▎ 🟠 Attention dotters: SDK libs (Angular, Client, Experiments and React) published!
▎
▎ This automated script is happy to announce that a new SDK libs version tagged as: [ 1.5.1-next.1965 (next) ] is now available on the NPM registry 📦!
▎ Introduced by: #35412
Manual release — patch
▎ 🟢 Attention dotters: SDK libs (Angular, Client, Experiments and React) officially released!
▎
▎ This automated script is happy to announce that a new SDK libs version tagged as: [ 1.5.2 (latest) and 1.5.2-next.1966 (next) ] is now available on the NPM registry 📦!
▎ Release type: patch | Triggered by: kevindavila
▎ View workflow run
Manual release — minor
▎ 🟢 Attention dotters: SDK libs (Angular, Client, Experiments and React) officially released!
▎
▎ This automated script is happy to announce that a new SDK libs version tagged as: [ 1.6.0 (latest) and 1.6.0-next.1970 (next) ] is now available on the NPM registry 📦!
▎ Release type: minor | Triggered by: kevindavila
▎ View workflow run
Manual release — major
▎ 🟢 Attention dotters: SDK libs (Angular, Client, Experiments and React) officially released!
▎
▎ This automated script is happy to announce that a new SDK libs version tagged as: [ 2.0.0 (latest) and 2.0.0-next.1975 (next) ] is now available on the NPM registry 📦!
▎ Release type: major | Triggered by: kevindavila
▎ View workflow run
Manual release — custom
▎ 🟢 Attention dotters: SDK libs (Angular, Client, Experiments and React) officially released!
▎
▎ This automated script is happy to announce that a new SDK libs version tagged as: [ 1.5.3 (latest) and 1.5.3-next.1980 (next) ] is now available on the NPM registry 📦!
▎ Release type: custom | Triggered by: kevindavila
▎ View workflow run