Skip to content

Move all supporting code for the GitLab Slack app into Core

Summary

In preparation to make the Slack app available to self-managed instances, we want to move all supporting code from EE to Core.

The code was originally placed in EE because the app is only available on GitLab.com, not because we want to restrict it to EE users. There is no license check as it is not a paid feature.

Improvements

Move all relevant code into Core, without any functional changes.

Risks

Preserving SaaS-only logic

There's some logic to make the Slack application integration only available gitlab.com, and the Slack slash commands integration only available on self-managed (e.g. https://gitlab.com/gitlab-org/gitlab/blob/0d9b1b4a06ea8f207a2dd72336dea682b42e19de/ee/app/models/ee/project.rb#L655, there might be more places).

This logic should be preserved in this initial refactoring.

We can also make one of the final MRs to enable the integration for FOSS in this line.

Broken FOSS pipelines

Our pipelines don't run all specs, so there's a risk of master:foss-broken pipelines due to the changes.

This can hopefully be avoided by labelling all MRs with pipeline:run-as-if-foss pipeline:run-all-rspec.

Involved components

Note, this list is old and is out of date. There has been a lot more code committed since this list was made

Models

!117807 (merged)

  • ee/app/models/integrations/gitlab_slack_application.rb
  • ee/app/models/slack_integration.rb

And some references within:

!117809 (merged)

  • ee/app/models/ee/integration.rb
  • ee/app/models/ee/project.rb

Controllers

  • ee/app/controllers/profiles/slacks_controller.rb
  • ee/app/controllers/projects/settings/slacks_controller.rb

Services

  • ee/app/services/projects/slack_application_install_service.rb
  • ee/app/services/slash_commands/global_slack_handler.rb !118289 (merged)
  • ee/app/integrations/services/slack_event_service.rb
  • ee/app/integrations/services/slack_events/*
  • ee/app/integrations/services/slack_interaction_service.rb
  • ee/app/integrations/services/slack_interactions/*

Workers

  • ee/app/workers/integrations/slack_event_worker.rb
  • ee/app/workers/integrations/slack_interactivity_worker.rb

lib

!117807 (merged)

  • ee/lib/slack/*

frontend (Views and helpers)

  • ee/app/views/profiles/slacks
  • ee/app/assets/javascripts/pages/profiles/slacks/index.js
  • ee/app/views/projects/settings/slacks
  • ee/app/views/projects/services/gitlab_slack_application
  • ee/app/views/admin/application_settings/_slack.html.haml
  • ee/app/helpers/ee/integrations_helper.rb
  • ee/app/assets/javascripts/integrations/gitlab_slack_application/index.js

API

  • ee/lib/ee/api/integrations.rb !118289 (merged)
  • ee/lib/api/integrations/slack/*
Edited by Luke Duncalfe