Group-level Jira Integration "Test settings" does not test until details are saved
Summary
The group-level Jira integration does not properly 'test' the URL/API URL value(s) until you select 'Save changes' first. Here's a side-by-side example.
Note A non-existent URL is provided. We would expect to receive an immediate error that the URL is not resolvable or blocked, which only occurs after we've saved the values:
Values entered, "Test settings" selected. | Values entered, saved. "Test settings" selected. |
---|---|
Steps to reproduce
- Navigate to a top-level or subgroup.
- Go to Settings > Integrations. Select Jira.
- Configure dummy data for a Jira Integration, such as
https://example
, which is an unreachable address that does not exist. A dummy username/email and API Token/Password is required due to required fields, but isn't checked during the test. - Confirm that selecting 'Test settings' returns the generic response message, but no additional information.
- Save the configuration.
- Test again with 'Test settings' and confirm an appropriate error (or success) message is returned.
Example Project
This has been reproduced on top-level group: https://gitlab.com/benjaminking_ultimate_group
What is the current bug behavior?
Triggering 'Test settings' seems to initiate the Jira test function, but it fails to trigger the actual test function.
What is the expected correct behavior?
Triggering 'Test settings' completes a test using existing functionality, which at this point in time is to test the URL/API URL.
Output of checks
This bug happens on GitLab.com
Possible fixes
I've tried to test this in GDK, but am having trouble finding the exact reason where the 'working' and 'not working' groups split off. I ran a debug in Rails output and the only change I see is:
No additional response, doesn't seem to run a test at all
<omitted>
Integrations::Jira Load (0.5ms) SELECT "integrations".* FROM "integrations" WHERE "integrations"."type_new" = 'Integrations::Jira' AND "integrations"."instance" = FALSE AND "integrations"."group_id" = 33 LIMIT 1 /*application:web,correlation_id:01HXDSJZAG04YBEY99KP71H5QE,endpoint_id:Groups::Settings::IntegrationsController#test,db_config_name:main,line:/app/models/integration.rb:290:in `find_or_initialize_non_project_specific_integration'*/
↳ app/models/integration.rb:290:in `find_or_initialize_non_project_specific_integration'
Route Load (0.3ms) SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 33 AND "routes"."source_type" = 'Namespace' LIMIT 1 /*application:web,correlation_id:01HXDSJZAG04YBEY99KP71H5QE,endpoint_id:Groups::Settings::IntegrationsController#test,db_config_name:main,line:/app/models/concerns/routable.rb:155:in `block in full_attribute'*/
↳ app/models/concerns/routable.rb:155:in `block in full_attribute'
Completed 200 OK in 45ms (Views: 0.3ms | ActiveRecord: 1.9ms | Elasticsearch: 0.0ms | Allocations: 31771)
Runs a test successfully
<omitted>
Integrations::Jira Load (1.0ms) SELECT "integrations".* FROM "integrations" WHERE "integrations"."type_new" = 'Integrations::Jira' AND "integrations"."instance" = FALSE AND "integrations"."group_id" = 27 LIMIT 1 /*application:web,correlation_id:01HXDRCXWVMVBWMJWJTTTSAZB5,endpoint_id:Groups::Settings::IntegrationsController#test,db_config_name:main,line:/app/models/integration.rb:290:in `find_or_initialize_non_project_specific_integration'*/
↳ app/models/integration.rb:290:in `find_or_initialize_non_project_specific_integration'
Integrations::JiraTrackerData Load (0.5ms) SELECT "jira_tracker_data".* FROM "jira_tracker_data" WHERE "jira_tracker_data"."integration_id" = 6 LIMIT 1 /*application:web,correlation_id:01HXDRCXWVMVBWMJWJTTTSAZB5,endpoint_id:Groups::Settings::IntegrationsController#test,db_config_name:main,line:/app/models/integrations/jira.rb:178:in `data_fields'*/
↳ app/models/integrations/jira.rb:178:in `data_fields'
Route Load (0.4ms) SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 27 AND "routes"."source_type" = 'Namespace' LIMIT 1 /*application:web,correlation_id:01HXDRCXWVMVBWMJWJTTTSAZB5,endpoint_id:Groups::Settings::IntegrationsController#test,db_config_name:main,line:/app/models/concerns/routable.rb:155:in `block in full_attribute'*/
↳ app/models/concerns/routable.rb:155:in `block in full_attribute'
Completed 200 OK in 1065ms (Views: 0.5ms | ActiveRecord: 25.2ms | Elasticsearch: 0.0ms | Allocations: 200776)
It seems to 'skip' the route lookup, then goes to Integrations::JiraTrackerData
which actually prepares some data for sending in the test?