Skip to content

Add Mattermost incoming webhooks integration#129

Merged
durw4rd merged 1 commit into
launchdarkly:mainfrom
durw4rd:add-mattermost-integration
May 20, 2026
Merged

Add Mattermost incoming webhooks integration#129
durw4rd merged 1 commit into
launchdarkly:mainfrom
durw4rd:add-mattermost-integration

Conversation

@durw4rd
Copy link
Copy Markdown
Contributor

@durw4rd durw4rd commented May 20, 2026

Motivation

There is no first-party Mattermost integration in the LaunchDarkly catalog today. Mattermost is the messaging platform of choice for many organizations that have policy or regulatory reasons not to standardize on Slack — particularly EU customers, defense / public-sector teams, and developers running self-hosted chat. The existing workaround is the ld-webhook-transformer Labs project, which is useful as a Handlebars sandbox but adds operational overhead (Vercel + Neon Postgres + OAuth app) that customers don't want to take on per-team.

A native, LD-hosted Mattermost integration is the natural next step.

What this PR adds

A new integrations/mattermost/ directory containing only static artifacts:

  • manifest.jsonauditLogEventsHook capability, a single uri form variable for the Mattermost incoming webhook URL, three templates (default / project / environment), and a sensible defaultPolicy scoped to production-flag changes.
  • templates/default.json.hbs — Mattermost-flavored Slack-compatible attachment for flag / member / segment / metric / webhook events.
  • templates/project.json.hbs — project-scoped event (no environment field).
  • templates/environment.json.hbs — environment-scoped event.
  • assets/images/square.svg, assets/images/horizontal.svg — official Mattermost "instrument" mark and horizontal lockup, denim colorway, sourced from the Mattermost brand kit.
  • README.md, LICENSE.md (Apache-2.0).

Render output

Sample render of templates/default.json.hbs against sample-context/flag/targeting-rule-update.json (via npm run preview mattermost):

```json
{
"username": "LaunchDarkly",
"attachments": [
{
"fallback": "Henrietta Powell updated the flag Demo flag in 'Production'",
"color": "#405BFF",
"title": "Demo flag",
"title_link": "https://app.launchdarkly.com/default/production/features/demo-flag",
"text": "Henrietta Powell updated the flag Demo flag in `Production`\n\n* Removed ...\n\nComment: Adjusting the targeting rules",
"fields": [
{ "title": "Project", "value": "The big project", "short": true },
{ "title": "Environment", "value": "Production", "short": true },
{ "title": "Action", "value": "updateRules", "short": true }
],
"footer": "LaunchDarkly",
"ts": 1779266887
}
]
}
```

Validation

  • `npm test` → 2387 / 2387 passed, including the per-integration JSON-validity check that renders each of the three `.json.hbs` templates against `sample-context/flag/update-all-environments.json`, `sample-context/project/update.json`, and `sample-context/environment/update.json`.
  • `npm run preview mattermost` produces well-formed, Mattermost-shaped JSON for all sample contexts I tested.

Things to flag for the integrations team

  1. Docs page. `manifest.links.launchdarklyDocs` points at `https://launchdarkly.com/docs/integrations/mattermost\`, which doesn't exist yet. I assume the LD docs team will publish the corresponding page in tandem with merging — happy to draft a one-pager modeled on the existing Microsoft Teams / Slack integration pages if helpful.
  2. Logo usage. The SVGs in `assets/images/` come straight from mattermost.com/brand-guidelines (denim colorway, no modifications). Mattermost's guidelines permit non-commercial usage and " for Mattermost"-style naming, which this manifest follows. If LD legal / partnerships would prefer to pre-coordinate with Mattermost-Inc, that's the most likely path to a future partner-claimed upgrade (changing `author` from LaunchDarkly to Mattermost and rerouting `supportEmail`).
  3. `author` field. Set to `LaunchDarkly` per the community pattern used by msteams, slack, etc. Open to changing to a Labs / community attribution if that's preferred.

I'll also send a heads-up to integrations@launchdarkly.com so the docs-page workflow can start in parallel.

Out of scope (potential follow-ups)

  • `buttonAction` / interactive cards — would require a Mattermost App + backend, not just incoming webhooks.
  • `flagLink` / `trigger` capabilities — same.
  • Localized templates — English only for v1.

Made with Cursor

Receive flag change notifications in Mattermost channels via Mattermost's
incoming webhook feature. Uses the auditLogEventsHook capability with
three templates (default, project, environment) targeting Mattermost's
Slack-compatible attachment payload schema.

All 2,387 tests in npm test pass, including JSON-validity checks
across the project/environment/flag sample contexts.

Co-authored-by: Cursor <cursoragent@cursor.com>
@durw4rd durw4rd requested a review from a team as a code owner May 20, 2026 08:50
Copy link
Copy Markdown

@tknopp-ld tknopp-ld left a comment

Choose a reason for hiding this comment

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

Looks good!

Copy link
Copy Markdown
Contributor

@monsagri monsagri left a comment

Choose a reason for hiding this comment

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

LGTM!

I'll make sure we enable this once it's merged in

@durw4rd durw4rd merged commit b2e1568 into launchdarkly:main May 20, 2026
7 checks passed
@durw4rd durw4rd deleted the add-mattermost-integration branch May 20, 2026 15:27
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.

3 participants