Skip to content

Fix integration 'Test Settings' functionality

Ben King requested to merge benjaminking-integration-fixes into master

What does this MR do and why?

This MR replaces my previous MR attempt to resolve two problems, and addresses issues #461000 & #260292. The original MR was subject to scope creep as I attempted to combine excessive code into a single 'shared' controller. In favour of boring solutions and overall iteration, this simple MR fixes the issues without introducing a new shared controller. Thanks @.luke for the guidance and code suggestion.

Issue 1: Don't save integration when "Test settings"

Project-level integrations only. The MR ensures that instead of updating an integration (and saving the values), it instead assigns the attributes, performs a validation check, then does the required testing without saving it to the project.

GitLab.com (Master) Fixed (This Branch)
issue1-gitlabcom issue1-working

Issue 2: Group-level Jira Integration "Test settings" does not test until details are saved

Group-level integrations only. The MR ensures that when performing a test on a Group integration, it actually performs a callout to validate the settings. In the below example, GitLab.com returns a failure as it is attempting to check the previous saved values (N/A), where the expected behaviour is to check the URL (http://invalid), and return a validation/test check on the values provided.

GitLab.com (Master) Fixed (This Branch)
issue2-gitlabcom issue2-working

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

  1. In GDK, create a new group and subsequent project.
  2. At a project-level, create a Jira integration with fake data, then press 'Test Settings'. The test will fail, and the integration should not be 'saved' to the project. This can be confirmed by going back to the main integrations page for the project.
  3. At a group-level, create a Jira integration with fake data, then press 'Test Settings'. It should attempt an actual test, and may fail with validation checks, or attempt a callout to an Atlassian server if details are provided.

Merge request reports

Loading