Skip to content

feat: replace Mattermost Jenkins build notifications with Pub/Sub chat notifications - #1580

Merged
KeijiBranshi merged 1 commit into
mainfrom
keijibranshi/feat/jenkins-gchat-notifications
Dec 3, 2026
Merged

KeijiBranshi merged 1 commit into
mainfrom
keijibranshi/feat/jenkins-gchat-notifications

Conversation

@KeijiBranshi

@KeijiBranshi KeijiBranshi commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

At HEAD, main branch build results (failed / passed / aborted) go to the #kernelops Mattermost channel via mattermostSend, and other branches post to #builds.

This drops Mattermost entirely. main branch notifications now go to Google Chat: the build publishes a JSON message to the chat-notifications Pub/Sub topic, and an internal relay delivers it to the kernelops channel. Non-main branches no longer send any notification.

  • Remove MATTERMOST_CHANNEL and the now-unused GIT_COMMIT_SUMMARY from environment {}
  • Add a notifyChat(status, color, outcome) helper. It builds the payload with python3/json.dumps, which safely escapes commit subjects and author names, and publishes it with gcloud pubsub topics publish
  • post { failure / success / aborted } calls notifyChat only when env.GIT_BRANCH == 'main'. mattermostSend is removed
  • A failed publish logs a warning instead of failing the build

Verification

  • bash -n on the extracted sh block
  • Ran the payload builder with normal, adversarial-quoting ("$(rm -rf /)" 'single' \backslash\), and empty env vars. Output is valid JSON with the expected channel, status, color, text and links
  • Ran the full shell block against a stub gcloud for both the success path and the publish-failure warning path
  • No mattermostSend, MATTERMOST_CHANNEL or GIT_COMMIT_SUMMARY remains in Jenkinsfile

TAG=agy
CONV=8b51716c-7fff-43b9-b933-713ce8bf908b

…t notifications

At HEAD, main-branch build results go to the `#kernelops` Mattermost channel and other branches post to `#builds`.

- Remove `MATTERMOST_CHANNEL` and the now-unused `GIT_COMMIT_SUMMARY` from `environment {}`
- Add `notifyChat` helper that publishes a JSON payload with `channel: kernelops` to the `chat-notifications` topic
- Call `notifyChat` from `post` on `main` only; drop `mattermostSend` so other branches send no notification

TAG=agy
CONV=8b51716c-7fff-43b9-b933-713ce8bf908b
@KeijiBranshi
KeijiBranshi force-pushed the keijibranshi/feat/jenkins-gchat-notifications branch from 03f5a52 to 003e4f6 Compare December 3, 2026 22:39
@KeijiBranshi KeijiBranshi changed the title feat: send main-branch Jenkins build notifications via Pub/Sub chat notifications feat: replace Mattermost Jenkins build notifications with Pub/Sub chat notifications Dec 3, 2026
Comment thread Jenkinsfile Resolved
@KeijiBranshi
KeijiBranshi merged commit 47c3d74 into main Dec 3, 2026
8 checks passed
@KeijiBranshi
KeijiBranshi deleted the keijibranshi/feat/jenkins-gchat-notifications branch December 3, 2026 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants