From fe795125f610fffc0d656f1cdb99a2d80bb63621 Mon Sep 17 00:00:00 2001 From: David Wainaina Date: Thu, 13 May 2021 08:54:32 +0000 Subject: [PATCH 1/7] Add ruby script to change settings to Jira instance-level integration --- .../troubleshooting/gitlab_rails_cheat_sheet.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md b/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md index dfa17b4e85d622..a34b684893f184 100644 --- a/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md +++ b/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md @@ -279,6 +279,19 @@ p.each do |project| end ``` +## Bulk update to change Jira project-level integrations for _all_ projects to Jira instance-level integration + +To change all Jira project to use the instance-level integration settings, do: + +```ruby +jira_service_instance_id = JiraService.find_by(instance: true).id +JiraService.where(active: true, instance: false, template: false, inherit_from_id: nil).find_each do |service| + next unless service.project_level? + service.update_attribute(inherit_from_id: jira_service_instance_id) +end +``` +After running the script, modify and save again the instance-level integration from the UI to propagate the changes to all the project-level integrations. + ### Bulk update to disable the Slack Notification service To disable notifications for all projects that have Slack service enabled, do: -- GitLab From 37da48bf559d959f59b5b20adecef0b97a9da9d5 Mon Sep 17 00:00:00 2001 From: David Wainaina Date: Thu, 13 May 2021 09:02:25 +0000 Subject: [PATCH 2/7] Add an empty line --- doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md b/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md index a34b684893f184..919357704feb6a 100644 --- a/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md +++ b/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md @@ -290,6 +290,7 @@ JiraService.where(active: true, instance: false, template: false, inherit_from_i service.update_attribute(inherit_from_id: jira_service_instance_id) end ``` + After running the script, modify and save again the instance-level integration from the UI to propagate the changes to all the project-level integrations. ### Bulk update to disable the Slack Notification service -- GitLab From 0cde4f5f254583560481e21b3d31dd840a438bce Mon Sep 17 00:00:00 2001 From: Arturo Herrero Date: Thu, 13 May 2021 14:27:43 +0000 Subject: [PATCH 3/7] apply instance-level settings to the groups or subgroups --- doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md b/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md index 919357704feb6a..a6ef700fb35cba 100644 --- a/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md +++ b/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md @@ -286,7 +286,6 @@ To change all Jira project to use the instance-level integration settings, do: ```ruby jira_service_instance_id = JiraService.find_by(instance: true).id JiraService.where(active: true, instance: false, template: false, inherit_from_id: nil).find_each do |service| - next unless service.project_level? service.update_attribute(inherit_from_id: jira_service_instance_id) end ``` -- GitLab From 064e633d1327ae55f27af369a2595c3b7c151e39 Mon Sep 17 00:00:00 2001 From: Arturo Herrero Date: Thu, 13 May 2021 14:29:02 +0000 Subject: [PATCH 4/7] Add more emphasis after running script --- doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md b/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md index a6ef700fb35cba..fb1007508bb55a 100644 --- a/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md +++ b/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md @@ -290,7 +290,7 @@ JiraService.where(active: true, instance: false, template: false, inherit_from_i end ``` -After running the script, modify and save again the instance-level integration from the UI to propagate the changes to all the project-level integrations. +WARNING: After running the script, modify and save again the instance-level integration from the UI to propagate the changes to all the group-level and project-level integrations. ### Bulk update to disable the Slack Notification service -- GitLab From 6e861c3f49ff2ca5600a9fcaf5ea1b351809c453 Mon Sep 17 00:00:00 2001 From: David Wainaina Date: Thu, 13 May 2021 14:32:55 +0000 Subject: [PATCH 5/7] Rectify warning box --- doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md b/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md index fb1007508bb55a..b3d1c241d55473 100644 --- a/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md +++ b/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md @@ -290,7 +290,8 @@ JiraService.where(active: true, instance: false, template: false, inherit_from_i end ``` -WARNING: After running the script, modify and save again the instance-level integration from the UI to propagate the changes to all the group-level and project-level integrations. +WARNING: +After running the script, modify and save again the instance-level integration from the UI to propagate the changes to all the group-level and project-level integrations. ### Bulk update to disable the Slack Notification service -- GitLab From 9a312ee945f167e18bb65fa4efd93072e1d38e7d Mon Sep 17 00:00:00 2001 From: David Wainaina Date: Thu, 13 May 2021 14:46:21 +0000 Subject: [PATCH 6/7] Remove extra whitespace --- doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md b/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md index b3d1c241d55473..7e99d0cde2685c 100644 --- a/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md +++ b/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md @@ -290,7 +290,7 @@ JiraService.where(active: true, instance: false, template: false, inherit_from_i end ``` -WARNING: +WARNING: After running the script, modify and save again the instance-level integration from the UI to propagate the changes to all the group-level and project-level integrations. ### Bulk update to disable the Slack Notification service -- GitLab From 317e40bea9cf74afe96347f07623db26b83f9b60 Mon Sep 17 00:00:00 2001 From: Achilleas Pipinellis Date: Thu, 27 May 2021 09:53:41 +0000 Subject: [PATCH 7/7] Change to ordered list --- .../gitlab_rails_cheat_sheet.md | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md b/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md index 7e99d0cde2685c..34c7fddfb4071a 100644 --- a/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md +++ b/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md @@ -279,19 +279,20 @@ p.each do |project| end ``` -## Bulk update to change Jira project-level integrations for _all_ projects to Jira instance-level integration +## Bulk update to change all the Jira integrations to Jira instance-level values -To change all Jira project to use the instance-level integration settings, do: +To change all Jira project to use the instance-level integration settings: -```ruby -jira_service_instance_id = JiraService.find_by(instance: true).id -JiraService.where(active: true, instance: false, template: false, inherit_from_id: nil).find_each do |service| - service.update_attribute(inherit_from_id: jira_service_instance_id) -end -``` +1. In a Rails console: -WARNING: -After running the script, modify and save again the instance-level integration from the UI to propagate the changes to all the group-level and project-level integrations. + ```ruby + jira_service_instance_id = JiraService.find_by(instance: true).id + JiraService.where(active: true, instance: false, template: false, inherit_from_id: nil).find_each do |service| + service.update_attribute(inherit_from_id: jira_service_instance_id) + end + ``` + +1. Modify and save again the instance-level integration from the UI to propagate the changes to all the group-level and project-level integrations. ### Bulk update to disable the Slack Notification service -- GitLab