Skip to content

Commit 5db567a

Browse files
authored
feat: add automated Slack release notifications (#1045)
* docs: add release validation and announcement sections to release guide Add two new sections to the release guide: - Release Validation: documents the current approach (e2e tests) and includes a validation checklist for before publishing - Announce the Release: documents the Slack announcement process for #topic-cf-gitops-runtime and #team-support-announcements * feat: add automated Slack release notifications Add GitHub Actions workflow that posts to Slack when a release is published: - Posts to #topic-cf-gitops-runtime with release version and link - Cross-posts to #team-support-announcements - Includes workflow_dispatch trigger for manual testing Update release guide: - Document that announcements are now automated - Add troubleshooting section for Slack notifications - Add Slack integration setup instructions in Reference section
1 parent e26a982 commit 5db567a

File tree

2 files changed

+115
-6
lines changed

2 files changed

+115
-6
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# ABOUTME: GitHub Actions workflow that posts Slack notifications when a release is published.
2+
# ABOUTME: Notifies #topic-cf-gitops-runtime and cross-posts to #team-support-announcements.
3+
4+
name: Release Notification
5+
6+
on:
7+
release:
8+
types: [published]
9+
workflow_dispatch:
10+
inputs:
11+
tag:
12+
description: 'Release tag to simulate (e.g., 0.27.0)'
13+
required: true
14+
15+
jobs:
16+
notify-slack:
17+
runs-on: ubuntu-latest
18+
env:
19+
RELEASE_TAG: ${{ github.event.release.tag_name || inputs.tag }}
20+
RELEASE_URL: ${{ github.event.release.html_url || format('https://github.com/{0}/releases/tag/{1}', github.repository, inputs.tag) }}
21+
steps:
22+
- name: Notify #topic-cf-gitops-runtime
23+
uses: slackapi/[email protected]
24+
with:
25+
method: chat.postMessage
26+
token: ${{ secrets.SLACK_BOT_TOKEN }}
27+
payload: |
28+
channel: ${{ vars.SLACK_CHANNEL_GITOPS_RUNTIME }}
29+
text: "GitOps Runtime ${{ env.RELEASE_TAG }} has been released"
30+
blocks:
31+
- type: header
32+
text:
33+
type: plain_text
34+
text: "🚀 GitOps Runtime Release"
35+
- type: section
36+
fields:
37+
- type: mrkdwn
38+
text: "*Version:*\n${{ env.RELEASE_TAG }}"
39+
- type: actions
40+
elements:
41+
- type: button
42+
text:
43+
type: plain_text
44+
text: "View Release Notes"
45+
url: ${{ env.RELEASE_URL }}
46+
47+
- name: Cross-post to #team-support-announcements
48+
uses: slackapi/[email protected]
49+
with:
50+
method: chat.postMessage
51+
token: ${{ secrets.SLACK_BOT_TOKEN }}
52+
payload: |
53+
channel: ${{ vars.SLACK_CHANNEL_SUPPORT_ANNOUNCEMENTS }}
54+
text: "GitOps Runtime ${{ env.RELEASE_TAG }} has been released"
55+
blocks:
56+
- type: section
57+
text:
58+
type: mrkdwn
59+
text: "*GitOps Runtime ${{ env.RELEASE_TAG }}* has been released.\n\n<${{ env.RELEASE_URL }}|View release notes>"

docs/RELEASE_GUIDE.md

Lines changed: 56 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ The instructions below explain how to do everything manually if you prefer that
1818
2. [Prerequisites](#prerequisites)
1919
3. [Release Types](#release-types)
2020
4. [Creating a New Minor Release](#creating-a-new-minor-release)
21-
5. [Publishing a Release](#publishing-a-release)
22-
6. [Creating a Patch Release](#creating-a-patch-release)
23-
7. [Cherry-Picking Fixes](#cherry-picking-fixes)
24-
8. [Writing Release Notes](#writing-release-notes)
25-
9. [Troubleshooting](#troubleshooting)
26-
10. [Reference](#reference)
21+
5. [Release Validation](#release-validation)
22+
6. [Publishing a Release](#publishing-a-release)
23+
7. [Creating a Patch Release](#creating-a-patch-release)
24+
8. [Cherry-Picking Fixes](#cherry-picking-fixes)
25+
9. [Writing Release Notes](#writing-release-notes)
26+
10. [Troubleshooting](#troubleshooting)
27+
11. [Reference](#reference)
2728
2829
---
2930
@@ -141,6 +142,27 @@ Or visit:
141142
142143
---
143144
145+
## Release Validation
146+
147+
After the prepare-release PR is automatically created and before publishing the release, the release should be validated to ensure stability.
148+
149+
### Current Approach
150+
151+
The CI pipeline runs e2e tests on every PR. If these tests pass, the release is considered validated and ready to publish.
152+
153+
> **Note**: Previously, releases were validated by deploying to staging environments and letting them run for a period before publishing. This approach is no longer in use. If additional validation is needed in the future, consider introducing a manual testing stage or dedicated validation environments.
154+
155+
### Validation Checklist
156+
157+
Before publishing, ensure:
158+
159+
- [ ] All CI checks pass (unit tests, linting, e2e tests)
160+
- [ ] The prepare-release PR has been reviewed
161+
- [ ] Release notes accurately reflect the changes
162+
- [ ] No known critical issues exist in the changes being released
163+
164+
---
165+
144166
## Publishing a Release
145167
146168
### Step 1: Check PR Status
@@ -186,6 +208,14 @@ Check the release:
186208
gh release view 0.27.0 --repo codefresh-io/gitops-runtime-helm
187209
```
188210
211+
### Step 5: Announcement (Automated)
212+
213+
When a release is published, a GitHub Actions workflow automatically posts announcements to:
214+
- `#topic-cf-gitops-runtime` - Primary announcement with release version and link
215+
- `#team-support-announcements` - Cross-post for the support team
216+
217+
No manual action required. If notifications don't appear, see [Troubleshooting: Slack Notifications Not Sent](#slack-notifications-not-sent).
218+
189219
---
190220
191221
## Creating a Patch Release
@@ -388,6 +418,25 @@ git push --force-with-lease
388418
gh release edit 0.27.0 --repo codefresh-io/gitops-runtime-helm --draft=false
389419
```
390420
421+
### Slack Notifications Not Sent
422+
423+
**Symptom**: Release published but no Slack notifications appeared
424+
425+
**Check**:
426+
1. Verify the `release-notification` workflow ran:
427+
- Go to Actions tab → "Release Notification" workflow
428+
- Check for failed runs
429+
2. If workflow failed, check for:
430+
- Missing `SLACK_BOT_TOKEN` secret
431+
- Missing `SLACK_CHANNEL_GITOPS_RUNTIME` or `SLACK_CHANNEL_SUPPORT_ANNOUNCEMENTS` variables
432+
- Bot not invited to the channels
433+
3. Manual fallback - post manually to Slack:
434+
```
435+
🚀 GitOps Runtime vX.Y.Z has been released!
436+
437+
Release notes: https://github.com/codefresh-io/gitops-runtime-helm/releases/tag/X.Y.Z
438+
```
439+
391440
---
392441
393442
## Reference
@@ -428,6 +477,7 @@ git push --force-with-lease
428477
|------|---------|
429478
| `charts/gitops-runtime/Chart.yaml` | Version, changelog annotations |
430479
| `charts/gitops-runtime/values.yaml` | Component versions, defaults |
480+
| `.github/workflows/release-notification.yaml` | Slack release announcements |
431481
432482
---
433483

0 commit comments

Comments
 (0)