Exclude project-only services from the admin service templates area

What does this MR do?

Currently the Generic Alerts Integration appears at the top of the list of Service Templates in the admin area (as Alerts endpoint). However, this integration currently only supports project-level settings. Clicking on the link produces an exception, resulting from .alerts_service_available? being called on a null @project variable.

This MR allows services to be defined as project-level only, excluding them from the list in the admin area.

To reproduce

  1. Log into gitlab as admin
  2. Navigate to Admin Area > Service Templates
  3. Click 'Alerts endpoint'

Alternative fix

A quicker, less risky fix would be just to bail out of the template if @project.nil?. That would avoid the exception but produces an empty template with a save button, which might not be much better.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by John Hope

Merge request reports

Loading