Skip to content

Remove channel fields for chat integrations that don't support them

Markus Koller requested to merge refactor-chat-integrations into master

What does this MR do and why?

With some integrations the webhook is already tied to a specific channel, for others the channels are configurable for each event.

Previously this was weirdly handled by overriding the event_field method in the integrations that don't support channel fields, which meant the fields were still present in #fields but not displayed by the frontend (controlled by Integrations::EventEntity).

To clean this up we're introducing a new method configurable_channels? and only include the channel fields if they're supported.

Extracted from !89664 (closed)

Screenshots or screen recordings

No functional changes, the forms still look the same:

Integrations with channel fields (Slack, Mattermost) Integrations without channel fields (Discord, Google Chat, Microsoft Teams, Unify Circuit, Webex Teams)
image image

How to set up and validate locally

  1. Visit any project and go to Settings → Integrations
  2. Open the form for each affected integration and compare with production.

Regarding the API: This is unchanged too and controlled separately through lib/api/helpers/integrations_helpers.rb, where the channel fields are only defined for Slack and Mattermost.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Markus Koller

Merge request reports