Skip to content

Bugfix `@service` being nil in integrations views

Luke Duncalfe requested to merge 331262-bugfix-services-variable into master

What does this MR do?

This fixes an error when users view any instance or group-level integrations that have a @service variable in their view templates.

We renamed a variable @service to @integration in 5fd1c950 in IntegrationsActions (a concern used by instance and group-level integrations controllers). We need to continue to support that variable as it is referred to in shared views that instance and group-level integrations use, such as app/views/projects/services/mattermost_slash_commands/_help.html.haml.

This fix applies the same approach as in the original commit to continue to support this variable for project-level integrations. Removing the need for supporting @service will be addressed in #329759 (closed).

It also adds a basic framework for group and instance-level integration tests with an initial test of the Mattermost Slash Command integration (one of the integrations that broke). A follow-up issue will address the remaining holes in our test suite #331325 (closed).

Issue: #331262 (closed)

Before merging

We should apply the Pick into 13.12 label when this MR is ready to be merged to master !62054 (comment 578960963).

QA steps

  1. Go to Admin -> Settings -> Integrations
  2. Click on Mattermost slash commands
  3. The integration should render fine. Previously this caused a 500 error: undefined method project_level? for nil:NilClass

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Related to #331262 (closed)

Edited by Luke Duncalfe

Merge request reports

Loading