[PM-32685] Send cherry-pick slack message to QA#7151
Conversation
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE Reviewed a new CI workflow ( The one open thread — Code Review DetailsNo new findings. The previously raised |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7151 +/- ##
=======================================
Coverage 86.49% 86.49%
=======================================
Files 908 908
Lines 65230 65230
Branches 9600 9600
=======================================
Hits 56422 56422
Misses 5365 5365
Partials 3443 3443
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| - name: Build message | ||
| id: msg | ||
| env: | ||
| COMMIT_URL: ${{ github.event.head_commit.url }} | ||
| COMMIT_SHA: ${{ github.event.head_commit.id }} | ||
| run: | | ||
| echo "text=:cherry-pick: <${COMMIT_URL}|${COMMIT_SHA}> into *${GITHUB_REF_NAME}*\ncc <!subteam^S022CDR7W2Z> <@U06538MSPJP>" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Send slack notification | ||
| uses: slackapi/slack-github-action@af78098f536edbc4de71162a307590698245be95 # v3.0.1 | ||
| with: | ||
| webhook: ${{ steps.retrieve-slack-secrets.outputs.SLACK-WEBHOOK-TEAM-ENG-MOBILE }} | ||
| webhook-type: incoming-webhook | ||
| payload: | | ||
| text: "${{ steps.msg.outputs.text }}" |
There was a problem hiding this comment.
❓ QUESTION: On workflow_dispatch, github.event.head_commit is null, so this sends a malformed message to QA.
Details
The if condition on line 18 (github.event_name != 'push' || ...) intentionally lets manual dispatch runs through. But on a workflow_dispatch event, github.event.head_commit is null, so COMMIT_URL and COMMIT_SHA resolve to empty strings. The resulting Slack message becomes:
:cherry-pick: <|> into *<branch>*
cc <!subteam^S022CDR7W2Z> <@U06538MSPJP>
i.e. an empty link <|> and no commit reference, which still pings @group-qa.
Is workflow_dispatch intended only for testing? If so, consider gating the message-build/send behind a push event, or populating the commit fields from github.sha as a fallback so a manual run doesn't ping QA with an empty commit link.
There was a problem hiding this comment.
It's for testing and will be removed later
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-32685
📔 Objective
When changed are cherry-picked to a
release/branch, a :cherry-pick: slack message pinging@group-qais generated with a link to the commit