Skip to content

Don't show integrations overrides tab at group level

Tom Quirk requested to merge 218252-group-integrtaion-override-fix into master

What does this MR do?

Follow-up to !66995 (merged) (for #218252 (closed)), currently behind the instance_level_integration_overrides feature flag (disabled by default, #336750 (closed)).

This MR fixes a bug where the instance-level overrides link was being shown on group-level integrations; there should be no tabs at the group-level.

Instance and group-level integrations pages share the same haml templates, so a check for integration.instance_level? has been added for this link, and test coverage at the group level.

Screenshots or Screencasts (strongly suggested)

Before (group-level) After (group-level)
Screen_Shot_2021-08-17_at_1.09.29_pm Screen_Shot_2021-08-17_at_1.08.35_pm

(optional) How to setup and validate locally (strongly suggested)

  1. Enable the feature

    Feature.enable(:instance_level_integration_overrides)
  2. Visit a project's Campfire integration setting page such as http://127.0.0.1:3000/flightjs/flight/-/services/campfire/edit.

  3. Enter anything into the "Campfire token" field and save.

  4. Visit the instance admin's Campfire integration setting page http://127.0.0.1:3000/admin/application_settings/integrations/campfire/edit.

  5. Click the "Projects using custom settings" tab.

  6. The project should appear in the list.

  7. Click the "Settings" tab now.

  8. Enter a different "Campfire token" into the field and save. A modal will appear. Click save.

  9. Visit the same project's Campfire integration setting page again such as http://127.0.0.1:3000/flightjs/flight/-/services/campfire/edit.

  10. Change the drop-down from "Use custom settings" to "Use default settings".

  11. Click save.

  12. Visit the instance admin's "Projects using custom settings" page again http://127.0.0.1:3000/admin/application_settings/integrations/campfire/overrides.

  13. The project should no longer appear in the list.

Repeat for group-level integrations to test group level.

Edited by Tom Quirk

Merge request reports