Move GitLab for Slack app frontend, IM slash commands, and specs to Core
What does this MR do and why?
This change is part of #355896 (closed) to move all GitLab for Slack app code to Core.
This MR focuses on moving:
- Incident Management Slash Commands
- Views
- Specs
There should be no functional changes.
Note, although the code is moving to Core, for now only GitLab.com, dev and test environments display the admin option to enable the slack_app_enabled
setting. In future, self-managed will see the setting &1211 (closed).
QA
Run your GDK in FOSS ONLY mode:
export FOSS_ONLY=1
gdk restart
In your Rails console, enable the slack_app_enabled
application setting:
current_settings = ApplicationSetting.find_or_create_without_cache;
user = User.first # @root
attrs = { slack_app_enabled: true }
ApplicationSettings::UpdateService.new(current_settings, user, attrs).execute
Because the code is being moved to Core in parts, create a local integration branch with 355896-routes-controllers
:
git checkout 355896-views-specs
git checkout -b temp-integration-branch
git merge 355896-routes-controllers
Create a fake SlackIntegration
record:
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')
- Visit the project's integration settings:
/<PROJECT FULL PATH>/-/settings/integrations
- You should be able to save and edit the form.
- The "Reinstall Slack app" button is clickable, but Slack will reject the request (but it would work on GitLab.com!)
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #355896 (closed)