Skip to content

Present all GitLab for Slack triggers as unchecked

What does this MR do and why?

Previously the GitLab for Slack integration inherited all trigger default values from Integration.

When configuring a new integration the checked checkboxes made the integration appear as though it was pre-configured to send notifications when a notification will not send unless a channel has been specified.

This change sets all trigger default values to false, so the user can enable the ones they want at the same time as specifying a channel.

How to set up and validate locally

The easiest way to preview these changes is to create data locally.

  1. Enable the feature
    Feature.enable(:integration_slack_app_notifications)
  2. On the rails console:
       project = Project.find_by_full_path(<project-full-path>)
    
       # Create a GitLab Slack Application integration
       integration = project.find_or_initialize_integration('gitlab_slack_application')
       integration.assign_attributes(active: true)
       integration.save!(context: :manual_change)
    
       # Create a mock SlackIntegration record, which normally happens when someone goes through the Slack
       # app installation flow, authorizing with their Slack workspace:
       SlackIntegration.create(integration: integration, team_id: 'foo', team_name: 'foo', alias: 'foo', user_id: 'foo')
  3. View the integration settings page Settings > Integrations > Gitlab Slack application, you should see the fields and the checkboxes should not be enabled by default.

MR acceptance checklist

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

Merge request reports