Internal - APM Java Slack release notification automation - #581
Open
cleverchuk wants to merge 1 commit into
Open
Internal - APM Java Slack release notification automation#581cleverchuk wants to merge 1 commit into
cleverchuk wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds post-release automation to the existing GitHub Actions release pipeline by introducing a new job that (a) creates a JIRA release-notes Story and (b) posts a standardized Slack announcement after a GitHub release is published.
Changes:
- Added a new
release-notificationjob to the release workflow that runs aftergithub_releaseand sends notifications. - Introduced
.github/scripts/create-jira-ticket.shto create a JIRA Story via the REST API (v3) and output the ticket browse URL. - Introduced
.github/scripts/notify-slack.shto post a formattedchat.postMessageto Slack and fail on Slack API errors.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
.github/workflows/release.yml |
Adds a release-notification job that resolves the released version, creates a JIRA ticket, and posts a Slack message. |
.github/scripts/notify-slack.sh |
New script to build and send a Slack release announcement using jq for JSON encoding and validating Slack’s ok response. |
.github/scripts/create-jira-ticket.sh |
New script to create a JIRA Story using ADF JSON and print the created issue’s browse URL. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+57
to
+69
| RESPONSE=$(curl -sS \ | ||
| -X POST \ | ||
| -H "Content-Type: application/json" \ | ||
| -u "${JIRA_USER_EMAIL}:${JIRA_API_TOKEN}" \ | ||
| "${JIRA_BASE_URL}/rest/api/3/issue" \ | ||
| -d "$REQUEST_BODY") | ||
|
|
||
| ISSUE_KEY=$(echo "$RESPONSE" | jq -r '.key // empty') | ||
| if [[ -z "$ISSUE_KEY" ]]; then | ||
| echo "❌ Failed to create JIRA ticket:" >&2 | ||
| echo "$RESPONSE" | jq '.' >&2 | ||
| exit 1 | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
APM Java Slack Release Notification Automation
TLDR
Adds automated post-release notifications that post a Slack message and create a JIRA release ticket immediately after each GitHub release, replacing manual steps in the release process.
What Changed
New
release-notificationworkflow jobA new job runs after
github_releasecompletes. It:Instrumentation,Instrument Java; labels:Documentation,Documentation-APM,Documentation_changelog-APMJava) with the summaryJava: Release Notes, v<version>The JIRA step uses
continue-on-error: trueso a JIRA failure does not block the Slack notification.create-jira-ticket.shStandalone script that creates a JIRA Story via the REST API v3. Accepts
<version>and<description>positional arguments; all credentials come from environment variables (JIRA_BASE_URL,JIRA_USER_EMAIL,JIRA_API_TOKEN,JIRA_PROJECT_KEY,JIRA_ASSIGNEE_ID). Outputs the browse URL of the created ticket on stdout. Usesjqfor safe ADF (Atlassian Document Format) JSON construction to avoid shell-escaping issues.notify-slack.shStandalone script that posts a
chat.postMessageto Slack. Accepts<version>,<release-url>, and an optional[jira-url]argument. Formats the message as:Uses
jqto safely encode the payload. Validates the Slack API response'sokfield and exits non-zero on failure.Rationale
Previously, release communications (Slack announcement, JIRA release ticket) were handled manually after each release. Automating these steps reduces toil, ensures consistency in message format, and eliminates the risk of forgetting to notify.
Required Secrets / Variables
SLACK_TOKENJIRA_API_TOKENJIRA_USER_EMAILJIRA_ASSIGNEE_IDSLACK_CHANNELJIRA_BASE_URLJIRA_PROJECT_KEYNH)Test services data