Skip to content

Internal - APM Java Slack release notification automation - #581

Open
cleverchuk wants to merge 1 commit into
mainfrom
cc/NH-124151
Open

Internal - APM Java Slack release notification automation#581
cleverchuk wants to merge 1 commit into
mainfrom
cc/NH-124151

Conversation

@cleverchuk

Copy link
Copy Markdown
Contributor

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-notification workflow job

A new job runs after github_release completes. It:

  1. Resolves the released version from the latest GitHub release tag
  2. Creates a JIRA Story ticket under the configured project (components: Instrumentation, Instrument Java; labels: Documentation, Documentation-APM, Documentation_changelog-APMJava) with the summary Java: Release Notes, v<version>
  3. Posts a Slack message to the configured channel with the release date, version, GitHub release URL, and the JIRA ticket URL

The JIRA step uses continue-on-error: true so a JIRA failure does not block the Slack notification.

create-jira-ticket.sh

Standalone 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. Uses jq for safe ADF (Atlassian Document Format) JSON construction to avoid shell-escaping issues.

notify-slack.sh

Standalone script that posts a chat.postMessage to Slack. Accepts <version>, <release-url>, and an optional [jira-url] argument. Formats the message as:

*<Month D, YYYY> - APM Java <version>*
<release-url>
*Jira:* <jira-url>   ← only when provided

Uses jq to safely encode the payload. Validates the Slack API response's ok field 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

Name Type Purpose
SLACK_TOKEN Secret Slack bot token
JIRA_API_TOKEN Secret JIRA API auth
JIRA_USER_EMAIL Secret JIRA basic-auth email
JIRA_ASSIGNEE_ID Secret Account ID for ticket assignee
SLACK_CHANNEL Variable Slack channel ID/name
JIRA_BASE_URL Variable JIRA instance base URL
JIRA_PROJECT_KEY Variable JIRA project key (e.g. NH)

Test services data

  1. e-1712644058766987264
  2. e-1712643928659124224
  3. e-1742334541200846848
  4. e-1777406072376840192

Copilot AI lite review requested due to automatic review settings August 21, 2026 19:57
@cleverchuk
cleverchuk requested review from a team as code owners August 21, 2026 19:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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-notification job to the release workflow that runs after github_release and sends notifications.
  • Introduced .github/scripts/create-jira-ticket.sh to create a JIRA Story via the REST API (v3) and output the ticket browse URL.
  • Introduced .github/scripts/notify-slack.sh to post a formatted chat.postMessage to 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

@tammy-baylis-swi tammy-baylis-swi left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants