diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 530faada428..e38e2f765bd 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -111,5 +111,4 @@ include:
- local: .gitlab/ci/dast.gitlab-ci.yml
- local: .gitlab/ci/workhorse.gitlab-ci.yml
- local: .gitlab/ci/graphql.gitlab-ci.yml
- - project: 'gitlab-org/frontend/untamper-my-lockfile'
- file: '.gitlab-ci-template.yml'
+ - local: .gitlab/ci/verify-lockfile.gitlab-ci.yml
diff --git a/.gitlab/ci/verify-lockfile.gitlab-ci.yml b/.gitlab/ci/verify-lockfile.gitlab-ci.yml
new file mode 100644
index 00000000000..6336a428b4b
--- /dev/null
+++ b/.gitlab/ci/verify-lockfile.gitlab-ci.yml
@@ -0,0 +1,11 @@
+verify_lockfile:
+ stage: test
+ image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.7.2-git-2.29-lfs-2.9-node-14.15-yarn-1.22-graphicsmagick-1.3.34
+ needs: []
+ rules:
+ - changes:
+ - yarn.lock
+ script:
+ - npm config set @dappelt:registry https://gitlab.com/api/v4/projects/22564149/packages/npm/
+ - npx lockfile-lint@4.3.7 --path yarn.lock --allowed-hosts yarn --validate-https
+ - npx @dappelt/untamper-my-lockfile --lockfile yarn.lock
diff --git a/Gemfile b/Gemfile
index 66ca052dada..58eea956427 100644
--- a/Gemfile
+++ b/Gemfile
@@ -156,7 +156,7 @@ gem 'wikicloth', '0.8.1'
gem 'asciidoctor', '~> 2.0.10'
gem 'asciidoctor-include-ext', '~> 0.3.1', require: false
gem 'asciidoctor-plantuml', '~> 0.0.12'
-gem 'asciidoctor-kroki', '~> 0.2.2', require: false
+gem 'asciidoctor-kroki', '~> 0.3.0', require: false
gem 'rouge', '~> 3.26.0'
gem 'truncato', '~> 0.7.11'
gem 'bootstrap_form', '~> 4.2.0'
diff --git a/Gemfile.lock b/Gemfile.lock
index 3962fe27073..bea01cf000d 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -84,7 +84,7 @@ GEM
asciidoctor (2.0.12)
asciidoctor-include-ext (0.3.1)
asciidoctor (>= 1.5.6, < 3.0.0)
- asciidoctor-kroki (0.2.2)
+ asciidoctor-kroki (0.3.0)
asciidoctor (~> 2.0)
asciidoctor-plantuml (0.0.12)
asciidoctor (>= 1.5.6, < 3.0.0)
@@ -1291,7 +1291,7 @@ DEPENDENCIES
asana (~> 0.10.3)
asciidoctor (~> 2.0.10)
asciidoctor-include-ext (~> 0.3.1)
- asciidoctor-kroki (~> 0.2.2)
+ asciidoctor-kroki (~> 0.3.0)
asciidoctor-plantuml (~> 0.0.12)
atlassian-jwt (~> 0.2.0)
attr_encrypted (~> 3.1.0)
diff --git a/app/controllers/admin/application_settings_controller.rb b/app/controllers/admin/application_settings_controller.rb
index eb3de936fad..7f7d38a09c5 100644
--- a/app/controllers/admin/application_settings_controller.rb
+++ b/app/controllers/admin/application_settings_controller.rb
@@ -238,6 +238,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
*::ApplicationSettingsHelper.visible_attributes,
*::ApplicationSettingsHelper.external_authorization_service_attributes,
*ApplicationSetting.repository_storages_weighted_attributes,
+ *ApplicationSetting.kroki_formats_attributes.keys.map { |key| "kroki_formats_#{key}".to_sym },
:lets_encrypt_notification_email,
:lets_encrypt_terms_of_service_accepted,
:domain_denylist_file,
diff --git a/app/helpers/application_settings_helper.rb b/app/helpers/application_settings_helper.rb
index b3b90c79076..30ae535b06f 100644
--- a/app/helpers/application_settings_helper.rb
+++ b/app/helpers/application_settings_helper.rb
@@ -26,6 +26,16 @@ module ApplicationSettingsHelper
end
end
+ def kroki_available_formats
+ ApplicationSetting.kroki_formats_attributes.map do |key, value|
+ {
+ name: "kroki_formats_#{key}",
+ label: value[:label],
+ value: @application_setting.kroki_formats[key] || false
+ }
+ end
+ end
+
def storage_weights
ApplicationSetting.repository_storages_weighted_attributes.map do |attribute|
storage = attribute.to_s.delete_prefix('repository_storages_weighted_')
@@ -259,6 +269,7 @@ module ApplicationSettingsHelper
:personal_access_token_prefix,
:kroki_enabled,
:kroki_url,
+ :kroki_formats,
:plantuml_enabled,
:plantuml_url,
:polling_interval_multiplier,
diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb
index 6d375a19ffb..33c058dab96 100644
--- a/app/models/application_setting.rb
+++ b/app/models/application_setting.rb
@@ -29,6 +29,21 @@ class ApplicationSetting < ApplicationRecord
@repository_storages_weighted_atributes ||= Gitlab.config.repositories.storages.keys.map { |k| "repository_storages_weighted_#{k}".to_sym }.freeze
end
+ def self.kroki_formats_attributes
+ {
+ blockdiag: {
+ label: 'BlockDiag (includes BlockDiag, SeqDiag, ActDiag, NwDiag, PacketDiag and RackDiag)'
+ },
+ bpmn: {
+ label: 'BPMN'
+ },
+ excalidraw: {
+ label: 'Excalidraw'
+ }
+ }
+ end
+
+ store_accessor :kroki_formats, *ApplicationSetting.kroki_formats_attributes.keys, prefix: true
store_accessor :repository_storages_weighted, *Gitlab.config.repositories.storages.keys, prefix: true
# Include here so it can override methods from
@@ -54,6 +69,7 @@ class ApplicationSetting < ApplicationRecord
default_value_for :id, 1
default_value_for :repository_storages_weighted, {}
+ default_value_for :kroki_formats, {}
chronic_duration_attr_writer :archive_builds_in_human_readable, :archive_builds_in_seconds
@@ -135,6 +151,8 @@ class ApplicationSetting < ApplicationRecord
validate :validate_kroki_url, if: :kroki_enabled
+ validates :kroki_formats, json_schema: { filename: 'application_setting_kroki_formats' }
+
validates :plantuml_url,
presence: true,
if: :plantuml_enabled
@@ -570,6 +588,25 @@ class ApplicationSetting < ApplicationRecord
end
end
+ kroki_formats_attributes.keys.each do |key|
+ define_method :"kroki_formats_#{key}=" do |value|
+ super(::Gitlab::Utils.to_boolean(value))
+ end
+ end
+
+ def kroki_format_supported?(diagram_type)
+ case diagram_type
+ when 'excalidraw'
+ return kroki_formats_excalidraw
+ when 'bpmn'
+ return kroki_formats_bpmn
+ end
+
+ return kroki_formats_blockdiag if ::Gitlab::Kroki::BLOCKDIAG_FORMATS.include?(diagram_type)
+
+ ::AsciidoctorExtensions::Kroki::SUPPORTED_DIAGRAM_NAMES.include?(diagram_type)
+ end
+
private
def parsed_grafana_url
diff --git a/app/models/application_setting_implementation.rb b/app/models/application_setting_implementation.rb
index e5284d15a49..2911ae6b1c8 100644
--- a/app/models/application_setting_implementation.rb
+++ b/app/models/application_setting_implementation.rb
@@ -176,6 +176,7 @@ module ApplicationSettingImplementation
container_registry_expiration_policies_worker_capacity: 0,
kroki_enabled: false,
kroki_url: nil,
+ kroki_formats: { blockdiag: false, bpmn: false, excalidraw: false },
rate_limiting_response_text: nil
}
end
diff --git a/app/services/container_expiration_policies/cleanup_service.rb b/app/services/container_expiration_policies/cleanup_service.rb
index 83a4d422a4f..69e5620d986 100644
--- a/app/services/container_expiration_policies/cleanup_service.rb
+++ b/app/services/container_expiration_policies/cleanup_service.rb
@@ -4,7 +4,7 @@ module ContainerExpirationPolicies
class CleanupService
attr_reader :repository
- SERVICE_RESULT_FIELDS = %i[original_size before_truncate_size after_truncate_size before_delete_size].freeze
+ SERVICE_RESULT_FIELDS = %i[original_size before_truncate_size after_truncate_size before_delete_size deleted_size].freeze
def initialize(repository)
@repository = repository
diff --git a/app/services/projects/container_repository/cleanup_tags_service.rb b/app/services/projects/container_repository/cleanup_tags_service.rb
index af0107436c8..793d2fec033 100644
--- a/app/services/projects/container_repository/cleanup_tags_service.rb
+++ b/app/services/projects/container_repository/cleanup_tags_service.rb
@@ -25,6 +25,7 @@ module Projects
result[:before_truncate_size] = before_truncate_size
result[:after_truncate_size] = after_truncate_size
result[:before_delete_size] = tags.size
+ result[:deleted_size] = result[:deleted]&.size
result[:status] = :error if before_truncate_size != after_truncate_size
end
diff --git a/app/validators/json_schemas/application_setting_kroki_formats.json b/app/validators/json_schemas/application_setting_kroki_formats.json
new file mode 100644
index 00000000000..460dc74069f
--- /dev/null
+++ b/app/validators/json_schemas/application_setting_kroki_formats.json
@@ -0,0 +1,10 @@
+{
+ "description": "Kroki formats",
+ "type": "object",
+ "properties": {
+ "bpmn": { "type": "boolean" },
+ "excalidraw": { "type": "boolean" },
+ "blockdiag": { "type": "boolean" }
+ },
+ "additionalProperties": false
+}
diff --git a/app/views/admin/application_settings/_kroki.html.haml b/app/views/admin/application_settings/_kroki.html.haml
index 23848fb8b9b..cd57d4cca65 100644
--- a/app/views/admin/application_settings/_kroki.html.haml
+++ b/app/views/admin/application_settings/_kroki.html.haml
@@ -21,5 +21,13 @@
= f.text_field :kroki_url, class: 'form-control gl-form-input', placeholder: 'http://your-kroki-instance:8000'
.form-text.text-muted
= (_('When Kroki is enabled, GitLab sends diagrams to an instance of Kroki to display them as images. You can use the free public cloud instance %{kroki_public_url} or you can %{install_link} on your own infrastructure. Once you\'ve installed Kroki, make sure to update the server URL to point to your instance.') % { kroki_public_url: 'https://kroki.io', install_link: link_to('install Kroki', 'https://docs.kroki.io/kroki/setup/install/', target: '_blank') }).html_safe
+ .form-group
+ = f.label :kroki_formats, 'Additional diagram formats', class: 'label-bold'
+ .form-text.text-muted
+ = (_('Using additional formats requires starting the companion containers. Make sure that all %{kroki_images} are running.') % { kroki_images: link_to('required containers', 'https://docs.kroki.io/kroki/setup/install/#_images', target: '_blank') }).html_safe
+ - kroki_available_formats.each do |format|
+ .form-check
+ = f.check_box format[:name], class: 'form-check-input'
+ = f.label format[:name], format[:label], class: 'form-check-label'
= f.submit _('Save changes'), class: "btn gl-button btn-success"
diff --git a/app/workers/container_expiration_policies/cleanup_container_repository_worker.rb b/app/workers/container_expiration_policies/cleanup_container_repository_worker.rb
index b4afe53d4bc..53220a7afed 100644
--- a/app/workers/container_expiration_policies/cleanup_container_repository_worker.rb
+++ b/app/workers/container_expiration_policies/cleanup_container_repository_worker.rb
@@ -18,6 +18,7 @@ module ContainerExpirationPolicies
cleanup_tags_service_before_truncate_size
cleanup_tags_service_after_truncate_size
cleanup_tags_service_before_delete_size
+ cleanup_tags_service_deleted_size
].freeze
def perform_work
@@ -117,6 +118,7 @@ module ContainerExpirationPolicies
after_truncate_size &&
before_truncate_size != after_truncate_size
log_extra_metadata_on_done(:cleanup_tags_service_truncated, !!truncated)
+ log_extra_metadata_on_done(:running_jobs_count, running_jobs_count)
end
end
end
diff --git a/changelogs/unreleased/241744-additional-formats-kroki.yml b/changelogs/unreleased/241744-additional-formats-kroki.yml
new file mode 100644
index 00000000000..f305ee13553
--- /dev/null
+++ b/changelogs/unreleased/241744-additional-formats-kroki.yml
@@ -0,0 +1,5 @@
+---
+title: "Enable/disable additional diagram formats on Kroki"
+merge_request: 49304
+author: Guillaume Grossetie
+type: added
diff --git a/db/migrate/20201120092000_add_kroki_formats_to_application_settings_table.rb b/db/migrate/20201120092000_add_kroki_formats_to_application_settings_table.rb
new file mode 100644
index 00000000000..a059099dbc4
--- /dev/null
+++ b/db/migrate/20201120092000_add_kroki_formats_to_application_settings_table.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class AddKrokiFormatsToApplicationSettingsTable < ActiveRecord::Migration[6.0]
+ DOWNTIME = false
+
+ def change
+ change_table :application_settings do |t|
+ t.jsonb :kroki_formats, null: false, default: {}
+ end
+ end
+end
diff --git a/db/schema_migrations/20201120092000 b/db/schema_migrations/20201120092000
new file mode 100644
index 00000000000..eaa6c37cff2
--- /dev/null
+++ b/db/schema_migrations/20201120092000
@@ -0,0 +1 @@
+c8f837a5fe7a1959af41f19f93b6dd96d8907a476626f124876ee8b10b120b71
\ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index e8d94c87b7c..d582c343e73 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -9398,6 +9398,7 @@ CREATE TABLE application_settings (
keep_latest_artifact boolean DEFAULT true NOT NULL,
notes_create_limit integer DEFAULT 300 NOT NULL,
notes_create_limit_allowlist text[] DEFAULT '{}'::text[] NOT NULL,
+ kroki_formats jsonb DEFAULT '{}'::jsonb NOT NULL,
CONSTRAINT app_settings_container_reg_cleanup_tags_max_list_size_positive CHECK ((container_registry_cleanup_tags_service_max_list_size >= 0)),
CONSTRAINT app_settings_registry_exp_policies_worker_capacity_positive CHECK ((container_registry_expiration_policies_worker_capacity >= 0)),
CONSTRAINT check_17d9558205 CHECK ((char_length((kroki_url)::text) <= 1024)),
diff --git a/doc/administration/auth/img/okta_admin_panel_v13_9.png b/doc/administration/auth/img/okta_admin_panel_v13_9.png
index bba859c80af..2ebb1f0112c 100644
Binary files a/doc/administration/auth/img/okta_admin_panel_v13_9.png and b/doc/administration/auth/img/okta_admin_panel_v13_9.png differ
diff --git a/doc/administration/img/impersonated_audit_events_v13_8.png b/doc/administration/img/impersonated_audit_events_v13_8.png
index 8d7d13942d0..0a8548d515d 100644
Binary files a/doc/administration/img/impersonated_audit_events_v13_8.png and b/doc/administration/img/impersonated_audit_events_v13_8.png differ
diff --git a/doc/administration/img/time_zone_settings.png b/doc/administration/img/time_zone_settings.png
index 73961b1090c..e735a8bc5ec 100644
Binary files a/doc/administration/img/time_zone_settings.png and b/doc/administration/img/time_zone_settings.png differ
diff --git a/doc/administration/maintenance_mode/maintenance_mode_error_message.png b/doc/administration/maintenance_mode/maintenance_mode_error_message.png
index 0a98d36beb8..4b422a719ca 100644
Binary files a/doc/administration/maintenance_mode/maintenance_mode_error_message.png and b/doc/administration/maintenance_mode/maintenance_mode_error_message.png differ
diff --git a/doc/api/graphql/img/users_query_example_v13_8.png b/doc/api/graphql/img/users_query_example_v13_8.png
index b4c2b4e999a..155824cad6e 100644
Binary files a/doc/api/graphql/img/users_query_example_v13_8.png and b/doc/api/graphql/img/users_query_example_v13_8.png differ
diff --git a/doc/ci/pipeline_editor/img/pipeline_editor_commit_v13_8.png b/doc/ci/pipeline_editor/img/pipeline_editor_commit_v13_8.png
index cc1f666f319..fcafc984ce4 100644
Binary files a/doc/ci/pipeline_editor/img/pipeline_editor_commit_v13_8.png and b/doc/ci/pipeline_editor/img/pipeline_editor_commit_v13_8.png differ
diff --git a/doc/ci/pipelines/img/job_artifacts_merge_request.png b/doc/ci/pipelines/img/job_artifacts_merge_request.png
index fa1ed9acbf8..e87839ceeca 100644
Binary files a/doc/ci/pipelines/img/job_artifacts_merge_request.png and b/doc/ci/pipelines/img/job_artifacts_merge_request.png differ
diff --git a/doc/development/cicd/img/ci_minutes.png b/doc/development/cicd/img/ci_minutes.png
index e65a856a248..d47406fb445 100644
Binary files a/doc/development/cicd/img/ci_minutes.png and b/doc/development/cicd/img/ci_minutes.png differ
diff --git a/doc/development/testing_guide/best_practices.md b/doc/development/testing_guide/best_practices.md
index 0ccf513f5d8..79ff46ae352 100644
--- a/doc/development/testing_guide/best_practices.md
+++ b/doc/development/testing_guide/best_practices.md
@@ -521,35 +521,6 @@ let_it_be_with_refind(:project) { create(:project) }
let_it_be(:project, refind: true) { create(:project) }
```
-### License stubbing with `let_it_be`
-
-`let_it_be_with_refind` is also useful when using `stub_licensed_features` in your tests:
-
-```ruby
-let_it_be_with_refind(:project) { create(:project) }
-# Project#licensed_feature_available? is memoized, and so we need to refind
-# the project for license updates to be applied.
-# An alternative is `project.clear_memoization(:licensed_feature_available)`.
-
-subject { project.allows_multiple_assignees? }
-
-context 'with license multiple_issue_assignees disabled' do
- before do
- stub_licensed_features(multiple_issue_assignees: true)
- end
-
- it { is_expected.to eq(true) }
-end
-
-context 'with license multiple_issue_assignees disabled' do
- before do
- stub_licensed_features(multiple_issue_assignees: false)
- end
-
- it { is_expected.to eq(false) }
-end
-```
-
### Time-sensitive tests
[`ActiveSupport::Testing::TimeHelpers`](https://api.rubyonrails.org/v6.0.3.1/classes/ActiveSupport/Testing/TimeHelpers.html)
diff --git a/doc/university/training/gitlab_flow.md b/doc/university/training/gitlab_flow.md
index f25bff03926..bdc97ff8d28 100644
--- a/doc/university/training/gitlab_flow.md
+++ b/doc/university/training/gitlab_flow.md
@@ -1,57 +1,8 @@
---
-stage: none
-group: unassigned
-info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
-comments: false
-type: reference
+redirect_to: '../../topics/gitlab_flow.md'
---
-# What is the GitLab Flow
+This document was moved to [another location](../../topics/gitlab_flow.md).
-- A simplified branching strategy
-- All features and fixes first go to master
-- Allows for 'production' or 'stable' branches
-- Bug fixes/hot fix patches are cherry-picked from master
-
-## Feature branches
-
-- Create a feature/bugfix branch to do all work
-- Use merge requests to merge to master
-
-
-
-## Production branch
-
-- One, long-running production release branch
- as opposed to individual stable branches
-- Consider creating a tag for each version that gets deployed
-
-
-
-## Release branch
-
-- Useful if you release software to customers
-- When preparing a new release, create stable branch
- from master
-- Consider creating a tag for each version
-- Cherry-pick critical bug fixes to stable branch for patch release
-- Never commit bug fixes directly to stable branch
-
-
-
-## More details
-
-For more information, read through the [GitLab Flow](../../topics/gitlab_flow.md)
-documentation.
-
-
+
+
diff --git a/doc/user/admin_area/analytics/img/cohorts_v13_9.png b/doc/user/admin_area/analytics/img/cohorts_v13_9.png
index 3e141f24950..6a616b201c9 100644
Binary files a/doc/user/admin_area/analytics/img/cohorts_v13_9.png and b/doc/user/admin_area/analytics/img/cohorts_v13_9.png differ
diff --git a/doc/user/admin_area/analytics/img/dev_ops_adoption_v13_9.png b/doc/user/admin_area/analytics/img/dev_ops_adoption_v13_9.png
index 0f96af4ef38..a295179dda3 100644
Binary files a/doc/user/admin_area/analytics/img/dev_ops_adoption_v13_9.png and b/doc/user/admin_area/analytics/img/dev_ops_adoption_v13_9.png differ
diff --git a/doc/user/admin_area/img/impersonate_user_button_v13_8.png b/doc/user/admin_area/img/impersonate_user_button_v13_8.png
index 2c44c2bd28c..475315a0c0f 100644
Binary files a/doc/user/admin_area/img/impersonate_user_button_v13_8.png and b/doc/user/admin_area/img/impersonate_user_button_v13_8.png differ
diff --git a/doc/user/admin_area/img/license_details_v13_8.png b/doc/user/admin_area/img/license_details_v13_8.png
index dc12649fbe9..00421d8a41d 100644
Binary files a/doc/user/admin_area/img/license_details_v13_8.png and b/doc/user/admin_area/img/license_details_v13_8.png differ
diff --git a/doc/user/discussions/img/apply_suggestion_v13_9.png b/doc/user/discussions/img/apply_suggestion_v13_9.png
index 932855a8c97..e27fa629672 100644
Binary files a/doc/user/discussions/img/apply_suggestion_v13_9.png and b/doc/user/discussions/img/apply_suggestion_v13_9.png differ
diff --git a/doc/user/discussions/img/confidential_comments_v13_9.png b/doc/user/discussions/img/confidential_comments_v13_9.png
index d3e13f37ae9..b5be5a622a9 100644
Binary files a/doc/user/discussions/img/confidential_comments_v13_9.png and b/doc/user/discussions/img/confidential_comments_v13_9.png differ
diff --git a/doc/user/discussions/img/custom_commit_v13_9.png b/doc/user/discussions/img/custom_commit_v13_9.png
index 547a6534ea1..170c04542dd 100644
Binary files a/doc/user/discussions/img/custom_commit_v13_9.png and b/doc/user/discussions/img/custom_commit_v13_9.png differ
diff --git a/doc/user/discussions/img/make_suggestion_v13_9.png b/doc/user/discussions/img/make_suggestion_v13_9.png
index dc6889cfcd6..92d5ba5ddda 100644
Binary files a/doc/user/discussions/img/make_suggestion_v13_9.png and b/doc/user/discussions/img/make_suggestion_v13_9.png differ
diff --git a/doc/user/discussions/img/resolve_thread_open_issue_v13_9.png b/doc/user/discussions/img/resolve_thread_open_issue_v13_9.png
index 6611ca7b1ff..8ff0f5e84dd 100644
Binary files a/doc/user/discussions/img/resolve_thread_open_issue_v13_9.png and b/doc/user/discussions/img/resolve_thread_open_issue_v13_9.png differ
diff --git a/doc/user/discussions/img/suggestion_button_v13_9.png b/doc/user/discussions/img/suggestion_button_v13_9.png
index 4fbdac4f66d..58e0508d8cf 100644
Binary files a/doc/user/discussions/img/suggestion_button_v13_9.png and b/doc/user/discussions/img/suggestion_button_v13_9.png differ
diff --git a/doc/user/group/img/group_code_coverage_analytics_v13_9.png b/doc/user/group/img/group_code_coverage_analytics_v13_9.png
index 20db7921041..8cd71396381 100644
Binary files a/doc/user/group/img/group_code_coverage_analytics_v13_9.png and b/doc/user/group/img/group_code_coverage_analytics_v13_9.png differ
diff --git a/doc/user/group/import/img/bulk_imports_v13_8.png b/doc/user/group/import/img/bulk_imports_v13_8.png
index 31234f9fcea..ae4d8567d80 100644
Binary files a/doc/user/group/import/img/bulk_imports_v13_8.png and b/doc/user/group/import/img/bulk_imports_v13_8.png differ
diff --git a/doc/user/group/import/img/import_panel_v13_8.png b/doc/user/group/import/img/import_panel_v13_8.png
index 1fb7fbad291..28d61785098 100644
Binary files a/doc/user/group/import/img/import_panel_v13_8.png and b/doc/user/group/import/img/import_panel_v13_8.png differ
diff --git a/doc/user/img/activity_followed_users_v13_9.png b/doc/user/img/activity_followed_users_v13_9.png
index 7f54f17821c..3c0a9de74b4 100644
Binary files a/doc/user/img/activity_followed_users_v13_9.png and b/doc/user/img/activity_followed_users_v13_9.png differ
diff --git a/doc/user/profile/img/profile_following_v13_9.png b/doc/user/profile/img/profile_following_v13_9.png
index 85d54ff3aad..878dce83997 100644
Binary files a/doc/user/profile/img/profile_following_v13_9.png and b/doc/user/profile/img/profile_following_v13_9.png differ
diff --git a/doc/user/project/img/optional_code_owners_sections_v13_8.png b/doc/user/project/img/optional_code_owners_sections_v13_8.png
index 7a5a2fab6e3..50916466226 100644
Binary files a/doc/user/project/img/optional_code_owners_sections_v13_8.png and b/doc/user/project/img/optional_code_owners_sections_v13_8.png differ
diff --git a/doc/user/project/integrations/img/mattermost_configuration_v2.png b/doc/user/project/integrations/img/mattermost_configuration_v2.png
index e05b34fd77a..0470869c4f7 100644
Binary files a/doc/user/project/integrations/img/mattermost_configuration_v2.png and b/doc/user/project/integrations/img/mattermost_configuration_v2.png differ
diff --git a/lib/gitlab/kroki.rb b/lib/gitlab/kroki.rb
index 8c5652fb766..38090786836 100644
--- a/lib/gitlab/kroki.rb
+++ b/lib/gitlab/kroki.rb
@@ -13,9 +13,7 @@ module Gitlab
packetdiag
rackdiag
].freeze
- # Diagrams that require a companion container are disabled for now
DIAGRAMS_FORMATS = ::AsciidoctorExtensions::Kroki::SUPPORTED_DIAGRAM_NAMES
- .reject { |diagram_type| diagram_type == 'mermaid' || diagram_type == 'bpmn' || BLOCKDIAG_FORMATS.include?(diagram_type) }
DIAGRAMS_FORMATS_WO_PLANTUML = DIAGRAMS_FORMATS
.reject { |diagram_type| diagram_type == 'plantuml' }
@@ -28,10 +26,18 @@ module Gitlab
# If PlantUML is enabled, PlantUML diagrams will be processed by the PlantUML server.
# In other words, the PlantUML server has precedence over Kroki since both can process PlantUML diagrams.
- if current_settings.plantuml_enabled
- DIAGRAMS_FORMATS_WO_PLANTUML
- else
- DIAGRAMS_FORMATS
+ diagram_formats = if current_settings.plantuml_enabled
+ DIAGRAMS_FORMATS_WO_PLANTUML
+ else
+ DIAGRAMS_FORMATS
+ end
+
+ # No additional diagram formats
+ return diagram_formats unless current_settings.kroki_formats.present?
+
+ # Diagrams that require a companion container must be explicitly enabled from the settings
+ diagram_formats.select do |diagram_type|
+ current_settings.kroki_format_supported?(diagram_type)
end
end
end
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index a91b1857244..79d393fd222 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -32271,6 +32271,9 @@ msgstr ""
msgid "Using %{code_start}::%{code_end} denotes a %{link_start}scoped label set%{link_end}"
msgstr ""
+msgid "Using additional formats requires starting the companion containers. Make sure that all %{kroki_images} are running."
+msgstr ""
+
msgid "Using required encryption strategy when encrypted field is missing!"
msgstr ""
diff --git a/qa/qa/specs/features/api/3_create/gitaly/distributed_reads_spec.rb b/qa/qa/specs/features/api/3_create/gitaly/distributed_reads_spec.rb
index c3cb503ed3f..9bf3474ba5a 100644
--- a/qa/qa/specs/features/api/3_create/gitaly/distributed_reads_spec.rb
+++ b/qa/qa/specs/features/api/3_create/gitaly/distributed_reads_spec.rb
@@ -88,6 +88,7 @@ module QA
read_from_project(project, number_of_reads)
praefect_manager.query_read_distribution.each_with_index do |data, index|
+ diff_found[index] = {} unless diff_found[index]
diff_found[index][:diff] = true if data[:value] > praefect_manager.value_for_node(pre_read_data, data[:node])
end
diff_found.all? { |node| node.key?(:diff) && node[:diff] }
diff --git a/spec/controllers/admin/application_settings_controller_spec.rb b/spec/controllers/admin/application_settings_controller_spec.rb
index f0b224484c6..71abf3191b8 100644
--- a/spec/controllers/admin/application_settings_controller_spec.rb
+++ b/spec/controllers/admin/application_settings_controller_spec.rb
@@ -150,6 +150,13 @@ RSpec.describe Admin::ApplicationSettingsController do
expect(ApplicationSetting.current.repository_storages_weighted_default).to eq(75)
end
+ it 'updates kroki_formats setting' do
+ put :update, params: { application_setting: { kroki_formats_excalidraw: '1' } }
+
+ expect(response).to redirect_to(general_admin_application_settings_path)
+ expect(ApplicationSetting.current.kroki_formats_excalidraw).to eq(true)
+ end
+
it "updates default_branch_name setting" do
put :update, params: { application_setting: { default_branch_name: "example_branch_name" } }
diff --git a/spec/helpers/application_settings_helper_spec.rb b/spec/helpers/application_settings_helper_spec.rb
index 479e2d7ef9d..2cd01451e0d 100644
--- a/spec/helpers/application_settings_helper_spec.rb
+++ b/spec/helpers/application_settings_helper_spec.rb
@@ -194,4 +194,33 @@ RSpec.describe ApplicationSettingsHelper do
it { is_expected.to be false }
end
end
+
+ describe '.kroki_available_formats' do
+ let(:application_setting) { build(:application_setting) }
+
+ before do
+ helper.instance_variable_set(:@application_setting, application_setting)
+ stub_application_setting(kroki_formats: { 'blockdiag' => true, 'bpmn' => false, 'excalidraw' => false })
+ end
+
+ it 'returns available formats correctly' do
+ expect(helper.kroki_available_formats).to eq([
+ {
+ name: 'kroki_formats_blockdiag',
+ label: 'BlockDiag (includes BlockDiag, SeqDiag, ActDiag, NwDiag, PacketDiag and RackDiag)',
+ value: true
+ },
+ {
+ name: 'kroki_formats_bpmn',
+ label: 'BPMN',
+ value: false
+ },
+ {
+ name: 'kroki_formats_excalidraw',
+ label: 'Excalidraw',
+ value: false
+ }
+ ])
+ end
+ end
end
diff --git a/spec/lib/gitlab/asciidoc_spec.rb b/spec/lib/gitlab/asciidoc_spec.rb
index 36e4decdead..08510d4652b 100644
--- a/spec/lib/gitlab/asciidoc_spec.rb
+++ b/spec/lib/gitlab/asciidoc_spec.rb
@@ -510,6 +510,73 @@ module Gitlab
expect(render(input, context)).to include(output.strip)
end
+
+ it 'does not convert a blockdiag diagram to image' do
+ input = <<~ADOC
+ [blockdiag]
+ ....
+ blockdiag {
+ Kroki -> generates -> "Block diagrams";
+ Kroki -> is -> "very easy!";
+
+ Kroki [color = "greenyellow"];
+ "Block diagrams" [color = "pink"];
+ "very easy!" [color = "orange"];
+ }
+ ....
+ ADOC
+
+ output = <<~HTML
+
blockdiag {
+ Kroki -> generates -> "Block diagrams";
+ Kroki -> is -> "very easy!";
+
+ Kroki [color = "greenyellow"];
+ "Block diagrams" [color = "pink"];
+ "very easy!" [color = "orange"];
+ }
+