diff --git a/.eslintrc.js b/.eslintrc.js
index d8fef75a..68b24a64 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -45,6 +45,15 @@ module.exports = {
},
},
+ {
+ files: ['.github/actions/release-slack-summaries/**/*.mjs'],
+ // The composite action passes inputs through the environment, same as
+ // the scripts under .github/scripts.
+ rules: {
+ 'n/no-process-env': 'off',
+ },
+ },
+
{
files: ['.github/scripts/**/*.test.mts'],
rules: {
diff --git a/.github/actions/release-slack-summaries/action.yml b/.github/actions/release-slack-summaries/action.yml
new file mode 100644
index 00000000..1d2d511c
--- /dev/null
+++ b/.github/actions/release-slack-summaries/action.yml
@@ -0,0 +1,139 @@
+name: Release Slack summaries
+description: >-
+ Posts the daily release blocker summary (Zap 596) or release validation
+ summary (Zap 597) to Slack. Jira is read-only. The caller passes short-lived
+ GitHub tokens from `.github/actions/get-token`; this action does not mint
+ tokens. Dry-run defaults to true and writes the message to the job summary.
+ The release PR checklist is rewritten only when allow-pr-write is true,
+ dry-run is false, and test-channel is empty. A test channel never writes
+ a pull request body.
+
+inputs:
+ mode:
+ description: 'blocker-summary (Zap 596) or release-validation (Zap 597).'
+ required: true
+ platform:
+ description: 'extension or mobile.'
+ required: true
+ github-token:
+ description: >-
+ Short-lived token for the client repository (pull_requests: write, or
+ read for blocker-summary). Obtained by the caller via get-token.
+ required: true
+ planning-token:
+ description: >-
+ Short-lived contents: read token for MetaMask/MetaMask-planning
+ (topology.json). Obtained by the caller via get-token.
+ required: true
+ slack-bot-token:
+ description: Existing SLACK_BOT_TOKEN secret. Used only when dry-run is false.
+ required: true
+ jira-base-url:
+ description: Jira site origin. Read-only search.
+ required: false
+ default: https://consensyssoftware.atlassian.net
+ jira-email:
+ description: >-
+ Atlassian account email for the read-only Jira token (POC secret
+ JIRA_EMAIL in the release-notifications environment).
+ required: true
+ jira-api-token:
+ description: >-
+ Read-only Jira API token (POC secret JIRA_API_TOKEN). Never written back
+ to Jira.
+ required: true
+ jira-release-blocker-jql:
+ description: >-
+ Base JQL for release blockers. The saved filter is not created yet: leave
+ this empty and the step logs OPEN and skips the blocker section. Per
+ release the action appends AND cf[14565] = "V".
+ required: false
+ default: ''
+ jira-regression-jql:
+ description: >-
+ Optional base JQL for Found-in regressions. Empty uses the v10 proposal
+ default (issuetype = Bug, project in the §4 list) and the action appends
+ AND cf[16946] = "V". OPEN until the field id and project list are confirmed.
+ required: false
+ default: ''
+ topology-jira-project-field:
+ description: >-
+ topology.json field holding Jira project keys. PROPOSED name jiraProject
+ (array or string). OPEN until the schema change lands. Missing keys do
+ not guess a team.
+ required: false
+ default: jiraProject
+ test-channel:
+ description: >-
+ When set, post only to this channel and do not write any release PR body,
+ even if allow-pr-write is true. Real release channels are not used.
+ required: false
+ default: ''
+ dry-run:
+ description: >-
+ Default true. Build the Slack message and any PR-body diff into the job
+ summary. Post nothing and write nothing.
+ required: false
+ default: 'true'
+ allow-pr-write:
+ description: >-
+ Default false. Zap 597 rewrites the release PR checklist only when this
+ is true, dry-run is false, and test-channel is empty. Blocker summary
+ never writes.
+ required: false
+ default: 'false'
+ github-tools-repository:
+ description: Repository that contains this action. Defaults to the action repository.
+ required: false
+ default: ${{ github.action_repository }}
+ github-tools-ref:
+ description: Git ref of github-tools to check out. Defaults to the current action ref.
+ required: false
+ default: ${{ github.action_ref }}
+
+runs:
+ using: composite
+ steps:
+ - name: Checkout GitHub tools repository
+ uses: actions/checkout@v6
+ with:
+ repository: ${{ inputs.github-tools-repository }}
+ ref: ${{ inputs.github-tools-ref }}
+ path: ./github-tools
+
+ - name: Set up Node.js
+ uses: actions/setup-node@v6
+ with:
+ node-version-file: ./github-tools/.nvmrc
+ cache-dependency-path: ./github-tools/yarn.lock
+ cache: yarn
+
+ - name: Enable Corepack
+ shell: bash
+ run: corepack enable
+ working-directory: ./github-tools
+
+ - name: Install dependencies
+ working-directory: ./github-tools
+ shell: bash
+ run: yarn --immutable
+
+ - name: Post release Slack summaries
+ working-directory: ./github-tools
+ shell: bash
+ env:
+ MODE: ${{ inputs.mode }}
+ PLATFORM: ${{ inputs.platform }}
+ GITHUB_TOKEN: ${{ inputs.github-token }}
+ PLANNING_TOKEN: ${{ inputs.planning-token }}
+ SLACK_BOT_TOKEN: ${{ inputs.slack-bot-token }}
+ JIRA_BASE_URL: ${{ inputs.jira-base-url }}
+ JIRA_EMAIL: ${{ inputs.jira-email }}
+ JIRA_API_TOKEN: ${{ inputs.jira-api-token }}
+ JIRA_RELEASE_BLOCKER_JQL: ${{ inputs.jira-release-blocker-jql }}
+ JIRA_REGRESSION_JQL: ${{ inputs.jira-regression-jql }}
+ TOPOLOGY_JIRA_PROJECT_FIELD: ${{ inputs.topology-jira-project-field }}
+ TEST_CHANNEL: ${{ inputs.test-channel }}
+ DRY_RUN: ${{ inputs.dry-run }}
+ ALLOW_PR_WRITE: ${{ inputs.allow-pr-write }}
+ run: node .github/actions/release-slack-summaries/run.mjs
diff --git a/.github/actions/release-slack-summaries/adapter.test.mjs b/.github/actions/release-slack-summaries/adapter.test.mjs
new file mode 100644
index 00000000..fbaef27c
--- /dev/null
+++ b/.github/actions/release-slack-summaries/adapter.test.mjs
@@ -0,0 +1,127 @@
+import assert from 'node:assert/strict';
+import { readFileSync } from 'node:fs';
+import { describe, it } from 'node:test';
+
+import { jiraIssueToRcBug, mergeJiraIssues } from './lib/adapter.mjs';
+import { indexTeams } from './lib/teams.mjs';
+
+const BROWSE = 'https://consensyssoftware.atlassian.net';
+
+/**
+ * Reads one fixture shipped with this action.
+ *
+ * @param {string} name - Fixture file name.
+ * @returns {string} File contents.
+ */
+function fixture(name) {
+ return readFileSync(new URL(`./fixtures/${name}`, import.meta.url), 'utf8');
+}
+
+describe('jiraIssueToRcBug', () => {
+ it('maps an open unassigned issue and omits the team label when none is known', () => {
+ const bug = jiraIssueToRcBug(
+ {
+ key: 'PRED-4',
+ fields: {
+ summary: 'Unmapped project blocker',
+ assignee: null,
+ project: { key: 'PRED' },
+ status: { statusCategory: { key: 'new' } },
+ },
+ },
+ { teamLabel: undefined, inBlockersSet: true, browseBaseUrl: BROWSE },
+ );
+
+ assert.deepEqual(bug, {
+ key: 'PRED-4',
+ projectKey: 'PRED',
+ name: 'Unmapped project blocker',
+ url: 'https://consensyssoftware.atlassian.net/browse/PRED-4',
+ closed: 'false',
+ assigneesLength: 0,
+ labels: ['release-blocker'],
+ });
+ });
+
+ it('marks Done issues closed and keeps a single team label', () => {
+ const bug = jiraIssueToRcBug(
+ {
+ key: 'CEUX-3',
+ fields: {
+ summary: 'Closed regression',
+ assignee: { displayName: 'Cy' },
+ project: { key: 'CEUX' },
+ status: { statusCategory: { key: 'done' } },
+ },
+ },
+ {
+ teamLabel: 'team-extension-platform',
+ inBlockersSet: false,
+ browseBaseUrl: `${BROWSE}/`,
+ },
+ );
+
+ assert.equal(bug.closed, 'true');
+ assert.equal(bug.assigneesLength, 1);
+ assert.deepEqual(bug.labels, ['team-extension-platform']);
+ assert.equal(
+ bug.url,
+ 'https://consensyssoftware.atlassian.net/browse/CEUX-3',
+ );
+ });
+});
+
+describe('mergeJiraIssues', () => {
+ it('dedupes by key and adds release-blocker only for the blocker set', () => {
+ const issues = JSON.parse(fixture('jira-issues.json'));
+ const { projectToLabel } = indexTeams(
+ JSON.parse(fixture('topology.json')),
+ 'jiraProject',
+ );
+ const bugs = mergeJiraIssues(issues.regressions, issues.blockers, {
+ teamLabelFor: (projectKey) => projectToLabel[projectKey],
+ browseBaseUrl: BROWSE,
+ });
+
+ assert.deepEqual(
+ bugs.map((bug) => bug.key),
+ ['ASSETS-1', 'ASSETS-2', 'DSYS-9', 'PRED-4', 'CEUX-3'],
+ );
+ const login = bugs.find((bug) => bug.key === 'ASSETS-1');
+ assert.deepEqual(login.labels, [
+ 'team-extension-platform',
+ 'release-blocker',
+ ]);
+ assert.equal(login.closed, 'false');
+ assert.equal(login.assigneesLength, 0);
+ const icon = bugs.find((bug) => bug.key === 'ASSETS-2');
+ assert.deepEqual(icon.labels, ['team-extension-platform']);
+ assert.equal(bugs.find((bug) => bug.key === 'PRED-4').projectKey, 'PRED');
+ assert.equal(bugs.find((bug) => bug.key === 'CEUX-3').closed, 'true');
+ });
+
+ it('keeps a blocker that the regression search did not return', () => {
+ const bugs = mergeJiraIssues(
+ [],
+ [
+ {
+ key: 'SWAPS-1',
+ fields: {
+ summary: 'Swap halt',
+ assignee: { displayName: 'Dee' },
+ project: { key: 'SWAPS' },
+ status: { statusCategory: { key: 'indeterminate' } },
+ },
+ },
+ ],
+ {
+ teamLabelFor: () => undefined,
+ browseBaseUrl: BROWSE,
+ },
+ );
+
+ assert.equal(bugs.length, 1);
+ assert.deepEqual(bugs[0].labels, ['release-blocker']);
+ assert.equal(bugs[0].projectKey, 'SWAPS');
+ });
+});
diff --git a/.github/actions/release-slack-summaries/fixtures/build-comment.html b/.github/actions/release-slack-summaries/fixtures/build-comment.html
new file mode 100644
index 00000000..0e42baf7
--- /dev/null
+++ b/.github/actions/release-slack-summaries/fixtures/build-comment.html
@@ -0,0 +1,3 @@
+
Builds ready for testing.
+chrome
+firefox
diff --git a/.github/actions/release-slack-summaries/fixtures/jira-issues.json b/.github/actions/release-slack-summaries/fixtures/jira-issues.json
new file mode 100644
index 00000000..e14b92e3
--- /dev/null
+++ b/.github/actions/release-slack-summaries/fixtures/jira-issues.json
@@ -0,0 +1,78 @@
+{
+ "regressions": [
+ {
+ "key": "ASSETS-1",
+ "fields": {
+ "summary": "Login crash",
+ "assignee": null,
+ "project": { "key": "ASSETS" },
+ "status": { "statusCategory": { "key": "indeterminate" } }
+ }
+ },
+ {
+ "key": "ASSETS-2",
+ "fields": {
+ "summary": "Icon glitch",
+ "assignee": { "displayName": "Ada" },
+ "project": { "key": "ASSETS" },
+ "status": { "statusCategory": { "key": "indeterminate" } }
+ }
+ },
+ {
+ "key": "DSYS-9",
+ "fields": {
+ "summary": "Token icon blocks sign-off",
+ "assignee": { "displayName": "Bea" },
+ "project": { "key": "DSYS" },
+ "status": { "statusCategory": { "key": "indeterminate" } }
+ }
+ },
+ {
+ "key": "PRED-4",
+ "fields": {
+ "summary": "Unmapped project blocker",
+ "assignee": null,
+ "project": { "key": "PRED" },
+ "status": { "statusCategory": { "key": "new" } }
+ }
+ },
+ {
+ "key": "CEUX-3",
+ "fields": {
+ "summary": "Closed regression",
+ "assignee": { "displayName": "Cy" },
+ "project": { "key": "CEUX" },
+ "status": { "statusCategory": { "key": "done" } }
+ }
+ }
+ ],
+ "blockers": [
+ {
+ "key": "ASSETS-1",
+ "fields": {
+ "summary": "Login crash",
+ "assignee": null,
+ "project": { "key": "ASSETS" },
+ "status": { "statusCategory": { "key": "indeterminate" } }
+ }
+ },
+ {
+ "key": "DSYS-9",
+ "fields": {
+ "summary": "Token icon blocks sign-off",
+ "assignee": { "displayName": "Bea" },
+ "project": { "key": "DSYS" },
+ "status": { "statusCategory": { "key": "indeterminate" } }
+ }
+ },
+ {
+ "key": "PRED-4",
+ "fields": {
+ "summary": "Unmapped project blocker",
+ "assignee": null,
+ "project": { "key": "PRED" },
+ "status": { "statusCategory": { "key": "new" } }
+ }
+ }
+ ]
+}
diff --git a/.github/actions/release-slack-summaries/fixtures/release-pr-body.md b/.github/actions/release-slack-summaries/fixtures/release-pr-body.md
new file mode 100644
index 00000000..5a4ce382
--- /dev/null
+++ b/.github/actions/release-slack-summaries/fixtures/release-pr-body.md
@@ -0,0 +1,11 @@
+## Summary
+
+Testing plan: https://docs.google.com/spreadsheets/d/SHEETID/edit?gid=99#gid=99
+
+# Team sign-off checklist
+
+- [x] Mobile Platform
+- [ ] Extension Platform
+- [x] QA Team
+
+Follow the checklist before release.
diff --git a/.github/actions/release-slack-summaries/fixtures/topology.json b/.github/actions/release-slack-summaries/fixtures/topology.json
new file mode 100644
index 00000000..8c5486cc
--- /dev/null
+++ b/.github/actions/release-slack-summaries/fixtures/topology.json
@@ -0,0 +1,42 @@
+{
+ "team-extension-platform": {
+ "name": "Extension Platform team",
+ "slackHandle": {
+ "releaseContact": "@release-contact-extension-platform"
+ },
+ "githubLabel": {
+ "name": "team-extension-platform"
+ },
+ "jiraProject": ["ASSETS"]
+ },
+ "team-mobile-platform": {
+ "name": "Mobile Platform team",
+ "slackHandle": {
+ "releaseContact": "@release-contact-mobile-platform"
+ },
+ "githubLabel": {
+ "name": "team-mobile-platform"
+ },
+ "jiraProject": "MOBILE"
+ },
+ "team-design-system": {
+ "name": "Design System team",
+ "slackHandle": {
+ "releaseContact": "@release-contact-design-system"
+ },
+ "githubLabel": {
+ "name": "team-design-system"
+ },
+ "jiraProject": ["DSYS"]
+ },
+ "team-qa": {
+ "name": "QA Team",
+ "slackHandle": {
+ "releaseContact": "@release-contact-qa"
+ },
+ "githubLabel": {
+ "name": "team-qa"
+ },
+ "jiraProject": ["QA"]
+ }
+}
diff --git a/.github/actions/release-slack-summaries/gates.test.mjs b/.github/actions/release-slack-summaries/gates.test.mjs
new file mode 100644
index 00000000..1932fe73
--- /dev/null
+++ b/.github/actions/release-slack-summaries/gates.test.mjs
@@ -0,0 +1,205 @@
+import assert from 'node:assert/strict';
+import { readFileSync } from 'node:fs';
+import { describe, it } from 'node:test';
+import { parse } from 'yaml';
+
+import {
+ isDryRun,
+ isPrWriteAllowed,
+ postChannel,
+ shouldWriteReleasePr,
+} from './lib/gates.mjs';
+import { indexTeams } from './lib/teams.mjs';
+import { readConfig } from './run.mjs';
+
+/**
+ * Builds a config object using the safe defaults.
+ *
+ * @param {object} [overrides] - Env overrides.
+ * @returns {object} Parsed config.
+ */
+function config(overrides = {}) {
+ return readConfig({
+ MODE: 'blocker-summary',
+ PLATFORM: 'extension',
+ GITHUB_TOKEN: 'github',
+ PLANNING_TOKEN: 'planning',
+ SLACK_BOT_TOKEN: 'slack',
+ JIRA_EMAIL: 'victor@example.com',
+ JIRA_API_TOKEN: 'jira',
+ ...overrides,
+ });
+}
+
+describe('safe defaults', () => {
+ it('dry-run is on and PR writes are off unless the caller opts in', () => {
+ assert.equal(isDryRun(undefined), true);
+ assert.equal(isDryRun(''), true);
+ assert.equal(isDryRun('true'), true);
+ assert.equal(isDryRun('false'), false);
+ assert.equal(isDryRun('FALSE'), false);
+ assert.equal(isPrWriteAllowed(undefined), false);
+ assert.equal(isPrWriteAllowed('false'), false);
+ assert.equal(isPrWriteAllowed('yes'), false);
+ assert.equal(isPrWriteAllowed('true'), true);
+
+ const defaults = config();
+ assert.equal(defaults.dryRun, true);
+ assert.equal(defaults.allowPrWrite, false);
+ assert.equal(defaults.jiraReleaseBlockerJql, '');
+ assert.equal(defaults.topologyJiraProjectField, 'jiraProject');
+ assert.equal(
+ defaults.jiraBaseUrl,
+ 'https://consensyssoftware.atlassian.net',
+ );
+ assert.equal(
+ shouldWriteReleasePr({
+ mode: 'release-validation',
+ dryRun: defaults.dryRun,
+ allowPrWrite: defaults.allowPrWrite,
+ }),
+ false,
+ );
+ assert.equal(
+ shouldWriteReleasePr({
+ mode: 'release-validation',
+ dryRun: false,
+ allowPrWrite: false,
+ }),
+ false,
+ );
+ assert.equal(
+ shouldWriteReleasePr({
+ mode: 'blocker-summary',
+ dryRun: false,
+ allowPrWrite: true,
+ }),
+ false,
+ );
+ assert.equal(
+ shouldWriteReleasePr({
+ mode: 'release-validation',
+ dryRun: false,
+ allowPrWrite: true,
+ }),
+ true,
+ );
+ assert.equal(
+ shouldWriteReleasePr({
+ mode: 'release-validation',
+ dryRun: false,
+ allowPrWrite: true,
+ testChannel: '#release-summary-test',
+ }),
+ false,
+ );
+ assert.equal(
+ shouldWriteReleasePr({
+ mode: 'release-validation',
+ dryRun: false,
+ allowPrWrite: true,
+ testChannel: ' ',
+ }),
+ true,
+ );
+ });
+
+ it('posts only to the test channel when one is set', () => {
+ assert.equal(
+ postChannel('release-extension-13-53-0', ''),
+ 'release-extension-13-53-0',
+ );
+ assert.equal(
+ postChannel('release-extension-13-53-0', '#release-summary-test'),
+ '#release-summary-test',
+ );
+ });
+});
+
+describe('topology jira projects', () => {
+ it('reads an array or a string and does not invent keys that are absent', () => {
+ const topology = JSON.parse(
+ readFileSync(
+ new URL('./fixtures/topology.json', import.meta.url),
+ 'utf8',
+ ),
+ );
+ const indexed = indexTeams(topology, 'jiraProject');
+ assert.equal(indexed.projectToLabel.ASSETS, 'team-extension-platform');
+ assert.equal(indexed.projectToLabel.MOBILE, 'team-mobile-platform');
+ assert.equal(indexed.projectToLabel.DSYS, 'team-design-system');
+ assert.equal(indexed.projectToLabel.PRED, undefined);
+ assert.deepEqual(indexed.teams['team-qa'].jiraProjects, ['QA']);
+ assert.equal(indexed.warnings.length, 0);
+
+ const unnamed = indexTeams(topology, '');
+ assert.deepEqual(unnamed.projectToLabel, {});
+ });
+
+ it('keeps the first team when two teams claim one project', () => {
+ const indexed = indexTeams(
+ {
+ a: {
+ name: 'A team',
+ githubLabel: { name: 'team-a' },
+ slackHandle: { releaseContact: '@a' },
+ jiraProject: ['ASSETS'],
+ },
+ b: {
+ name: 'B team',
+ githubLabel: { name: 'team-b' },
+ slackHandle: { releaseContact: '@b' },
+ jiraProject: ['ASSETS'],
+ },
+ },
+ 'jiraProject',
+ );
+ assert.equal(indexed.projectToLabel.ASSETS, 'team-a');
+ assert.equal(indexed.warnings.length, 1);
+ });
+});
+
+describe('action.yml', () => {
+ it('exposes the shared interface and the safe defaults', () => {
+ const action = parse(
+ readFileSync(new URL('./action.yml', import.meta.url), 'utf8'),
+ );
+ assert.equal(action.runs.using, 'composite');
+ const { inputs } = action;
+ for (const name of [
+ 'mode',
+ 'platform',
+ 'github-token',
+ 'planning-token',
+ 'slack-bot-token',
+ 'jira-base-url',
+ 'jira-email',
+ 'jira-api-token',
+ 'jira-release-blocker-jql',
+ 'test-channel',
+ 'dry-run',
+ 'allow-pr-write',
+ ]) {
+ assert.ok(inputs[name], `missing input ${name}`);
+ }
+ assert.equal(inputs['dry-run'].default, 'true');
+ assert.equal(inputs['allow-pr-write'].default, 'false');
+ assert.equal(
+ inputs['jira-base-url'].default,
+ 'https://consensyssoftware.atlassian.net',
+ );
+ assert.equal(inputs['jira-release-blocker-jql'].default, '');
+ assert.equal(inputs['test-channel'].default, '');
+ const runStep = action.runs.steps.find((step) =>
+ String(step.run || '').includes('release-slack-summaries/run.mjs'),
+ );
+ assert.ok(runStep);
+ const inputExpr = (name) => ['$', '{', '{ inputs.', name, ' }}'].join('');
+ assert.equal(runStep.env.DRY_RUN, inputExpr('dry-run'));
+ assert.equal(runStep.env.ALLOW_PR_WRITE, inputExpr('allow-pr-write'));
+ assert.equal(
+ runStep.env.JIRA_RELEASE_BLOCKER_JQL,
+ inputExpr('jira-release-blocker-jql'),
+ );
+ });
+});
diff --git a/.github/actions/release-slack-summaries/jira.test.mjs b/.github/actions/release-slack-summaries/jira.test.mjs
new file mode 100644
index 00000000..3cff44eb
--- /dev/null
+++ b/.github/actions/release-slack-summaries/jira.test.mjs
@@ -0,0 +1,129 @@
+import assert from 'node:assert/strict';
+import { describe, it } from 'node:test';
+
+import {
+ DEFAULT_REGRESSION_JQL_BASE,
+ buildBlockerJql,
+ buildRegressionJql,
+ projectScopedJql,
+ searchJiraIssues,
+ usesDefaultRegressionJql,
+} from './lib/jira.mjs';
+
+describe('JQL builders', () => {
+ it('skips blockers when the filter JQL is empty and appends the release number when it is set', () => {
+ assert.equal(buildBlockerJql('13.53.0', ''), null);
+ assert.equal(buildBlockerJql('13.53.0', ' '), null);
+ assert.equal(
+ buildBlockerJql('13.53.0', 'filter = 12345'),
+ 'filter = 12345 AND cf[14565] = "13.53.0"',
+ );
+ });
+
+ it('uses the proposal regression JQL until a caller overrides it', () => {
+ assert.equal(usesDefaultRegressionJql(''), true);
+ const jql = buildRegressionJql('13.53.1', '');
+ assert.equal(
+ jql,
+ `${DEFAULT_REGRESSION_JQL_BASE} AND cf[16946] = "13.53.1"`,
+ );
+ assert.match(jql, /project in \(MUL, ASSETS,/u);
+ assert.equal(
+ buildRegressionJql('8.19.0', 'project = ASSETS'),
+ 'project = ASSETS AND cf[16946] = "8.19.0"',
+ );
+ });
+
+ it('refuses to interpolate a release number that is not X.Y.Z', () => {
+ assert.throws(() => buildBlockerJql('latest', 'filter = 1'), /unexpected/u);
+ assert.throws(() => buildRegressionJql('13.53', ''), /unexpected/u);
+ });
+
+ it('scopes a team link by one project or by project in (...)', () => {
+ assert.equal(projectScopedJql('filter = 1', []), 'filter = 1');
+ assert.equal(
+ projectScopedJql('filter = 1', ['ASSETS']),
+ 'filter = 1 AND project = ASSETS',
+ );
+ assert.equal(
+ projectScopedJql('filter = 1', ['ASSETS', 'CEUX']),
+ 'filter = 1 AND project in (ASSETS, CEUX)',
+ );
+ });
+});
+
+describe('searchJiraIssues', () => {
+ it('follows nextPageToken and stops on the last page', async () => {
+ const seen = [];
+ const fetchImpl = async (url, options) => {
+ const body = JSON.parse(options.body);
+ seen.push({ url, body, authorization: options.headers.Authorization });
+ if (!body.nextPageToken) {
+ return {
+ ok: true,
+ json: async () => ({
+ issues: [{ key: 'ASSETS-1' }],
+ nextPageToken: 'page-2',
+ isLast: false,
+ }),
+ };
+ }
+ return {
+ ok: true,
+ json: async () => ({
+ issues: [{ key: 'ASSETS-2' }],
+ isLast: true,
+ }),
+ };
+ };
+
+ const issues = await searchJiraIssues({
+ baseUrl: 'https://consensyssoftware.atlassian.net/',
+ email: 'victor@example.com',
+ apiToken: 'secret-token',
+ jql: 'issuetype = Bug',
+ fetchImpl,
+ });
+
+ assert.deepEqual(
+ issues.map((issue) => issue.key),
+ ['ASSETS-1', 'ASSETS-2'],
+ );
+ assert.equal(seen.length, 2);
+ assert.equal(
+ seen[0].url,
+ 'https://consensyssoftware.atlassian.net/rest/api/3/search/jql',
+ );
+ assert.equal(seen[0].body.method, undefined);
+ assert.equal(seen[0].body.jql, 'issuetype = Bug');
+ assert.deepEqual(seen[0].body.fields, [
+ 'summary',
+ 'assignee',
+ 'project',
+ 'status',
+ ]);
+ assert.equal(seen[1].body.nextPageToken, 'page-2');
+ assert.match(seen[0].authorization, /^Basic /u);
+ assert.doesNotMatch(seen[0].authorization, /secret-token/u);
+ });
+
+ it('throws the status without the token when Jira rejects the search', async () => {
+ const fetchImpl = async () => ({
+ ok: false,
+ status: 401,
+ text: async () => 'auth failed secret-token',
+ });
+
+ await assert.rejects(
+ () =>
+ searchJiraIssues({
+ baseUrl: 'https://consensyssoftware.atlassian.net',
+ email: 'victor@example.com',
+ apiToken: 'secret-token',
+ jql: 'issuetype = Bug',
+ fetchImpl,
+ }),
+ /Jira search failed \(401\): auth failed/u,
+ );
+ });
+});
diff --git a/.github/actions/release-slack-summaries/lib/adapter.mjs b/.github/actions/release-slack-summaries/lib/adapter.mjs
new file mode 100644
index 00000000..b1356adf
--- /dev/null
+++ b/.github/actions/release-slack-summaries/lib/adapter.mjs
@@ -0,0 +1,81 @@
+/**
+ * Turns Jira issues into the bug shape Zap 596/597 crafting already expects.
+ * MCRM-155 §5.4. This is the only new mapping; message text stays in the craft
+ * modules.
+ */
+
+const RELEASE_BLOCKER_LABEL = 'release-blocker';
+
+/**
+ * Maps one Jira issue into the Zap bug shape.
+ *
+ * @param {object} issue - Jira issue from `/rest/api/3/search/jql`.
+ * @param {object} options - Mapping options.
+ * @param {string | undefined} options.teamLabel - Topology label for `project.key`, if any.
+ * @param {boolean} options.inBlockersSet - Whether this key was returned by the blocker search.
+ * @param {string} options.browseBaseUrl - Jira site origin.
+ * @returns {object} Zap bug. `closed` is the string `"true"` or `"false"`.
+ */
+export function jiraIssueToRcBug(
+ issue,
+ { teamLabel, inBlockersSet, browseBaseUrl },
+) {
+ const fields = issue.fields ?? {};
+ const projectKey = fields.project?.key;
+ const statusCategoryKey = fields.status?.statusCategory?.key;
+ const base = browseBaseUrl.replace(/\/$/u, '');
+ const labels = [
+ teamLabel,
+ inBlockersSet ? RELEASE_BLOCKER_LABEL : undefined,
+ ].filter(Boolean);
+
+ return {
+ key: issue.key,
+ // Kept off `labels` so an unmapped project key cannot collide with a
+ // topology label. Zap 597 reads it only for the registry fallback line.
+ projectKey: projectKey || '',
+ name: fields.summary,
+ url: `${base}/browse/${issue.key}`,
+ closed: String(statusCategoryKey === 'done'),
+ assigneesLength: fields.assignee ? 1 : 0,
+ labels,
+ };
+}
+
+/**
+ * Union of the regression search and the blocker search, one bug per issue key.
+ * A key present in both sets is a blocker.
+ *
+ * @param {object[]} regressions - Found-in search results.
+ * @param {object[]} blockers - Blocker search results. Empty when the filter is OPEN.
+ * @param {object} options - Mapping options.
+ * @param {Function} options.teamLabelFor - Registry lookup from project key to label.
+ * @param {string} options.browseBaseUrl - Jira site origin.
+ * @returns {object[]} Zap bugs.
+ */
+export function mergeJiraIssues(
+ regressions,
+ blockers,
+ { teamLabelFor, browseBaseUrl },
+) {
+ const byKey = new Map();
+ for (const issue of regressions) {
+ byKey.set(issue.key, { issue, inBlockersSet: false });
+ }
+ for (const issue of blockers) {
+ const existing = byKey.get(issue.key);
+ if (existing) {
+ existing.inBlockersSet = true;
+ } else {
+ byKey.set(issue.key, { issue, inBlockersSet: true });
+ }
+ }
+
+ return [...byKey.values()].map(({ issue, inBlockersSet }) =>
+ jiraIssueToRcBug(issue, {
+ teamLabel: teamLabelFor(issue.fields?.project?.key),
+ inBlockersSet,
+ browseBaseUrl,
+ }),
+ );
+}
diff --git a/.github/actions/release-slack-summaries/lib/contributing-teams.mjs b/.github/actions/release-slack-summaries/lib/contributing-teams.mjs
new file mode 100644
index 00000000..e07e7fe0
--- /dev/null
+++ b/.github/actions/release-slack-summaries/lib/contributing-teams.mjs
@@ -0,0 +1,91 @@
+/**
+ * Zap 597 no longer reads the Release Progress Tracker sheet.
+ * Contributing teams are the sign-off checklist lines (MCRM-155 597-4),
+ * mapped to topology labels with the same name/label match the crafting
+ * script uses. A line with no match is passed through unchanged so the
+ * script's "not in team registry" sentence still appears.
+ */
+
+const TEAM_CHECKLIST_SECTION =
+ /(?:# Team sign-off checklist|## ✅ Team Sign-Off Checklist)[\s\S]*?\n([\s\S]+?)\n\s*\n/u;
+
+/**
+ * First Google Sheets URL in the pull request body.
+ * OPEN (597-4): assumed to be the Testing Plan link. Wording in the Slack
+ * message is unchanged.
+ *
+ * @param {string} releasePrBody - Pull request body.
+ * @returns {string} URL, or empty when none is present.
+ */
+export function extractTestingPlanLink(releasePrBody) {
+ const match = (releasePrBody || '').match(
+ /https:\/\/docs\.google\.com\/spreadsheets\/[^\s)>]+/u,
+ );
+ if (!match) {
+ return '';
+ }
+ return match[0].replace(/[.,]$/u, '');
+}
+
+/**
+ * Escapes a team name for a literal regular expression.
+ *
+ * @param {string} value - Topology name or label interpolated into a RegExp.
+ * @returns {string} Escaped literal.
+ */
+function escapeRegExp(value) {
+ return value.replace(/[.*+?^${}()|[\]\\]/gu, '\\$&');
+}
+
+/**
+ * Inverse of the Zap's sign-off match: display name (`name` with the first
+ * `" team"` removed) or the github label, case-insensitive. The longest
+ * match wins so a shorter name cannot claim a longer checklist line.
+ *
+ * @param {string} line - One checklist line.
+ * @param {object} teams - Topology map keyed by github label.
+ * @returns {string | null} Label, or null when nothing matches.
+ */
+function matchTeamLabel(line, teams) {
+ let best = null;
+ let bestLength = -1;
+ for (const [label, team] of Object.entries(teams)) {
+ const display = team?.name?.replace(' team', '') || label;
+ const byName = new RegExp(`- \\[([ xX])\\] ${escapeRegExp(display)}`, 'iu');
+ const byLabel = new RegExp(`- \\[([ xX])\\] ${escapeRegExp(label)}`, 'iu');
+ if (byName.test(line) || byLabel.test(line)) {
+ const length = Math.max(display.length, label.length);
+ if (length > bestLength) {
+ best = label;
+ bestLength = length;
+ }
+ }
+ }
+ return best;
+}
+
+/**
+ * Reads checklist lines and maps them to topology labels.
+ *
+ * @param {string} releasePrBody - Pull request body.
+ * @param {object} teams - Topology map keyed by github label.
+ * @returns {string[]} Labels in checklist order. Unknown lines are the raw text.
+ */
+export function contributingTeamLabels(releasePrBody, teams) {
+ const match = (releasePrBody || '').match(TEAM_CHECKLIST_SECTION);
+ const section = match ? match[1].trim() : '';
+ const lines = section
+ .split('\n')
+ .filter((line) => line.trim().startsWith('- ['));
+ const labels = [];
+ for (const line of lines) {
+ const name = line.replace(/^- \[[xX ]\]\s*/u, '').trim();
+ if (name) {
+ const label = matchTeamLabel(line, teams) ?? name;
+ if (!labels.includes(label)) {
+ labels.push(label);
+ }
+ }
+ }
+ return labels;
+}
diff --git a/.github/actions/release-slack-summaries/lib/craft-596.mjs b/.github/actions/release-slack-summaries/lib/craft-596.mjs
new file mode 100644
index 00000000..354b55a2
--- /dev/null
+++ b/.github/actions/release-slack-summaries/lib/craft-596.mjs
@@ -0,0 +1,145 @@
+/**
+ * Zap 596 Slack message (release blocker summary).
+ *
+ * Port of `zaps/main/release-blocker-notification-automation/scripts/slack-message-crafting.js`
+ * at metamask-zaps@dc70d6792cbaf9d99f39982868baf7f090dea0af.
+ * Message text is unchanged. `inputData` is the function argument.
+ * The platform branch keys off the code repository (MCRM-155 C3).
+ * `release_epic_url` was read by the Zap and never used, so it is not an argument.
+ */
+
+/**
+ * Builds the Zap 596 Slack message.
+ *
+ * @param {object} input - Zap inputData, as arguments.
+ * @param {object} input.teams - `githubLabel.name` → `{ name, contact }`.
+ * @param {string} input.releaseVersion - `X.Y.Z` from the release ref. Not guessed.
+ * @param {string} input.githubRepo - `metamask-extension` or `metamask-mobile`.
+ * @param {object[]} input.rcBugs - Adapter output. `closed` is `"true"` / `"false"`.
+ * @returns {object} Slack fields the Zap wrote to `output`.
+ */
+export function craftBlockerSummary({
+ teams,
+ releaseVersion,
+ githubRepo,
+ rcBugs: rawRcBugs,
+}) {
+ const teamLabels = Object.keys(teams);
+
+ const rcBugs = rawRcBugs
+ .map((bug) => {
+ return {
+ ...bug,
+ closed: bug?.closed?.toLowerCase() === 'true',
+ assigneesLength: Number(bug.assigneesLength),
+ };
+ })
+ .filter((bug) => !bug?.name?.includes('Bug Report'));
+
+ const blockers = rcBugs.filter((bug) => {
+ return bug.labels.includes('release-blocker');
+ });
+ const openBlockers = blockers.filter((blocker) => !blocker.closed);
+
+ const nonBlockers = rcBugs.filter((bug) => {
+ return !bug.labels.includes('release-blocker');
+ });
+ const openNonBlockers = nonBlockers.filter((blocker) => !blocker.closed);
+
+ let platform;
+ let platformIcon;
+ let releaseOwner;
+ if (githubRepo?.toLowerCase() === 'metamask-extension') {
+ platform = 'Extension';
+ platformIcon = ':electric_plug:';
+ releaseOwner = '@release-owner-extension';
+ } else if (githubRepo?.toLowerCase() === 'metamask-mobile') {
+ platform = 'Mobile';
+ platformIcon = ':iphone:';
+ releaseOwner = '@release-owner-mobile';
+ } else {
+ throw new Error(`Shall never happen: unknown platform (${githubRepo})`);
+ }
+
+ const findTeamLabels = (bug) => {
+ return bug.labels.filter((label) => teamLabels.includes(label));
+ };
+
+ const craftTeamResponsible = (bug) => {
+ let teamName = '';
+ let teamContact = '';
+ const bugTeamLabels = findTeamLabels(bug);
+ bugTeamLabels.forEach((label) => {
+ if (teamName) {
+ teamName += ', ';
+ }
+ if (teamContact) {
+ teamContact += ' ';
+ }
+ teamName += teams[label]?.name;
+ teamContact += teams[label]?.contact;
+ });
+
+ if (bugTeamLabels?.length > 1) {
+ teamName += '(:warning: more than 1 team assigned to this bug)';
+ }
+
+ return {
+ name: teamName || ' Issue needs a team label :hi_wave:',
+ contact: teamContact || ' Issue needs a team label :hi_wave:',
+ };
+ };
+
+ const craftBugsList = (bugs) => {
+ let bugsList = '';
+
+ if (bugs.length > 0) {
+ bugs.forEach((bug) => {
+ const teamResponsible = craftTeamResponsible(bug);
+ const assigneeWarning =
+ bug.assigneesLength < 1 ? ' Issue needs an assignee :hi_wave:' : '';
+
+ bugsList += `• <${bug?.url}|${bug?.name}>,${teamResponsible?.contact}${assigneeWarning}\n`;
+ });
+ bugsList += `\n`;
+ }
+ return bugsList;
+ };
+
+ const slackMessageTitle = `${platform} release bug summary for v${releaseVersion}\n\n`;
+
+ let slackMessage = `*Date:* ${new Date().toLocaleDateString('en-US', {
+ month: 'long',
+ day: 'numeric',
+ year: 'numeric',
+ })}\n\n`;
+
+ if (openBlockers.length > 0) {
+ slackMessage += `:stop: *Release Blockers* :stop:\n\n*Important:* All release blockers must be resolved before release sign-off.\n\n`;
+ slackMessage += craftBugsList(openBlockers);
+ }
+
+ if (openNonBlockers.length > 0) {
+ slackMessage += `:warning: *Release regressions* :warning:\n\n*Note:* All teams should do their best to resolve release regressions before release sign-off.\n\n`;
+ slackMessage += craftBugsList(openNonBlockers);
+ }
+
+ if (rcBugs.length === 0) {
+ slackMessage += `:white_check_mark: *No remaining bugs* :white_check_mark:\n\n`;
+ }
+
+ slackMessage += `${releaseOwner}`;
+
+ const slackThread = `*${platform} v${releaseVersion}* :thread:`;
+ const slackChannelName = `release-${platform.toLocaleLowerCase()}-${releaseVersion.replaceAll('.', '-')}`;
+
+ return {
+ platform,
+ slackChannelName,
+ slackThreadWithoutBold: slackThread.replace(/\*/gu, ''),
+ slackThread,
+ slackMessage,
+ slackMessageIcon: platformIcon,
+ slackMessageTitle,
+ };
+}
diff --git a/.github/actions/release-slack-summaries/lib/craft-597.mjs b/.github/actions/release-slack-summaries/lib/craft-597.mjs
new file mode 100644
index 00000000..a33b9ffc
--- /dev/null
+++ b/.github/actions/release-slack-summaries/lib/craft-597.mjs
@@ -0,0 +1,373 @@
+/**
+ * Zap 597 Slack message (release validation) and the release PR checklist rewrite.
+ *
+ * Port of `zaps/main/release-sign-off-notification-automation/scripts/slack-message-crafting.js`
+ * at metamask-zaps@dc70d6792cbaf9d99f39982868baf7f090dea0af.
+ * Message text is unchanged except the values MCRM-155 names:
+ * Release Cut is the argument (the runner passes the PR `created_at`);
+ * `testingPlanLink` is the PR-body Sheets URL; blocker links are Jira JQL
+ * (597-8); cc handles are the Slack user ids from the v3 posts (597-10).
+ * The sheet id / gid inputs are gone with the sheet read.
+ *
+ * `updatedReleasePrBody` is set only when the checklist text changes. That is
+ * the code path. The Zapier path-B condition ("Does not exist") reads oddly
+ * and stays OPEN; the runner writes only when this function returns a body.
+ */
+
+import { jiraIssuesUrl, projectScopedJql } from './jira.mjs';
+
+/**
+ * Escapes a team name for a literal regular expression.
+ *
+ * @param {string} value - Team name or label placed in a RegExp.
+ * @returns {string} Literal pattern.
+ */
+function escapeRegExp(value) {
+ return value.replace(/[.*+?^${}()|[\]\\]/gu, '\\$&');
+}
+
+/**
+ * Builds the Zap 597 Slack message and the checklist rewrite.
+ *
+ * @param {object} input - Zap inputs that still apply, plus the Jira URL pieces.
+ * @param {object} input.teams - Topology map. `jiraProjects` is read for per-team JQL.
+ * @param {string} input.platform - `Extension` or `Mobile`.
+ * @param {string} input.releaseVersion - `X.Y.Z`.
+ * @param {string[]} input.contributingTeamLabels - Checklist labels, in order.
+ * @param {string} input.releasePrUrl - Release pull request URL.
+ * @param {string} input.releasePrBody - Release pull request body.
+ * @param {string} input.releaseDownloadUrl1 - Chrome (Extension) build URL.
+ * @param {string} input.releaseDownloadUrl2 - Firefox (Extension) build URL.
+ * @param {string} input.releaseEpicCreatedAt - Pull request `created_at`.
+ * @param {object[]} input.rcBugs - Adapter output.
+ * @param {string | null} input.blockerJql - Per-release blocker JQL, or null when OPEN.
+ * @param {string} input.jiraBaseUrl - Jira site origin.
+ * @param {string} input.testingPlanLink - Sheets URL from the PR body.
+ * @returns {object} Slack fields plus `updatedReleasePrBody` when the checklist changed.
+ */
+export function craftReleaseValidation({
+ teams,
+ platform,
+ releaseVersion,
+ contributingTeamLabels,
+ releasePrUrl,
+ releasePrBody,
+ releaseDownloadUrl1,
+ releaseDownloadUrl2,
+ releaseEpicCreatedAt,
+ rcBugs: rawRcBugs,
+ blockerJql,
+ jiraBaseUrl,
+ testingPlanLink,
+}) {
+ const teamLabels = Object.keys(teams);
+
+ const teamLabelsToIgnore = [
+ 'team-external-contributor',
+ 'team-dev-ops',
+ 'team-qa',
+ 'team-bot',
+ 'unknown',
+ ];
+ const contributingTeams = [
+ ...new Set(
+ (contributingTeamLabels ?? [])
+ .map((label) => String(label).trim())
+ .filter(Boolean),
+ ),
+ ].filter((label) => !teamLabelsToIgnore.includes(label));
+ const nonContributingTeamsWithBlockersAssigned = [];
+ // Blocker projects with no topology team. Shown with the registry sentence
+ // (597-9). They are not "non-contributing teams", so they do not get that
+ // extra sheet bullet. They are still appended to the checklist as
+ // `- [ ] {KEY}` because the rewrite has no team name to use (OPEN until
+ // `jiraProject` is filled in).
+ const unmappedBlockerLabels = [];
+
+ const rcBugs = rawRcBugs
+ .map((bug) => {
+ return {
+ ...bug,
+ closed: bug?.closed?.toLowerCase() === 'true',
+ };
+ })
+ .filter((bug) => !bug?.name?.includes('Bug Report'));
+
+ const blockers = rcBugs.filter((bug) => {
+ return bug.labels.includes('release-blocker');
+ });
+ const openBlockersCount = blockers?.filter(
+ (blocker) => !blocker.closed,
+ )?.length;
+
+ const formatDate = (
+ dateString,
+ options = { month: 'short', day: '2-digit' },
+ ) => {
+ const date = new Date(dateString);
+ return date.toLocaleDateString('en-US', options);
+ };
+
+ const addDays = (dateString, days) => {
+ const date = new Date(dateString);
+ date.setDate(date.getDate() + days);
+ return date.toISOString();
+ };
+
+ const releaseBlockerUrl = blockerJql
+ ? jiraIssuesUrl(jiraBaseUrl, blockerJql)
+ : '';
+
+ let platformIcon;
+ let cherryPickTrackerUrl;
+ let buildType1;
+ let buildType2;
+ let timeBetweenTwoReleases;
+ if (platform === 'Extension') {
+ platformIcon = ':electric_plug:';
+ cherryPickTrackerUrl = `https://app.runway.team/dashboard/org/org_4tzZCk2L/app/metamask-extension-react-native-ota/releases/${releaseVersion}/step/featureReadiness/summary?sort=codeLastUpdated`;
+ buildType1 = 'chrome';
+ buildType2 = 'firefox';
+ timeBetweenTwoReleases = 7;
+ } else if (platform === 'Mobile') {
+ platformIcon = ':iphone:';
+ cherryPickTrackerUrl = `https://app.runway.team/dashboard/org/org_4tzZCk2L/app/metamask-blockchain-wall-ios3/releases/${releaseVersion}/step/featureReadiness/summary?sort=codeLastUpdated`;
+ buildType1 = 'ios';
+ buildType2 = 'android';
+ timeBetweenTwoReleases = 7;
+ } else {
+ throw new Error(`Shall never happen: unknown platform (${platform})`);
+ }
+
+ const releaseCutDate = releaseEpicCreatedAt
+ ? formatDate(releaseEpicCreatedAt)
+ : 'Unknown Date';
+ const releaseSubmissionDeadlineDate = releaseEpicCreatedAt
+ ? formatDate(addDays(releaseEpicCreatedAt, timeBetweenTwoReleases))
+ : 'Unknown Date';
+
+ const teamBlockers = {};
+ blockers.forEach((bug) => {
+ const knownLabels = bug.labels.filter(
+ (label) => label !== 'release-blocker' && teamLabels.includes(label),
+ );
+ knownLabels.forEach((label) => {
+ if (!teamBlockers[label]) {
+ teamBlockers[label] = [];
+ }
+ teamBlockers[label].push(bug);
+
+ if (
+ !contributingTeams.includes(label) &&
+ !nonContributingTeamsWithBlockersAssigned.includes(label)
+ ) {
+ nonContributingTeamsWithBlockersAssigned.push(label);
+ }
+ });
+
+ if (knownLabels.length === 0 && bug.projectKey) {
+ const label = bug.projectKey;
+ if (!teamBlockers[label]) {
+ teamBlockers[label] = [];
+ }
+ teamBlockers[label].push(bug);
+ if (
+ !contributingTeams.includes(label) &&
+ !unmappedBlockerLabels.includes(label)
+ ) {
+ unmappedBlockerLabels.push(label);
+ }
+ }
+ });
+
+ const signOffLabels = [
+ ...contributingTeams,
+ ...nonContributingTeamsWithBlockersAssigned,
+ ...unmappedBlockerLabels,
+ ];
+
+ const teamSignOffs = {};
+ const teamChecklistSectionMatch = (releasePrBody || '').match(
+ /(?:# Team sign-off checklist|## ✅ Team Sign-Off Checklist)[\s\S]*?\n([\s\S]+?)\n\s*\n/u,
+ );
+ const teamChecklistSection = teamChecklistSectionMatch
+ ? teamChecklistSectionMatch[1].trim()
+ : '';
+
+ const missingTeamsInChecklistSection = [];
+ signOffLabels.forEach((teamLabel) => {
+ const teamDisplayName =
+ teams[teamLabel]?.name?.replace(' team', '') || teamLabel;
+ // Names are escaped so a parenthesis in a checklist label cannot throw.
+ // The Zap interpolated them raw; current topology names have no metacharacters.
+ const teamLabelRegex1 = new RegExp(
+ `- \\[([ xX])\\] ${escapeRegExp(teamDisplayName)}`,
+ 'iu',
+ );
+ const teamLabelRegex2 = new RegExp(
+ `- \\[([ xX])\\] ${escapeRegExp(teamLabel)}`,
+ 'iu',
+ );
+ const match1 = teamChecklistSection.match(teamLabelRegex1);
+ const match2 = teamChecklistSection.match(teamLabelRegex2);
+
+ if (
+ (match1 && match1[1].toLowerCase() === 'x') ||
+ (match2 && match2[1].toLowerCase() === 'x')
+ ) {
+ teamSignOffs[teamLabel] = true;
+ } else if (match1 || match2) {
+ teamSignOffs[teamLabel] = false;
+ } else {
+ teamSignOffs[teamLabel] = false;
+ missingTeamsInChecklistSection.push(`- [ ] ${teamDisplayName}`);
+ }
+ });
+
+ let updatedReleasePrBody;
+ if (teamChecklistSectionMatch) {
+ const existingChecklistItems = teamChecklistSection
+ .split('\n')
+ .filter((line) => line.trim().startsWith('- ['));
+ const allChecklistItems = [
+ ...existingChecklistItems,
+ ...missingTeamsInChecklistSection,
+ ];
+ const sortedChecklistItems = allChecklistItems.sort((itemA, itemB) => {
+ const teamNameA = itemA
+ .replace(/^- \[[xX ]\]\s*/u, '')
+ .trim()
+ .toLowerCase();
+ const teamNameB = itemB
+ .replace(/^- \[[xX ]\]\s*/u, '')
+ .trim()
+ .toLowerCase();
+ return teamNameA.localeCompare(teamNameB);
+ });
+ const updatedTeamChecklistSection = sortedChecklistItems.join('\n');
+
+ if (updatedTeamChecklistSection !== teamChecklistSection) {
+ updatedReleasePrBody = releasePrBody.replace(
+ /(?:# Team sign-off checklist|## ✅ Team Sign-Off Checklist)[\s\S]*?\n([\s\S]+?)\n\s*\n/u,
+ `# Team sign-off checklist\n${updatedTeamChecklistSection}\n\n`,
+ );
+ }
+ }
+
+ const slackMessageTitle = `${platform} ${releaseVersion} Release Validation`;
+
+ let slackMessage = `
+
+*Current Release Summary*
+
+Dates:
+• Release Cut: *${releaseCutDate}*
+• Deadline Date for Release Submission: *${releaseSubmissionDeadlineDate}*`;
+
+ if (releaseDownloadUrl1 && releaseDownloadUrl2) {
+ slackMessage += `
+
+Latest builds available for testing:
+• <${releaseDownloadUrl1}|${buildType1}>
+• <${releaseDownloadUrl2}|${buildType2}>`;
+ }
+
+ slackMessage += `
+
+Useful links:
+• <${releasePrUrl}|Release PR on GitHub>
+• <${testingPlanLink}|Testing Plan & Progress Tracker on Google Sheets>
+•
+• <${cherryPickTrackerUrl}|Cherry-Pick Tracker on Runway>`;
+
+ // Blocker bullet is the Zap's last useful-link line. It is omitted when the
+ // saved filter JQL is empty (interface: skip the blocker section, log OPEN).
+ if (releaseBlockerUrl) {
+ slackMessage += `
+• <${releaseBlockerUrl}|${openBlockersCount} ${openBlockersCount === 1 ? 'Release Blocker' : 'Release Blockers'}>`;
+ }
+
+ slackMessage += `
+
+Teams sign off:\n\n`;
+
+ let stopSlackMessage = '';
+ let redSlackMessage = '';
+ let greenSlackMessage = '';
+ for (const team of signOffLabels) {
+ let teamSlackMessage = '';
+ const teamName = teams[team]?.name?.replace(' team', '');
+ const teamSignOffContact = teams[team]?.contact || '';
+ let notifyTeam = false;
+ const openBlockers = teamBlockers?.[team]?.filter(
+ (blocker) => !blocker.closed,
+ );
+
+ if (openBlockers?.length > 0) {
+ teamSlackMessage += `:stop:`;
+ notifyTeam = true;
+ } else if (teamSignOffs[team]) {
+ teamSlackMessage += ':large_green_circle:';
+ } else {
+ teamSlackMessage += ':red_circle:';
+ notifyTeam = true;
+ }
+
+ const teamProjects = teams[team]?.jiraProjects ?? [];
+ const blockerUrl = blockerJql
+ ? jiraIssuesUrl(jiraBaseUrl, projectScopedJql(blockerJql, teamProjects))
+ : '';
+
+ if (teamName) {
+ teamSlackMessage += ` ${teamName}`;
+
+ if (notifyTeam) {
+ teamSlackMessage += ` ${teamSignOffContact}`;
+ }
+
+ if (openBlockers?.length > 0 && blockerUrl) {
+ teamSlackMessage += ` :arrow_right: <${blockerUrl}|*${openBlockers.length} release blocker${openBlockers.length > 1 ? 's' : ''}*>`;
+ }
+ } else {
+ teamSlackMessage += ` ${team} :arrow_right: `;
+ }
+
+ if (nonContributingTeamsWithBlockersAssigned.includes(team)) {
+ teamSlackMessage += `\n • team is not listed amongst contributing teams in the <${testingPlanLink}|release sheet>, but has <${blockerUrl}|blockers> assigned, which is why sign off is requested`;
+ }
+
+ teamSlackMessage += `\n`;
+
+ if (openBlockers?.length > 0) {
+ stopSlackMessage += teamSlackMessage;
+ } else if (teamSignOffs[team]) {
+ greenSlackMessage += teamSlackMessage;
+ } else {
+ redSlackMessage += teamSlackMessage;
+ }
+ }
+
+ slackMessage += stopSlackMessage;
+ slackMessage += redSlackMessage;
+ slackMessage += greenSlackMessage;
+ slackMessage += `\n`;
+
+ slackMessage += `*Important Reminder:*
+
+Please be aware of the importance of starting your testing immediately to ensure there is sufficient time to address any unexpected defects. This proactive approach will help prevent release delays and minimize impact on other teams’ deliveries.
+
+cc <@U032GHTQDKK> <@U0513NJ3TAB> <@U0204J1ANFR> <@UBGR2LNBS>\n`;
+
+ const slackThread = `*${platform} v${releaseVersion}* :thread:`;
+ const slackChannelName = `release-${platform.toLocaleLowerCase()}-${releaseVersion.replaceAll('.', '-')}`;
+
+ return {
+ slackChannelName,
+ slackThreadWithoutBold: slackThread.replace(/\*/gu, ''),
+ slackThread,
+ slackMessage,
+ slackMessageIcon: platformIcon,
+ slackMessageTitle,
+ updatedReleasePrBody,
+ };
+}
diff --git a/.github/actions/release-slack-summaries/lib/gates.mjs b/.github/actions/release-slack-summaries/lib/gates.mjs
new file mode 100644
index 00000000..ca361bd7
--- /dev/null
+++ b/.github/actions/release-slack-summaries/lib/gates.mjs
@@ -0,0 +1,69 @@
+/**
+ * Safe defaults for the shared action.
+ * Dry-run posts nothing and writes nothing. A pull request body is written
+ * only for release validation, when dry-run is off, allow-pr-write is on,
+ * and test-channel is empty. A test channel never writes a pull request body.
+ */
+
+/**
+ * Parses the dry-run input. Unset stays on.
+ *
+ * @param {string | boolean | undefined} value - Action input. Unset or empty stays dry-run.
+ * @returns {boolean} True unless the value is the string `false`.
+ */
+export function isDryRun(value) {
+ if (value === undefined || value === null || String(value).trim() === '') {
+ return true;
+ }
+ return String(value).trim().toLowerCase() !== 'false';
+}
+
+/**
+ * Parses allow-pr-write. Only the string true allows a write.
+ *
+ * @param {string | boolean | undefined} value - Action input. Only the string `true` allows a write.
+ * @returns {boolean} Whether the caller asked to rewrite the release PR body.
+ */
+export function isPrWriteAllowed(value) {
+ return (
+ String(value ?? '')
+ .trim()
+ .toLowerCase() === 'true'
+ );
+}
+
+/**
+ * Decides whether this run may update a release pull request body.
+ *
+ * @param {object} args - Parsed flags.
+ * @param {string} args.mode - `blocker-summary` or `release-validation`.
+ * @param {boolean} args.dryRun - Parsed dry-run flag.
+ * @param {boolean} args.allowPrWrite - Parsed allow-pr-write flag.
+ * @param {string} [args.testChannel] - When set, the write is refused.
+ * @returns {boolean} Whether this run may PATCH a pull request body.
+ */
+export function shouldWriteReleasePr({
+ mode,
+ dryRun,
+ allowPrWrite,
+ testChannel,
+}) {
+ if ((testChannel || '').trim()) {
+ return false;
+ }
+ return (
+ mode === 'release-validation' && dryRun === false && allowPrWrite === true
+ );
+}
+
+/**
+ * Chooses the Slack channel, honoring test-channel.
+ *
+ * @param {string} slackChannelName - Channel the Zap formula produced.
+ * @param {string} testChannel - Override. When set, this is the only target.
+ * @returns {string} Channel passed to `chat.postMessage`.
+ */
+export function postChannel(slackChannelName, testChannel) {
+ const override = (testChannel || '').trim();
+ return override || slackChannelName;
+}
diff --git a/.github/actions/release-slack-summaries/lib/jira.mjs b/.github/actions/release-slack-summaries/lib/jira.mjs
new file mode 100644
index 00000000..97fced46
--- /dev/null
+++ b/.github/actions/release-slack-summaries/lib/jira.mjs
@@ -0,0 +1,174 @@
+/**
+ * Read-only Jira search and the JQL this action is allowed to build.
+ *
+ * Blocker JQL is caller-supplied (`jira-release-blocker-jql`). The saved
+ * filter does not exist yet, so an empty base is an OPEN skip, not a guess.
+ * Per release the action appends `AND cf[14565] = "V"` (MCRM-155 interface).
+ * Regression JQL defaults to the v10 proposal (Found in `cf[16946]`, §4
+ * project list) until callers override `jira-regression-jql`.
+ */
+
+/** Found-in field id from MCRM-155 v10 §5.3 C7. OPEN to confirm. */
+export const FOUND_IN_CUSTOM_FIELD = '16946';
+
+/** Release Number field id. The shared interface appends this clause. */
+export const RELEASE_NUMBER_CUSTOM_FIELD = '14565';
+
+/**
+ * Proposal §4 project list. OPEN: the saved filter that owns this list is not
+ * created yet. Callers can replace it with `jira-regression-jql`.
+ */
+export const DEFAULT_REGRESSION_JQL_BASE =
+ 'issuetype = Bug AND project in (MUL, ASSETS, CONF, CEUX, WPC, GE, WPN, TAT, CARD, DSYS, MCWP, TMCU, TRAM, PRED, TSA, SUB, KYC, SWAPS, MWPE, STX, MUSD, MBTB)';
+
+const MAX_PAGES = 50;
+
+const RELEASE_VERSION = /^\d+\.\d+\.\d+$/u;
+
+/**
+ * Refuses release numbers that did not come from a `release/X.Y.Z` ref.
+ *
+ * @param {string} version - Candidate release number.
+ */
+function assertReleaseVersion(version) {
+ if (!RELEASE_VERSION.test(version)) {
+ throw new Error(
+ `Refusing to build JQL for an unexpected release version: ${version}`,
+ );
+ }
+}
+
+/**
+ * Appends the release number to the caller blocker JQL.
+ *
+ * @param {string} version - Release number from the pull request head ref.
+ * @param {string} baseJql - Caller base. Empty means the blocker filter is OPEN.
+ * @returns {string | null} Full blocker JQL, or null when the base is empty.
+ */
+export function buildBlockerJql(version, baseJql) {
+ assertReleaseVersion(version);
+ if (!baseJql || !baseJql.trim()) {
+ return null;
+ }
+ return `${baseJql.trim()} AND cf[${RELEASE_NUMBER_CUSTOM_FIELD}] = "${version}"`;
+}
+
+/**
+ * Builds the Found-in JQL for one release.
+ *
+ * @param {string} version - Release number from the pull request head ref.
+ * @param {string} baseJql - Caller base. Empty uses {@link DEFAULT_REGRESSION_JQL_BASE}.
+ * @returns {string} Full regression JQL.
+ */
+export function buildRegressionJql(version, baseJql) {
+ assertReleaseVersion(version);
+ const base =
+ baseJql && baseJql.trim() ? baseJql.trim() : DEFAULT_REGRESSION_JQL_BASE;
+ return `${base} AND cf[${FOUND_IN_CUSTOM_FIELD}] = "${version}"`;
+}
+
+/**
+ * True when the regression search is using the proposal default.
+ *
+ * @param {string} baseJql - Caller-supplied regression base.
+ * @returns {boolean} Whether the default project list is in use.
+ */
+export function usesDefaultRegressionJql(baseJql) {
+ return !baseJql || !baseJql.trim();
+}
+
+/**
+ * Adds a project clause to a per-release JQL string.
+ *
+ * @param {string} jql - JQL that already scopes the release.
+ * @param {string[] | undefined} projectKeys - Topology keys for one team.
+ * @returns {string} JQL plus `project = KEY` or `project in (...)`.
+ */
+export function projectScopedJql(jql, projectKeys) {
+ const keys = (projectKeys ?? []).filter(Boolean);
+ if (keys.length === 0) {
+ return jql;
+ }
+ if (keys.length === 1) {
+ return `${jql} AND project = ${keys[0]}`;
+ }
+ return `${jql} AND project in (${keys.join(', ')})`;
+}
+
+/**
+ * Encodes JQL into a Jira issue-navigator URL.
+ *
+ * @param {string} baseUrl - Jira site origin, no trailing slash required.
+ * @param {string} jql - JQL to encode into the issues navigator.
+ * @returns {string} `https://…/issues/?jql=` URL.
+ */
+export function jiraIssuesUrl(baseUrl, jql) {
+ const base = baseUrl.replace(/\/$/u, '');
+ return `${base}/issues/?jql=${encodeURIComponent(jql)}`;
+}
+
+/**
+ * POST `/rest/api/3/search/jql`, following `nextPageToken`. Read-only.
+ *
+ * @param {object} args - Search arguments.
+ * @param {string} args.baseUrl - Jira site origin.
+ * @param {string} args.email - Atlassian account email.
+ * @param {string} args.apiToken - Atlassian API token. Never logged.
+ * @param {string} args.jql - JQL to run.
+ * @param {Function} [args.fetchImpl] - Injectable fetch.
+ * @returns {Promise