Repository navigation
[3554 by Claude Opus 5.5] Official plugins: Slack (incoming webhook), Discord and Microsoft Teams notifications - #3585
Conversation
…notification plugins. They pass `plugins:check` ("5 plugins checked") and every suite I ran passes. I did not run the full repository suite or the Plugins Playwright specs.
The three plugins (`packages/plugins/slack/`, `discord/`, `teams/`)
- Events: pull request opened, merged or closed; review scored below the threshold, or at or above it (two separate choices); Ultrafix ended with its outcome; task failed; epic queue blocked or completed.
- Review threshold: taken from the setting; if that's empty, from the review's own goal; otherwise 80.
- Destinations: a default webhook URL plus three more. Repository destinations maps `owner/repo` to `webhook-2`, `webhook-3`, `webhook-4`, or `none` to post nothing for that repository.
- Messages: a title, a few facts and links to the pull request, the issue and the task in ProPR. Task links need the new ProPR address setting. Messages use only numbers, identifiers and short coded values; titles and free-text reasons are left out.
- Format per service: Slack Block Kit, a Discord embed (with mentions turned off), and a Teams Adaptive Card. The wording, destination choice and delivery code is shared in `packages/plugins/_shared/`.
- Retries: a 429 is retried after `Retry-After` (for Discord, also the `retry_after` value in its response body). Server errors and timeouts are retried on the usual schedule. Any other refusal, or a missing webhook URL, fails the delivery at once with a readable message, e.g. "Slack refused the message to the default webhook with HTTP 404 (no_service); it is not retried…".
Platform change: webhook URLs as secrets
The plugin interface had no way to store a URL as a secret and send to it without the handler seeing it, so I added one:
- A `token` connection can now declare `secretUrl` with allowed hosts and path prefixes. A host can be a wildcard such as `*.logic.azure.com`.
- Saving a URL on any other host or path is refused with a message that names the host but never repeats the URL. Once saved, the URL is never shown again.
- The handler sends to a placeholder, `PLUGIN_CONNECTION_URL`, and ProPR substitutes the stored URL. Any other URL is refused, no `Authorization` header is added, and the URL (and its path and query) is removed from responses, logs and errors.
- The test kit, OpenAPI spec, generated client types and the Plugins page support it. The page labels these fields "Webhook URL" and lists the accepted hosts.
Vendor details I checked
- Slack: `hooks.slack.com` (and `hooks.slack-gov.com`), path `/services/`.
- Discord: `discord.com` and its alternate domains, path `/api/webhooks/`.
- Teams: Office 365 connector webhooks were retired in May 2026, so only Workflows URLs are accepted: `*.environment.api.powerplatform.com` and `*.logic.azure.com`. Microsoft doesn't publish the exact URL format; the powerplatform host comes from third-party write-ups of its URL migration.
Things to know
- The three plugins appear on every instance, not only in development.
- The error responses in the fixtures are hand-written to match each service's documented format. The Teams error codes are modelled on Power Automate's error shape rather than copied from a documented list.
- A retry can post a message twice if the service accepted it but its answer was lost. None of the three services offers a way to prevent that for webhook posts.
Tests run
- `packages/plugins` suites: 44 pass.
- Core plugin suites: 156 pass, including a new end-to-end test with the real store, `ctx.http` and dispatcher.
- Shared suite: 133 pass.
- Plugins page UI tests: 66 pass.
- API plugin suites: all four pass. `pluginRoutes` then hangs at exit until the timeout; this is a known exit hang in this repo's API tests.
- `test/pluginCommandIntake.test.ts`: 58 pass, with writable clone paths set because `/tmp/git-processor` is read-only here.
- Also passing: `test/checkPlugins.test.mjs`, the docs build (no broken links), typechecks, and zero-warning lint on the changed files.
- I also broke the code on purpose so it leaked the Ultrafix reason, and the leak test failed, so that test does catch leaks.
I captured previews of the Slack install step and the Connect step at desktop and phone widths.
Acceptance criteria
- AC1: met — `npm run plugins:check` passes ("5 plugins checked"); `packages/plugins/{slack,discord,teams}/README.md` each have setup steps, a manual smoke-test checklist and links to the vendor docs.
- AC2: met — `packages/plugins/test/chatNotifications.test.ts` checks each plugin against `fixtures/messages.json` and `fixtures/responses.json`: every selected event produces the fixture request, unselected events produce none, repository destinations (including `none` and an unknown name) work, a 429 with `Retry-After` is retried after the delay, and a permanent error fails with a readable message. `packages/core/test/pluginChatNotificationPlugins.test.ts` shows the real dispatcher waiting exactly the `Retry-After` delay and failing a 404 at once.
- AC3: met — the leak test in `packages/plugins/test/chatNotifications.test.ts` plants marker values (code, logs, prompt text, tool output, free text, a token and the webhook URLs) in every event; none appears in any request, log line, result or error. The core test checks the stored URL never reaches the handler, the response, the result or Activity.
- AC4: met — `docs/docs/plugins/slack.md`, `discord.md` and `teams.md`, linked from the "Official plugins" table in `docs/docs/features/plugins.md` and added to `docs/sidebars.ts`.
|
/ultrafix goal=8 max=10 |
|
🔄 Ultrafix loop started (goal: 8/10, max cycles: 10) First action:
|
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR adds three notification plugins with shared event formatting, routing, and delivery, plus secret webhook URL connections. It needs localized changes before merge: credential redaction misses separated URL components, and rounding can select the wrong review notification. ✅ Shared delivery behavior — All three plugins use the same destination resolution and permanent/transient failure handling, including Discord’s body-based retry delay. ✅ Restricted destinations — Stored URLs undergo host/path validation, public-address checks, and installation authorization before sending; handlers receive a placeholder response URL. ✅ Broad coverage — Fixtures cover event selection, routing, and service responses, while core tests exercise storage and dispatcher retries. Current checks report 35 passed, none failed or pending. This review uses static analysis of the supplied code; no commands were run. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F1: 🔴 Redact separate secret URL components
F2: 🔴 Compare review scores before rounding
SuggestionsThese are optional follow-ups and are not sent to S1: 🟢 Match test-kit response redactionThe new secret URL branch in ScoreThe implementation has substantial coverage and passing current checks, but the credential boundary and threshold classification defects require correction before merge. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit 939e5df
Summary of ChangesI fixed F1 and F2, each with a regression test. Each new test fails against the previous code and passes now. F1: secret URL parts are now redacted separately (
F2: review scores are compared without rounding (
Checks run: all 44 This change isn't visible in the UI, so I made no previews. I found nothing else that needed a separate report. Review digestRisk-tiered paths
Validation evidence
Diff size: 6 files changed, +106/−11 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
…st fails against the previous code and passes now. I fixed F1 and F2, each with a regression test. Each new test fails against the previous code and passes now. **F1: secret URL parts are now redacted separately** (`packages/core/src/plugins/pluginHttp.ts`, `secretUrlCredentials`) - **What's redacted now:** the path alone, the query alone (with and without the `?`), and every path segment or query value that looks like a token, both as written and decoded, plus its `name=value` pair. "Looks like a token" means 16 or more characters with no `/`. That covers the Teams `sig`, the workflow ID, and the Slack and Discord tokens. The full URL and path-plus-query were already redacted. - **What stays readable:** short or path-like values such as `api-version=2016-06-01`, `sv=1.0` and `sp=/triggers/manual/run`. - **Where it applies:** the same list is used both for scrubbing responses (`spellingsOf`) and for the run's log and error redaction (`buildPluginContext`), so one change covers both. The plugin test kit doesn't redact anything itself, so it had no copy of this bug. - **Regression:** a new test in `packages/core/test/pluginChatNotificationPlugins.test.ts` uses a Teams `logic.azure.com` URL with a query. The fake service echoes the path, the query, the raw query, `sig` and the workflow ID as separate JSON fields and in a header. The test checks they're all redacted in what the handler sees and in its log lines, including when the handler logs the raw values directly. - **Docs:** the redaction wording in `docs/docs/features/plugins.md` and `docs/docs/architecture/plugin-runtime.md` now describes this. **F2: review scores are compared without rounding** (`packages/plugins/_shared/notifications.ts`) - **Comparison:** `notificationKind` and `reviewThreshold` now use the score and the review goal exactly as given. - **Display:** rounding happens only when showing the numbers, to one decimal. If that would make the shown numbers contradict the result, more decimals are used (up to six). So 79.96 against 80 shows as "scored 79.96, below 80". Scores well away from the threshold still show one decimal, so the existing message fixtures are unchanged. - **Regression:** new cases in `packages/plugins/test/chatNotifications.test.ts` cover fractional boundaries for both a configured threshold and the review goal: - 79.96 against 80 counts as below. - With only the at-or-above choice selected, it produces no notice. - The shown score and threshold read 79.96 and 80. - 89.96 against a goal of 90 counts as below. - 90.04 against a goal of 90.05 counts as below, and 90.05 against 90.05 counts as at or above. **Checks run:** all 44 `packages/plugins` tests and all 157 core `plugin*` tests pass. Typechecks for `packages/plugins` and `packages/core` are clean. Zero-warning lint passes on the changed files. I did not run the full repository suite. This change isn't visible in the UI, so I made no previews. I found nothing else that needed a separate report. PR: #3585 Comment by: @propr-ultrafix (ID: 0) Model: Claude Opus 5.5
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR implements Slack, Discord and Teams notifications through shared event formatting and delivery logic, with service-specific payloads and secret webhook connections. It is merge-ready within the reviewed scope, conditional on the remaining checks passing. ✅ Restricted webhook delivery — Stored URLs are validated against declared hosts and paths, checked again before sending, and subject to public-address resolution. Handlers use a placeholder rather than receiving the stored URL. ✅ Explicit retry behavior — Shared delivery code distinguishes transient failures from permanent refusals. The dispatcher integration test verifies both delayed retries and immediate permanent failure. ✅ Focused message construction — Notifications select specific event fields and construct links explicitly; free-text reasons, titles and arbitrary payload objects are excluded. This assessment is based on static inspection of the supplied diff and surrounding context. No commands or tests were run during this review. The authoritative check summary reports 31 passed, three pending and no failures. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S2: 🟢 Extend production-path service coverageThe real-runtime integration tests exercise Slack delivery and Teams response redaction, while Discord’s body-only retry delay is tested through the test kit. Adding a Discord dispatcher case would provide additional confidence that response scrubbing, JSON parsing and retry scheduling work together. This is optional because the individual behaviors and their connecting contracts already have coverage. S3: 🟢 Strengthen sentinel test boundariesIn ScoreThe implementation is cohesive, includes substantial targeted coverage, and has no verified merge blocker in the supplied changes. Remaining uncertainty is primarily live-service compatibility and the pending checks. Score: 9/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
ℹ️ GitHub auto-merge is turned off for this repository, so ProPR merges this PR itself once it is ready (checks passed or no CI configured, and the review goal met). To let GitHub merge it the moment required checks pass, enable Settings → General → Pull Requests → Allow auto-merge. |
AI Implementation Summary
Closes #3554
Branch:
3554/claude-opus-5-5-official-plugins-slack-in-20261116-1345-eydCommits: ✅ Changes committed (5a29b96)
AI Processing Completed
Execution Details:
Summary:
I've built the Slack (incoming webhook), Discord and Microsoft Teams notification plugins. They pass
plugins:check("5 plugins checked") and every suite I ran passes. I did not run the full repository suite or the Plugins Playwright specs.The three plugins (
packages/plugins/slack/,discord/,teams/)owner/repotowebhook-2,webhook-3,webhook-4, ornoneto post nothing for that repository.packages/plugins/_shared/.Retry-After(for Discord, also theretry_aftervalue in its response body). Server errors and timeouts are retried on the usual schedule. Any other refusal, or a missing webhook URL, fails the delivery at once with a readable message, e.g. "Slack refused the message to the default webhook with HTTP 404 (no_service); it is not retried…".Platform change: webhook URLs as secrets
The plugin interface had no way to store a URL as a secret and send to it without the handler seeing it, so I added one:
tokenconnection can now declaresecretUrlwith allowed hosts and path prefixes. A host can be a wildcard such as*.logic.azure.com.PLUGIN_CONNECTION_URL, and ProPR substitutes the stored URL. Any other URL is refused, noAuthorizationheader is added, and the URL (and its path and query) is removed from responses, logs and errors.Vendor details I checked
hooks.slack.com(andhooks.slack-gov.com), path/services/.discord.comand its alternate domains, path/api/webhooks/.*.environment.api.powerplatform.comand*.logic.azure.com. Microsoft doesn't publish the exact URL format; the powerplatform host comes from third-party write-ups of its URL migration.Things to know
Tests run
packages/pluginssuites: 44 pass.ctx.httpand dispatcher.pluginRoutesthen hangs at exit until the timeout; this is a known exit hang in this repo's API tests.test/pluginCommandIntake.test.ts: 58 pass, with writable clone paths set because/tmp/git-processoris read-only here.test/checkPlugins.test.mjs, the docs build (no broken links), typechecks, and zero-warning lint on the changed files.I captured previews of the Slack install step and the Connect step at desktop and phone widths.
Acceptance criteria
npm run plugins:checkpasses ("5 plugins checked");packages/plugins/{slack,discord,teams}/README.mdeach have setup steps, a manual smoke-test checklist and links to the vendor docs.packages/plugins/test/chatNotifications.test.tschecks each plugin againstfixtures/messages.jsonandfixtures/responses.json: every selected event produces the fixture request, unselected events produce none, repository destinations (includingnoneand an unknown name) work, a 429 withRetry-Afteris retried after the delay, and a permanent error fails with a readable message.packages/core/test/pluginChatNotificationPlugins.test.tsshows the real dispatcher waiting exactly theRetry-Afterdelay and failing a 404 at once.packages/plugins/test/chatNotifications.test.tsplants marker values (code, logs, prompt text, tool output, free text, a token and the webhook URLs) in every event; none appears in any request, log line, result or error. The core test checks the stored URL never reaches the handler, the response, the result or Activity.docs/docs/plugins/slack.md,discord.mdandteams.md, linked from the "Official plugins" table indocs/docs/features/plugins.mdand added todocs/sidebars.ts.Review digest
Acceptance criteria (4 of 4 met, as stated by the agent)
Each plugin passes `plugins:check` and has a README with setup steps and a manual smoke-test checklist (CI cannot reach the real services).—`npm run plugins:check` passes ("5 plugins checked"); `packages/plugins/{slack,discord,teams}/README.md` each have setup steps, a manual smoke-test checklist and links to the vendor docs.Handler tests against hand-written fixtures of each service's payload format: every selected event produces the expected request; unselected events produce none; per-repository destinations work; a 429 with `Retry-After` is retried after the delay; a permanent error marks the delivery failed with a…—`packages/plugins/test/chatNotifications.test.ts` checks each plugin against `fixtures/messages.json` and `fixtures/responses.json`: every selected event produces the fixture request, unselected events produce none, repository destinations (including `none` and an unknown name) work, a 429 with `Re…No message contains code, logs, prompt text, tool output or credentials (sentinel test).—the leak test in `packages/plugins/test/chatNotifications.test.ts` plants marker values (code, logs, prompt text, tool output, free text, a token and the webhook URLs) in every event; none appears in any request, log line, result or error. The core test checks the stored URL never reaches the handl…Docs: one page per plugin under `docs/docs/plugins/`, linked from `docs/docs/features/plugins.md`.—`docs/docs/plugins/slack.md`, `discord.md` and `teams.md`, linked from the "Official plugins" table in `docs/docs/features/plugins.md` and added to `docs/sidebars.ts`.Risk-tiered paths
packages/api/openapi/schemasPlugins.ts(+5/−1)packages/client/src/generated/apiTypes.ts(+10/−0)packages/core/src/plugins/pluginContext.ts(+8/−5)packages/core/src/plugins/pluginHttp.ts(+60/−13)packages/core/src/plugins/pluginStore.ts(+3/−1)packages/plugins/_shared/chatDelivery.ts(added, +117/−0)packages/plugins/_shared/notifications.ts(added, +187/−0)packages/plugins/discord/format.ts(added, +65/−0)packages/plugins/discord/handlers.ts(added, +11/−0)packages/plugins/discord/icon.svg(added, +1/−0)packages/plugins/discord/manifest.json(added, +186/−0)packages/plugins/registry.json(+3/−0)packages/plugins/slack/format.ts(added, +45/−0)packages/plugins/slack/handlers.ts(added, +11/−0)packages/plugins/slack/icon.svg(added, +1/−0)packages/plugins/slack/manifest.json(added, +174/−0)packages/plugins/teams/format.ts(added, +55/−0)packages/plugins/teams/handlers.ts(added, +11/−0)packages/plugins/teams/icon.svg(added, +1/−0)packages/plugins/teams/manifest.json(added, +178/−0)packages/plugins/testing/index.ts(+29/−5)packages/shared/src/plugins.ts(+52/−1)propr-ui/src/pages/PluginsPage/PluginConnections.tsx(+9/−5)propr-ui/src/pages/PluginsPage/pluginUi.ts(+2/−0)docs/docs/architecture/plugin-runtime.md(+12/−0)docs/docs/features/plugins.md(+36/−1)docs/docs/plugins/discord.md(added, +167/−0)docs/docs/plugins/slack.md(added, +167/−0)docs/docs/plugins/teams.md(added, +179/−0)docs/sidebars.ts(+3/−0)docs/static/openapi/propr-api.yaml(+30/−0)packages/core/test/pluginChatNotificationPlugins.test.ts(added, +180/−0)packages/plugins/discord/README.md(added, +88/−0)packages/plugins/discord/fixtures/messages.json(added, +228/−0)packages/plugins/discord/fixtures/responses.json(added, +18/−0)packages/plugins/slack/README.md(added, +89/−0)packages/plugins/slack/fixtures/messages.json(added, +289/−0)packages/plugins/slack/fixtures/responses.json(added, +10/−0)packages/plugins/teams/README.md(added, +93/−0)packages/plugins/teams/fixtures/messages.json(added, +414/−0)packages/plugins/teams/fixtures/responses.json(added, +13/−0)packages/plugins/test/chatNotifications.test.ts(added, +286/−0)packages/plugins/test/fixtures/chatEvents.ts(added, +32/−0)packages/plugins/test/registry.test.ts(+7/−4)packages/shared/test/plugins.test.ts(+24/−1)propr-ui/src/pages/PluginsPage/PluginWebhookUrlConnections.test.tsx(added, +56/−0)propr-ui/src/pages/PluginsPage/pluginUi.test.ts(+16/−0)test/checkPlugins.test.mjs(+1/−1)Validation evidence
Diff size: 48 files changed, +3,662/−38 lines
Detailed Logs:
30bd7e5f-e44b-4654-b4b5-afba5ce8b3dcLog files stored at:
/usr/src/app/logs/executions/issue-3554-2026-11-16T14-13-09-399Z-conversation.json/usr/src/app/logs/executions/issue-3554-2026-11-16T14-13-09-399Z-output.txtLatest Conversation Messages
This PR was created automatically by ProPR after processing issue #3554.
💡 Need changes?
Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!
Visual preview
Webhook URL connections (desktop)
The Connect step of the Slack plugin at 1440 px: four write-only webhook URL connections labelled 'Webhook URL', the stored default URL never shown, and the accepted hosts under each field.
Full-size original
Webhook URL connections (phone)
The same Connect step at 390 px width.
Full-size original
Slack plugin install step
The Slack plugin before installation: the install step lists the subscribed events and that it posts only to webhook URLs on hooks.slack.com or hooks.slack-gov.com.
Full-size original