Skip to content

Commit 6cd5085

Browse files
DEVEX-1653: flip Slack classifier to bright-line on_rt rule (Phase 3) (#149)
feat(slack): flip classifier to bright-line on_rt rule (Phase 3 of DEVEX-1653 badge) The DEVEX-1653 sweep completed (21 participant PRs merged 2026-07-09, plus the accept-only on_rt input in #148). Every participant's deploy chain now propagates on_rt to this workflow. Flip the classifier from tag-shape inference to bright-line on the declared intent: on_rt=true → 🚂 RT (only rt-promote.sh sets this) on_rt=false → ⚡ Hotfix (default — every other dispatch path) This fixes Sam's 2026-07-09 rc.8 case where a hotfix backport promoted manually via mis-badged as 🚂 RT because the tag matched the -rc.<date>.<iter> pattern. The tag pattern can't distinguish rc.1 (initial train ship) from rc.N>1 (hotfix backport) — only the dispatcher's intent knows. Depends on: - Every participant declaring on_rt on deploy-production.yaml (done — 21 sweep PRs merged) - Shared slack-deploy-notification.yaml declaring on_rt input (done — #148 merged as ab8282c) Companion PR (must merge in the same window): - encodium/actions: rt-promote.sh update to pass -f on_rt=true on each deploy-production.yaml dispatch. Between this PR's merge and the rt-promote.sh update landing, every prod deploy shows as ⚡ Hotfix — including next Thursday's train ship if rt-promote.sh hasn't been updated yet. That's the safe default (better to under-classify than to falsely-badge as RT), but keep the two PRs tight.
1 parent ab8282c commit 6cd5085

1 file changed

Lines changed: 24 additions & 17 deletions

File tree

.github/workflows/slack-deploy-notification.yaml

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,14 @@ on:
2121
type: string
2222
default: "https://app.datadoghq.com/services?env=production"
2323
on_rt:
24-
# Accepted but not yet consumed by the classifier — the current
25-
# step below still uses tag-shape inference. This input is
26-
# declared now so the 21 DEVEX-1653 sweep PRs (which pass
27-
# `on_rt: ${{ inputs.on_rt }}` from each participant's deploy
28-
# chain) don't hit "invalid input" once they land. A follow-up
29-
# PR flips the classifier to bright-line `on_rt=true → 🚂 RT,
30-
# else → ⚡ Hotfix` and drops the tag-inference fallback, after
31-
# rt-promote.sh is updated to pass `-f on_rt=true`.
32-
description: "true only when the deploy is dispatched by rt-promote.sh (coordinated train promote). Default false = hotfix / out-of-band. Reserved for use once the DEVEX-1653 sweep completes."
24+
# Consumed by the classify step below (bright-line rule since
25+
# the DEVEX-1653 sweep completed 2026-07-09):
26+
# on_rt=true → 🚂 RT (only rt-promote.sh sets this)
27+
# on_rt=false → ⚡ Hotfix (default — every other dispatch path)
28+
# This replaced tag-shape inference, which mis-badged rc.N>1
29+
# hotfix backport promotes as 🚂 RT (Sam's 2026-07-09 rc.8 case).
30+
# The dispatcher's intent is the source of truth, not the tag.
31+
description: "true only when the deploy is dispatched by rt-promote.sh (coordinated train promote). Default false = hotfix / out-of-band."
3332
type: boolean
3433
default: false
3534
required: false
@@ -41,26 +40,34 @@ jobs:
4140
notify:
4241
runs-on: ubuntu-latest
4342
steps:
44-
# Classify the deploy as Release Train (rt) or Hotfix based on the
45-
# image tag shape. RT deploys tag `vX.Y.Z-rc.YYYY-MM-DD.N` — the rc
46-
# suffix with a train-date is the tell. Everything else (plain
47-
# `vX.Y.Z` main deploys, feature-branch tags, ad-hoc) is treated
48-
# as a hotfix / out-of-band deploy.
43+
# Classify the deploy as Release Train (rt) or Hotfix from the
44+
# dispatcher's declared intent (inputs.on_rt), not the tag shape.
4945
#
5046
# Rationale (Peace Room 2026-07-09): during P0 triage the team needs
5147
# to quickly spot which prod deploys skipped the RT sign-off flow,
5248
# since hotfixes see less scrutiny and are more likely culprits.
49+
# The prior tag-inference version (v1 of this classifier) matched
50+
# every -rc.YYYY-MM-DD.N tag as RT — that mis-badged rc.N>1 hotfix
51+
# backport promotes (e.g. rt-promote.sh already shipped rc.1 on
52+
# Thursday; hotfix backport lands as rc.2 and is manually promoted
53+
# via `gh workflow run deploy-production.yaml`; that IS a hotfix
54+
# semantically, even though the tag pattern matches). Only the
55+
# dispatcher knows which is which. The 2026-07-09 DEVEX-1653 sweep
56+
# threaded `on_rt` through every participant's deploy chain so
57+
# rt-promote.sh can set it true and every other dispatch defaults
58+
# false.
59+
#
5360
# This runs unconditionally because the workflow is prod-only by
5461
# structural design — callers only invoke it from prod deploy
5562
# paths (deploy-eks.yaml → slack-notification), so every message
5663
# emitted here is a prod message.
5764
- name: Classify deploy type
5865
id: type
5966
env:
60-
IMAGE_TAG: ${{ inputs.image_tag }}
67+
ON_RT: ${{ inputs.on_rt }}
6168
run: |
6269
set -euo pipefail
63-
if [[ "$IMAGE_TAG" =~ -rc\.[0-9]{4}-[0-9]{2}-[0-9]{2}\.[0-9]+$ ]]; then
70+
if [[ "$ON_RT" == "true" ]]; then
6471
BADGE_MRKDWN="🚂 *RT*"
6572
BADGE_TEXT="🚂 RT"
6673
CLASSIFICATION="release-train"
@@ -69,7 +76,7 @@ jobs:
6976
BADGE_TEXT="⚡ Hotfix"
7077
CLASSIFICATION="hotfix"
7178
fi
72-
echo "Classified $IMAGE_TAG as $CLASSIFICATION"
79+
echo "on_rt=$ON_RT → classified as $CLASSIFICATION"
7380
{
7481
echo "badge_mrkdwn=$BADGE_MRKDWN"
7582
echo "badge_text=$BADGE_TEXT"

0 commit comments

Comments
 (0)