summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-08-07 00:09:52 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-08-07 00:09:52 +0000
commit3c9c771dcf7886832c57cfedb14dd2c0bc70e706 (patch)
treea92af9d26bb4d76d99e53c16596097bfcfa03d78
parent0790cf032c70b3df250e1953a3a11b71d835c5a1 (diff)
downloadgitlab-ce-3c9c771dcf7886832c57cfedb14dd2c0bc70e706.tar.gz
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--GITALY_SERVER_VERSION2
-rw-r--r--app/assets/javascripts/ide/components/ide_project_header.vue6
-rw-r--r--app/assets/javascripts/static_site_editor/services/templater.js56
-rw-r--r--app/helpers/application_helper.rb2
-rw-r--r--app/views/layouts/_head.html.haml4
-rw-r--r--app/views/layouts/_startup_css.haml7
-rw-r--r--app/views/shared/_confirm_fork_modal.html.haml4
-rw-r--r--changelogs/unreleased/38791-templater-inline-erb.yml5
-rw-r--r--changelogs/unreleased/issue_218031_be.yml5
-rw-r--r--db/migrate/20200730044810_add_indexes_to_resource_label_events_to_support_vsa.rb31
-rw-r--r--db/migrate/20200730131946_add_hide_lists_to_boards.rb10
-rw-r--r--db/schema_migrations/202007300448101
-rw-r--r--db/schema_migrations/202007301319461
-rw-r--r--db/structure.sql10
-rw-r--r--doc/administration/gitaly/praefect.md56
-rw-r--r--doc/administration/packages/container_registry.md17
-rw-r--r--doc/api/graphql/reference/gitlab_schema.graphql41
-rw-r--r--doc/api/graphql/reference/gitlab_schema.json143
-rw-r--r--doc/api/graphql/reference/index.md10
-rw-r--r--doc/operations/incident_management/img/alert_detail_add_todo_v13_1.png (renamed from doc/user/project/operations/img/alert_detail_add_todo_v13_1.png)bin16822 -> 16822 bytes
-rw-r--r--doc/operations/incident_management/img/alert_detail_added_todo_v13_1.png (renamed from doc/user/project/operations/img/alert_detail_added_todo_v13_1.png)bin18170 -> 18170 bytes
-rw-r--r--doc/operations/incident_management/img/alert_detail_full_v13_1.png (renamed from doc/user/project/operations/img/alert_detail_full_v13_1.png)bin26957 -> 26957 bytes
-rw-r--r--doc/operations/incident_management/img/alert_detail_metrics_v13_2.png (renamed from doc/user/project/operations/img/alert_detail_metrics_v13_2.png)bin27616 -> 27616 bytes
-rw-r--r--doc/operations/incident_management/img/alert_detail_overview_v13_1.png (renamed from doc/user/project/operations/img/alert_detail_overview_v13_1.png)bin14827 -> 14827 bytes
-rw-r--r--doc/operations/incident_management/img/alert_detail_system_notes_v13_1.png (renamed from doc/user/project/operations/img/alert_detail_system_notes_v13_1.png)bin22329 -> 22329 bytes
-rw-r--r--doc/operations/incident_management/img/alert_details_assignees_v13_1.png (renamed from doc/user/project/operations/img/alert_details_assignees_v13_1.png)bin31091 -> 31091 bytes
-rw-r--r--doc/operations/incident_management/img/alert_list_assignees_v13_1.png (renamed from doc/user/project/operations/img/alert_list_assignees_v13_1.png)bin29011 -> 29011 bytes
-rw-r--r--doc/operations/incident_management/img/alert_list_search_v13_1.png (renamed from doc/user/project/operations/img/alert_list_search_v13_1.png)bin12166 -> 12166 bytes
-rw-r--r--doc/operations/incident_management/img/alert_list_sort_v13_1.png (renamed from doc/user/project/operations/img/alert_list_sort_v13_1.png)bin13919 -> 13919 bytes
-rw-r--r--doc/operations/incident_management/img/alert_management_severity_v13_0.png (renamed from doc/user/project/operations/img/alert_management_severity_v13_0.png)bin10972 -> 10972 bytes
-rw-r--r--doc/operations/incident_management/img/alert_todo_assignees_v13_1.png (renamed from doc/user/project/operations/img/alert_todo_assignees_v13_1.png)bin10157 -> 10157 bytes
-rw-r--r--doc/operations/incident_management/index.md299
-rw-r--r--doc/operations/index.md2
-rw-r--r--doc/user/infrastructure/index.md29
-rw-r--r--doc/user/project/integrations/generic_alerts.md2
-rw-r--r--doc/user/project/operations/alert_management.md291
-rw-r--r--lib/gitlab/analytics/cycle_analytics/records_fetcher.rb2
-rw-r--r--lib/gitlab/analytics/cycle_analytics/stage_query_helpers.rb4
-rw-r--r--lib/gitlab/metrics/elasticsearch_rack_middleware.rb4
-rw-r--r--qa/qa/page/merge_request/new.rb2
-rw-r--r--qa/qa/page/project/show.rb4
-rw-r--r--qa/qa/page/project/web_ide/edit.rb62
-rw-r--r--qa/qa/specs/features/browser_ui/3_create/web_ide/open_fork_in_web_ide_spec.rb67
-rw-r--r--spec/frontend/static_site_editor/services/templater_spec.js54
-rw-r--r--spec/lib/gitlab/import_export/safe_model_attributes.yml2
-rw-r--r--spec/lib/gitlab/metrics/elasticsearch_rack_middleware_spec.rb3
46 files changed, 861 insertions, 377 deletions
diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION
index f729df9c13e..8050631c483 100644
--- a/GITALY_SERVER_VERSION
+++ b/GITALY_SERVER_VERSION
@@ -1 +1 @@
-9e5dfd987388c905b584f58b48afede245721ec7
+d6ded95a76876ff182d37cb33ed9515ed29d5c23
diff --git a/app/assets/javascripts/ide/components/ide_project_header.vue b/app/assets/javascripts/ide/components/ide_project_header.vue
index 36bc7c70196..36891505230 100644
--- a/app/assets/javascripts/ide/components/ide_project_header.vue
+++ b/app/assets/javascripts/ide/components/ide_project_header.vue
@@ -20,7 +20,11 @@ export default {
<project-avatar-default :project="project" :size="48" />
<span class="ide-sidebar-project-title">
<span class="sidebar-context-title"> {{ project.name }} </span>
- <span class="sidebar-context-title text-secondary">
+ <span
+ class="sidebar-context-title text-secondary"
+ data-qa-selector="project_path_content"
+ :data-qa-project-path="project.path_with_namespace"
+ >
{{ project.path_with_namespace }}
</span>
</span>
diff --git a/app/assets/javascripts/static_site_editor/services/templater.js b/app/assets/javascripts/static_site_editor/services/templater.js
index 29a2bcd2e34..081db60b601 100644
--- a/app/assets/javascripts/static_site_editor/services/templater.js
+++ b/app/assets/javascripts/static_site_editor/services/templater.js
@@ -1,32 +1,62 @@
-const marker = 'sse';
const ticks = '```';
+const marker = 'sse';
const prefix = `${ticks} ${marker}\n`; // Space intentional due to https://github.com/nhn/tui.editor/blob/6bcec75c69028570d93d973aa7533090257eaae0/libs/to-mark/src/renderer.gfm.js#L26
const postfix = `\n${ticks}`;
-const code = '.| |\\t|\\n(?!\\n)';
-const templatedRegex = new RegExp(`(^${prefix}(${code})+${postfix}$)`, 'gm');
-const embeddedRubyRegex = new RegExp(`(^<%(${code})+%>$)`, 'gm');
+const flagPrefix = `${marker}-${Date.now()}`;
+const template = `.| |\\t|\\n(?!(\\n|${flagPrefix}))`;
+const templatedRegex = new RegExp(`(^${prefix}(${template})+?${postfix}$)`, 'gm');
+
+const nonErbMarkupRegex = new RegExp(`^((<(?!%).+>){1}(${template})+(</.+>){1})$`, 'gm');
+const embeddedRubyBlockRegex = new RegExp(`(^<%(${template})+%>$)`, 'gm');
+const embeddedRubyInlineRegex = new RegExp(`(^.*[<|&lt;]%(${template})+$)`, 'gm');
+
+// Order is intentional (general to specific) where HTML markup is flagged first, then ERB blocks, then inline ERB
+// Order in combo with the `flag()` algorithm is used to mitigate potential duplicate pattern matches (ERB nested in HTML for example)
+const orderedPatterns = [nonErbMarkupRegex, embeddedRubyBlockRegex, embeddedRubyInlineRegex];
const unwrap = source => {
let text = source;
const matches = text.match(templatedRegex);
+
if (matches) {
matches.forEach(match => {
- const initial = match.replace(prefix, '').replace(postfix, '');
+ const initial = match.replace(`${prefix}`, '').replace(`${postfix}`, '');
text = text.replace(match, initial);
});
}
+
return text;
};
+const flag = (source, patterns) => {
+ let text = source;
+ let id = 0;
+ const hash = {};
+
+ patterns.forEach(pattern => {
+ const matches = text.match(pattern);
+ if (matches) {
+ matches.forEach(match => {
+ const key = `${flagPrefix}${id}`;
+ text = text.replace(match, key);
+ hash[key] = match;
+ id += 1;
+ });
+ }
+ });
+
+ return { text, hash };
+};
+
const wrap = source => {
- let text = unwrap(source);
- const matches = text.match(embeddedRubyRegex);
- if (matches) {
- matches.forEach(match => {
- text = text.replace(match, `${prefix}${match}${postfix}`);
- });
- }
- return text;
+ const { text, hash } = flag(unwrap(source), orderedPatterns);
+
+ let wrappedSource = text;
+ Object.entries(hash).forEach(([key, value]) => {
+ wrappedSource = wrappedSource.replace(key, `${prefix}${value}${postfix}`);
+ });
+
+ return wrappedSource;
};
export default { wrap, unwrap };
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index c73cfbcfd22..7cf68b26eab 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -237,7 +237,7 @@ module ApplicationHelper
def stylesheet_link_tag_defer(path)
if use_startup_css?
- stylesheet_link_tag(path, media: "print", onload: "this.onload=null;this.media='all'")
+ stylesheet_link_tag(path, media: "print")
else
stylesheet_link_tag(path, media: "all")
end
diff --git a/app/views/layouts/_head.html.haml b/app/views/layouts/_head.html.haml
index 6d1fe190aa6..4d0959021f5 100644
--- a/app/views/layouts/_head.html.haml
+++ b/app/views/layouts/_head.html.haml
@@ -57,10 +57,12 @@
- else
= stylesheet_link_tag_defer "application"
= stylesheet_link_tag "disable_animations", media: "all" if Rails.env.test? || Gitlab.config.gitlab['disable_animations']
- = stylesheet_link_tag 'performance_bar' if performance_bar_enabled?
+ = stylesheet_link_tag_defer 'performance_bar' if performance_bar_enabled?
= stylesheet_link_tag_defer "highlight/themes/#{user_color_scheme}"
+ = render 'layouts/startup_css'
+
= Gon::Base.render_data(nonce: content_security_policy_nonce)
- if content_for?(:library_javascripts)
diff --git a/app/views/layouts/_startup_css.haml b/app/views/layouts/_startup_css.haml
new file mode 100644
index 00000000000..0b1cce06f47
--- /dev/null
+++ b/app/views/layouts/_startup_css.haml
@@ -0,0 +1,7 @@
+- return unless use_startup_css?
+
+= javascript_tag nonce: true do
+ :plain
+ document.querySelectorAll('link[media="print"]').forEach(linkTag => {
+ linkTag.addEventListener('load', function() {this.media='all'}, {once: true});
+ })
diff --git a/app/views/shared/_confirm_fork_modal.html.haml b/app/views/shared/_confirm_fork_modal.html.haml
index db50ea41387..f2a193e0bbc 100644
--- a/app/views/shared/_confirm_fork_modal.html.haml
+++ b/app/views/shared/_confirm_fork_modal.html.haml
@@ -1,4 +1,4 @@
-#modal-confirm-fork.modal.qa-confirm-fork-modal
+#modal-confirm-fork.modal{ data: { qa_selector: 'confirm_fork_modal' } }
.modal-dialog
.modal-content
.modal-header
@@ -9,4 +9,4 @@
%p= _("You're not allowed to %{tag_start}edit%{tag_end} files in this project directly. Please fork this project, make your changes there, and submit a merge request.") % { tag_start: '', tag_end: ''}
.modal-footer
= link_to _('Cancel'), '#', class: "btn btn-cancel", "data-dismiss" => "modal"
- = link_to _('Fork project'), fork_path, class: 'btn btn-success', method: :post
+ = link_to _('Fork project'), fork_path, class: 'btn btn-success', data: { qa_selector: 'fork_project_button' }, method: :post
diff --git a/changelogs/unreleased/38791-templater-inline-erb.yml b/changelogs/unreleased/38791-templater-inline-erb.yml
new file mode 100644
index 00000000000..f80a555a75c
--- /dev/null
+++ b/changelogs/unreleased/38791-templater-inline-erb.yml
@@ -0,0 +1,5 @@
+---
+title: Add pre-processing step so inline ERB and HTML syntax are wrapped in codeblocks for code vs. content editing in the static site editor's WYSIWYG mode.
+merge_request: 38791
+author:
+type: added
diff --git a/changelogs/unreleased/issue_218031_be.yml b/changelogs/unreleased/issue_218031_be.yml
new file mode 100644
index 00000000000..b899fcfd780
--- /dev/null
+++ b/changelogs/unreleased/issue_218031_be.yml
@@ -0,0 +1,5 @@
+---
+title: Add hide_backlog_list and hide_closed_list attributes to boards table
+merge_request: 38303
+author:
+type: added
diff --git a/db/migrate/20200730044810_add_indexes_to_resource_label_events_to_support_vsa.rb b/db/migrate/20200730044810_add_indexes_to_resource_label_events_to_support_vsa.rb
new file mode 100644
index 00000000000..ba114e81618
--- /dev/null
+++ b/db/migrate/20200730044810_add_indexes_to_resource_label_events_to_support_vsa.rb
@@ -0,0 +1,31 @@
+# frozen_string_literal: true
+
+class AddIndexesToResourceLabelEventsToSupportVsa < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ NEW_INDEX_NAME_ON_ISSUE_ID = 'index_resource_label_events_issue_id_label_id_action'
+ OLD_INDEX_NAME_ON_ISSUE_ID = 'index_resource_label_events_on_issue_id'
+
+ NEW_INDEX_NAME_ON_MERGE_REQUEST_ID = 'index_resource_label_events_on_merge_request_id_label_id_action'
+ OLD_INDEX_NAME_ON_MERGE_REQUEST_ID = 'index_resource_label_events_on_merge_request_id'
+
+ def up
+ add_concurrent_index :resource_label_events, [:issue_id, :label_id, :action], name: NEW_INDEX_NAME_ON_ISSUE_ID
+ remove_concurrent_index_by_name :resource_label_events, OLD_INDEX_NAME_ON_ISSUE_ID
+
+ add_concurrent_index :resource_label_events, [:merge_request_id, :label_id, :action], name: NEW_INDEX_NAME_ON_MERGE_REQUEST_ID
+ remove_concurrent_index_by_name :resource_label_events, OLD_INDEX_NAME_ON_MERGE_REQUEST_ID
+ end
+
+ def down
+ add_concurrent_index :resource_label_events, :issue_id, name: OLD_INDEX_NAME_ON_ISSUE_ID
+ remove_concurrent_index_by_name(:resource_label_events, NEW_INDEX_NAME_ON_ISSUE_ID)
+
+ add_concurrent_index :resource_label_events, :merge_request_id, name: OLD_INDEX_NAME_ON_MERGE_REQUEST_ID
+ remove_concurrent_index_by_name(:resource_label_events, NEW_INDEX_NAME_ON_MERGE_REQUEST_ID)
+ end
+end
diff --git a/db/migrate/20200730131946_add_hide_lists_to_boards.rb b/db/migrate/20200730131946_add_hide_lists_to_boards.rb
new file mode 100644
index 00000000000..e431ea852a7
--- /dev/null
+++ b/db/migrate/20200730131946_add_hide_lists_to_boards.rb
@@ -0,0 +1,10 @@
+# frozen_string_literal: true
+
+class AddHideListsToBoards < ActiveRecord::Migration[6.0]
+ DOWNTIME = false
+
+ def change
+ add_column :boards, :hide_backlog_list, :boolean, default: false, null: false
+ add_column :boards, :hide_closed_list, :boolean, default: false, null: false
+ end
+end
diff --git a/db/schema_migrations/20200730044810 b/db/schema_migrations/20200730044810
new file mode 100644
index 00000000000..0532199d8ec
--- /dev/null
+++ b/db/schema_migrations/20200730044810
@@ -0,0 +1 @@
+406594bc48558c3ad50680c7e1fa795f38abb92696acbb94ae2dfb13d8dcaf1a \ No newline at end of file
diff --git a/db/schema_migrations/20200730131946 b/db/schema_migrations/20200730131946
new file mode 100644
index 00000000000..dc4e6f96917
--- /dev/null
+++ b/db/schema_migrations/20200730131946
@@ -0,0 +1 @@
+4ef0dfb9cdeccd57a3c11d1db0b57448746237d4a1fe001340575c996a6c3c68 \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index 15b4df63c3c..8207904cf80 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -9660,7 +9660,9 @@ CREATE TABLE public.boards (
name character varying DEFAULT 'Development'::character varying NOT NULL,
milestone_id integer,
group_id integer,
- weight integer
+ weight integer,
+ hide_backlog_list boolean DEFAULT false NOT NULL,
+ hide_closed_list boolean DEFAULT false NOT NULL
);
CREATE SEQUENCE public.boards_id_seq
@@ -20433,13 +20435,13 @@ CREATE INDEX index_requirements_on_title_trigram ON public.requirements USING gi
CREATE INDEX index_requirements_on_updated_at ON public.requirements USING btree (updated_at);
-CREATE INDEX index_resource_label_events_on_epic_id ON public.resource_label_events USING btree (epic_id);
+CREATE INDEX index_resource_label_events_issue_id_label_id_action ON public.resource_label_events USING btree (issue_id, label_id, action);
-CREATE INDEX index_resource_label_events_on_issue_id ON public.resource_label_events USING btree (issue_id);
+CREATE INDEX index_resource_label_events_on_epic_id ON public.resource_label_events USING btree (epic_id);
CREATE INDEX index_resource_label_events_on_label_id_and_action ON public.resource_label_events USING btree (label_id, action);
-CREATE INDEX index_resource_label_events_on_merge_request_id ON public.resource_label_events USING btree (merge_request_id);
+CREATE INDEX index_resource_label_events_on_merge_request_id_label_id_action ON public.resource_label_events USING btree (merge_request_id, label_id, action);
CREATE INDEX index_resource_label_events_on_user_id ON public.resource_label_events USING btree (user_id);
diff --git a/doc/administration/gitaly/praefect.md b/doc/administration/gitaly/praefect.md
index ad5bc719e1e..26de9a80923 100644
--- a/doc/administration/gitaly/praefect.md
+++ b/doc/administration/gitaly/praefect.md
@@ -994,9 +994,21 @@ strategy in the future.
Praefect recovers from a failing primary Gitaly node by promoting a healthy secondary as the new primary. To minimize data loss, Praefect elects the secondary with the least unreplicated writes from the primary. There can still be some unreplicated writes, leading to data loss.
-Praefect switches a virtual storage in to read-only mode after a failover event. This eases data recovery efforts by preventing new, possibly conflicting writes to the newly elected primary. This allows the administrator to attempt recovering the lost data before allowing new writes.
+### Read-only mode
-If you prefer write availability over consistency, this behavior can be turned off by setting `praefect['failover_read_only_after_failover'] = false` in `/etc/gitlab/gitlab.rb` and [reconfiguring Praefect](../restart_gitlab.md#omnibus-gitlab-reconfigure).
+If the primary is not fully up to date, Praefect switches:
+
+- The virtual storage to read-only mode in GitLab 13.2 and earlier.
+- The affected repositories to read-only mode in
+ [GitLab 13.3](https://gitlab.com/gitlab-org/gitaly/-/issues/2862) and later.
+
+This can happen after failing over to an outdated secondary. Read-only mode eases data
+recovery efforts by preventing writes that may conflict with the unreplicated writes.
+
+To re-enable the repositories for writes, the administrator can attempt to
+[recover the missing data](#recover-missing-data) from an up-to-date replica. If
+recovering the data is not possible, the repository can be enabled for writes again by
+[accepting the data loss](#accept-data-loss).
### Checking for data loss
@@ -1041,28 +1053,40 @@ NOTE: **Note:**
To check a project's repository checksums across on all Gitaly nodes, run the
[replicas Rake task](../raketasks/praefect.md#replica-checksums) on the main GitLab node.
-### Recovering lost writes
+### Recover missing data
-The Praefect `reconcile` sub-command can be used to recover lost writes from the
-previous primary once it is back online. This is only possible when the virtual storage
-is still in read-only mode.
+The Praefect `reconcile` sub-command can be used to recover unreplicated changes from another replica. The source must be on a later generation than the target storage.
```shell
-sudo /opt/gitlab/embedded/bin/praefect -config /var/opt/gitlab/praefect/config.toml reconcile -virtual <virtual-storage> -reference <previous-primary> -target <current-primary> -f
+sudo /opt/gitlab/embedded/bin/praefect -config /var/opt/gitlab/praefect/config.toml reconcile -virtual <virtual-storage> -reference <up-to-date-storage> -target <outdated-storage> -f
```
-Refer to [Backend Node Recovery](#backend-node-recovery) section for more details on
-the `reconcile` sub-command.
+Refer to [Backend Node Recovery](#backend-node-recovery) section for more details on the `reconcile` sub-command.
-### Enabling Writes
+### Accept data loss
-Any data recovery attempts should have been made before enabling writes to eliminate
-any chance of conflicting writes. Virtual storage can be re-enabled for writes by using
-the Praefect `enable-writes` sub-command.
+Praefect provides the following subcommands to re-enable writes:
-```shell
-sudo /opt/gitlab/embedded/bin/praefect -config /var/opt/gitlab/praefect/config.toml enable-writes -virtual-storage <virtual-storage>
-```
+- In GitLab 13.2 and earlier, `enable-writes` to re-enable virtual storage for writes
+ after data recovery attempts.
+
+ ```shell
+ sudo /opt/gitlab/embedded/bin/praefect -config /var/opt/gitlab/praefect/config.toml enable-writes -virtual-storage <virtual-storage>
+ ```
+
+- [In GitLab 13.3](https://gitlab.com/gitlab-org/gitaly/-/merge_requests/2415) and
+ later, `accept-dataloss` to accept data loss and re-enable writes for repositories
+ after data recovery attempts have failed. Accepting data loss causes current version
+ of the repository on the authoritative storage to be considered latest. Other storages
+ are brought up to date with the authoritative storage by scheduling replication jobs.
+
+ ```shell
+ sudo /opt/gitlab/embedded/bin/praefect -config /var/opt/gitlab/praefect/config.toml accept-dataloss -virtual-storage <virtual-storage> -repository <relative-path> -authoritative-storage <storage-name>
+ ```
+
+CAUTION: **Caution:**
+`accept-dataloss` causes permanent data loss by overwriting other versions of the
+repository. Data recovery efforts must be performed before using it.
## Backend Node Recovery
diff --git a/doc/administration/packages/container_registry.md b/doc/administration/packages/container_registry.md
index 2747fb0cc04..f0ea49e54bc 100644
--- a/doc/administration/packages/container_registry.md
+++ b/doc/administration/packages/container_registry.md
@@ -466,6 +466,10 @@ you can pull from the Container Registry, but you cannot push.
sudo aws --endpoint-url https://your-object-storage-backend.com s3 sync registry s3://mybucket
```
+ TIP: **Tip:**
+ If you have a lot of data, you may be able to improve performance by
+ [running parallel sync operations](https://aws.amazon.com/premiumsupport/knowledge-center/s3-improve-transfer-sync-command/).
+
1. To perform the final data sync,
[put the Container Registry in `read-only` mode](#performing-garbage-collection-without-downtime) and
[reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure).
@@ -484,6 +488,19 @@ you can pull from the Container Registry, but you cannot push.
flag will delete files that exist in the destination but not in the source.
Make sure not to swap the source and destination, or you will delete all data in the Registry.
+1. Verify all Container Registry files have been uploaded to object storage
+ by looking at the file count returned by these two commands:
+
+ ```shell
+ sudo find registry -type f | wc -l
+ ```
+
+ ```shell
+ sudo aws --endpoint-url https://your-object-storage-backend.com s3 ls s3://mybucket --recursive | wc -l
+ ```
+
+ The output of these commands should match, except for the content in the
+ `_uploads` directories and sub-directories.
1. Configure your registry to [use the S3 bucket for storage](#use-object-storage).
1. For the changes to take effect, set the Registry back to `read-write` mode and [reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure).
diff --git a/doc/api/graphql/reference/gitlab_schema.graphql b/doc/api/graphql/reference/gitlab_schema.graphql
index eea40e5fbd4..8f08d326356 100644
--- a/doc/api/graphql/reference/gitlab_schema.graphql
+++ b/doc/api/graphql/reference/gitlab_schema.graphql
@@ -1532,6 +1532,46 @@ type ComplianceFrameworkEdge {
}
"""
+Autogenerated input type of ConfigureSast
+"""
+input ConfigureSastInput {
+ """
+ A unique identifier for the client performing the mutation.
+ """
+ clientMutationId: String
+
+ """
+ Payload containing SAST variable values (https://docs.gitlab.com/ee/user/application_security/sast/#available-variables).
+ """
+ configuration: JSON!
+
+ """
+ Full path of the project.
+ """
+ projectPath: ID!
+}
+
+"""
+Autogenerated return type of ConfigureSast
+"""
+type ConfigureSastPayload {
+ """
+ A unique identifier for the client performing the mutation.
+ """
+ clientMutationId: String
+
+ """
+ Errors encountered during execution of the mutation.
+ """
+ errors: [String!]!
+
+ """
+ JSON containing the status of MR creation.
+ """
+ result: JSON
+}
+
+"""
A tag expiration policy designed to keep only the images that matter most
"""
type ContainerExpirationPolicy {
@@ -8776,6 +8816,7 @@ type Mutation {
awardEmojiToggle(input: AwardEmojiToggleInput!): AwardEmojiTogglePayload
boardListUpdateLimitMetrics(input: BoardListUpdateLimitMetricsInput!): BoardListUpdateLimitMetricsPayload
commitCreate(input: CommitCreateInput!): CommitCreatePayload
+ configureSast(input: ConfigureSastInput!): ConfigureSastPayload
createAlertIssue(input: CreateAlertIssueInput!): CreateAlertIssuePayload
createAnnotation(input: CreateAnnotationInput!): CreateAnnotationPayload
createBranch(input: CreateBranchInput!): CreateBranchPayload
diff --git a/doc/api/graphql/reference/gitlab_schema.json b/doc/api/graphql/reference/gitlab_schema.json
index 0bc84c890cf..405a06dbf6b 100644
--- a/doc/api/graphql/reference/gitlab_schema.json
+++ b/doc/api/graphql/reference/gitlab_schema.json
@@ -4154,6 +4154,122 @@
"possibleTypes": null
},
{
+ "kind": "INPUT_OBJECT",
+ "name": "ConfigureSastInput",
+ "description": "Autogenerated input type of ConfigureSast",
+ "fields": null,
+ "inputFields": [
+ {
+ "name": "projectPath",
+ "description": "Full path of the project.",
+ "type": {
+ "kind": "NON_NULL",
+ "name": null,
+ "ofType": {
+ "kind": "SCALAR",
+ "name": "ID",
+ "ofType": null
+ }
+ },
+ "defaultValue": null
+ },
+ {
+ "name": "configuration",
+ "description": "Payload containing SAST variable values (https://docs.gitlab.com/ee/user/application_security/sast/#available-variables).",
+ "type": {
+ "kind": "NON_NULL",
+ "name": null,
+ "ofType": {
+ "kind": "SCALAR",
+ "name": "JSON",
+ "ofType": null
+ }
+ },
+ "defaultValue": null
+ },
+ {
+ "name": "clientMutationId",
+ "description": "A unique identifier for the client performing the mutation.",
+ "type": {
+ "kind": "SCALAR",
+ "name": "String",
+ "ofType": null
+ },
+ "defaultValue": null
+ }
+ ],
+ "interfaces": null,
+ "enumValues": null,
+ "possibleTypes": null
+ },
+ {
+ "kind": "OBJECT",
+ "name": "ConfigureSastPayload",
+ "description": "Autogenerated return type of ConfigureSast",
+ "fields": [
+ {
+ "name": "clientMutationId",
+ "description": "A unique identifier for the client performing the mutation.",
+ "args": [
+
+ ],
+ "type": {
+ "kind": "SCALAR",
+ "name": "String",
+ "ofType": null
+ },
+ "isDeprecated": false,
+ "deprecationReason": null
+ },
+ {
+ "name": "errors",
+ "description": "Errors encountered during execution of the mutation.",
+ "args": [
+
+ ],
+ "type": {
+ "kind": "NON_NULL",
+ "name": null,
+ "ofType": {
+ "kind": "LIST",
+ "name": null,
+ "ofType": {
+ "kind": "NON_NULL",
+ "name": null,
+ "ofType": {
+ "kind": "SCALAR",
+ "name": "String",
+ "ofType": null
+ }
+ }
+ }
+ },
+ "isDeprecated": false,
+ "deprecationReason": null
+ },
+ {
+ "name": "result",
+ "description": "JSON containing the status of MR creation.",
+ "args": [
+
+ ],
+ "type": {
+ "kind": "SCALAR",
+ "name": "JSON",
+ "ofType": null
+ },
+ "isDeprecated": false,
+ "deprecationReason": null
+ }
+ ],
+ "inputFields": null,
+ "interfaces": [
+
+ ],
+ "enumValues": null,
+ "possibleTypes": null
+ },
+ {
"kind": "OBJECT",
"name": "ContainerExpirationPolicy",
"description": "A tag expiration policy designed to keep only the images that matter most",
@@ -24894,6 +25010,33 @@
"deprecationReason": null
},
{
+ "name": "configureSast",
+ "description": null,
+ "args": [
+ {
+ "name": "input",
+ "description": null,
+ "type": {
+ "kind": "NON_NULL",
+ "name": null,
+ "ofType": {
+ "kind": "INPUT_OBJECT",
+ "name": "ConfigureSastInput",
+ "ofType": null
+ }
+ },
+ "defaultValue": null
+ }
+ ],
+ "type": {
+ "kind": "OBJECT",
+ "name": "ConfigureSastPayload",
+ "ofType": null
+ },
+ "isDeprecated": false,
+ "deprecationReason": null
+ },
+ {
"name": "createAlertIssue",
"description": null,
"args": [
diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md
index e2588b4bd4d..e10d4786172 100644
--- a/doc/api/graphql/reference/index.md
+++ b/doc/api/graphql/reference/index.md
@@ -264,6 +264,16 @@ Represents a ComplianceFramework associated with a Project
| --- | ---- | ---------- |
| `name` | ProjectSettingEnum! | Name of the compliance framework |
+## ConfigureSastPayload
+
+Autogenerated return type of ConfigureSast
+
+| Name | Type | Description |
+| --- | ---- | ---------- |
+| `clientMutationId` | String | A unique identifier for the client performing the mutation. |
+| `errors` | String! => Array | Errors encountered during execution of the mutation. |
+| `result` | JSON | JSON containing the status of MR creation. |
+
## ContainerExpirationPolicy
A tag expiration policy designed to keep only the images that matter most
diff --git a/doc/user/project/operations/img/alert_detail_add_todo_v13_1.png b/doc/operations/incident_management/img/alert_detail_add_todo_v13_1.png
index 39aa9e33728..39aa9e33728 100644
--- a/doc/user/project/operations/img/alert_detail_add_todo_v13_1.png
+++ b/doc/operations/incident_management/img/alert_detail_add_todo_v13_1.png
Binary files differ
diff --git a/doc/user/project/operations/img/alert_detail_added_todo_v13_1.png b/doc/operations/incident_management/img/alert_detail_added_todo_v13_1.png
index ae874706895..ae874706895 100644
--- a/doc/user/project/operations/img/alert_detail_added_todo_v13_1.png
+++ b/doc/operations/incident_management/img/alert_detail_added_todo_v13_1.png
Binary files differ
diff --git a/doc/user/project/operations/img/alert_detail_full_v13_1.png b/doc/operations/incident_management/img/alert_detail_full_v13_1.png
index 18a6f4fb67b..18a6f4fb67b 100644
--- a/doc/user/project/operations/img/alert_detail_full_v13_1.png
+++ b/doc/operations/incident_management/img/alert_detail_full_v13_1.png
Binary files differ
diff --git a/doc/user/project/operations/img/alert_detail_metrics_v13_2.png b/doc/operations/incident_management/img/alert_detail_metrics_v13_2.png
index 84d83365ea8..84d83365ea8 100644
--- a/doc/user/project/operations/img/alert_detail_metrics_v13_2.png
+++ b/doc/operations/incident_management/img/alert_detail_metrics_v13_2.png
Binary files differ
diff --git a/doc/user/project/operations/img/alert_detail_overview_v13_1.png b/doc/operations/incident_management/img/alert_detail_overview_v13_1.png
index 10c945d3810..10c945d3810 100644
--- a/doc/user/project/operations/img/alert_detail_overview_v13_1.png
+++ b/doc/operations/incident_management/img/alert_detail_overview_v13_1.png
Binary files differ
diff --git a/doc/user/project/operations/img/alert_detail_system_notes_v13_1.png b/doc/operations/incident_management/img/alert_detail_system_notes_v13_1.png
index 2a6d0320a54..2a6d0320a54 100644
--- a/doc/user/project/operations/img/alert_detail_system_notes_v13_1.png
+++ b/doc/operations/incident_management/img/alert_detail_system_notes_v13_1.png
Binary files differ
diff --git a/doc/user/project/operations/img/alert_details_assignees_v13_1.png b/doc/operations/incident_management/img/alert_details_assignees_v13_1.png
index dab4eac384a..dab4eac384a 100644
--- a/doc/user/project/operations/img/alert_details_assignees_v13_1.png
+++ b/doc/operations/incident_management/img/alert_details_assignees_v13_1.png
Binary files differ
diff --git a/doc/user/project/operations/img/alert_list_assignees_v13_1.png b/doc/operations/incident_management/img/alert_list_assignees_v13_1.png
index db1e0d8dcb7..db1e0d8dcb7 100644
--- a/doc/user/project/operations/img/alert_list_assignees_v13_1.png
+++ b/doc/operations/incident_management/img/alert_list_assignees_v13_1.png
Binary files differ
diff --git a/doc/user/project/operations/img/alert_list_search_v13_1.png b/doc/operations/incident_management/img/alert_list_search_v13_1.png
index ba993fe530b..ba993fe530b 100644
--- a/doc/user/project/operations/img/alert_list_search_v13_1.png
+++ b/doc/operations/incident_management/img/alert_list_search_v13_1.png
Binary files differ
diff --git a/doc/user/project/operations/img/alert_list_sort_v13_1.png b/doc/operations/incident_management/img/alert_list_sort_v13_1.png
index 8e06c3478f7..8e06c3478f7 100644
--- a/doc/user/project/operations/img/alert_list_sort_v13_1.png
+++ b/doc/operations/incident_management/img/alert_list_sort_v13_1.png
Binary files differ
diff --git a/doc/user/project/operations/img/alert_management_severity_v13_0.png b/doc/operations/incident_management/img/alert_management_severity_v13_0.png
index f996d6e88f4..f996d6e88f4 100644
--- a/doc/user/project/operations/img/alert_management_severity_v13_0.png
+++ b/doc/operations/incident_management/img/alert_management_severity_v13_0.png
Binary files differ
diff --git a/doc/user/project/operations/img/alert_todo_assignees_v13_1.png b/doc/operations/incident_management/img/alert_todo_assignees_v13_1.png
index 637f8be5d25..637f8be5d25 100644
--- a/doc/user/project/operations/img/alert_todo_assignees_v13_1.png
+++ b/doc/operations/incident_management/img/alert_todo_assignees_v13_1.png
Binary files differ
diff --git a/doc/operations/incident_management/index.md b/doc/operations/incident_management/index.md
index 77e1889a90d..6b493c79e59 100644
--- a/doc/operations/incident_management/index.md
+++ b/doc/operations/incident_management/index.md
@@ -6,6 +6,12 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# Incident management
+> [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/2877) in GitLab 13.0.
+
+Alert Management enables developers to easily discover and view the alerts
+generated by their application. By surfacing alert information where the code is
+being developed, efficiency and awareness can be increased.
+
GitLab offers solutions for handling incidents in your applications and services,
such as [setting up Prometheus alerts](#configure-prometheus-alerts),
[displaying metrics](#embed-metrics-in-incidents-and-issues), and sending notifications.
@@ -30,15 +36,284 @@ in your project's sidebar. The list contains the following metrics:
NOTE: **Note:**
Incidents share the [Issues API](../../user/project/issues/index.md).
-## Create an incident manually
+## Enable Alert Management
-> [Moved](https://gitlab.com/gitlab-org/monitor/health/-/issues/24) to GitLab core in 13.3.
+NOTE: **Note:**
+You will need at least Maintainer [permissions](../../user/permissions.md) to enable the Alert Management feature.
-For users with at least Developer [permissions](../../user/permissions.md), to create a Incident you can take any of the following actions:
+There are several ways to accept alerts into your GitLab project, as outlined below.
+Enabling any of these methods will allow the Alerts list to display. After configuring
+alerts, visit **{cloud-gear}** **Operations > Alerts** in your project's sidebar
+to [view the list](#alert-management-list) of alerts.
-- Navigate to **Operations > Incidents** and click **Create Incident**.
-- Create a new issue using the `incident` template available when creating it.
-- Create a new issue and assign the `incident` label to it.
+### Opsgenie integration **(PREMIUM)**
+
+> [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/3066) in [GitLab Premium](https://about.gitlab.com/pricing/) 13.2.
+
+A new way of monitoring Alerts via a GitLab integration is with
+[Opsgenie](https://www.atlassian.com/software/opsgenie).
+
+NOTE: **Note:**
+If you enable the Opsgenie integration, you cannot have other GitLab alert services,
+such as [Generic Alerts](../../user/project/integrations/generic_alerts.md) or
+Prometheus alerts, active at the same time.
+
+To enable Opsgenie integration:
+
+1. Sign in as a user with Maintainer or Owner [permissions](../../user/permissions.md).
+1. Navigate to **{cloud-gear}** **Operations > Alerts**.
+1. In the **Integrations** select box, select Opsgenie.
+1. Click the **Active** toggle.
+1. In the **API URL**, enter the base URL for your Opsgenie integration, such
+ as `https://app.opsgenie.com/alert/list`.
+1. Click **Save changes**.
+
+After enabling the integration, navigate to the Alerts list page at **{cloud-gear}** **Operations > Alerts**, and click **View alerts in Opsgenie**.
+
+### Enable a Generic Alerts endpoint
+
+GitLab provides the Generic Alerts endpoint so you can accept alerts from a third-party
+alerts service. See the
+[instructions for toggling generic alerts](../../user/project/integrations/generic_alerts.md#setting-up-generic-alerts)
+to add this option. After configuring the endpoint, the
+[Alerts list](#alert-management-list) is enabled.
+
+To populate the alerts with data, see [Customizing the payload](../../user/project/integrations/generic_alerts.md#customizing-the-payload) for requests to the alerts endpoint.
+
+### Enable GitLab-managed Prometheus alerts
+
+You can install the GitLab-managed Prometheus application on your Kubernetes
+cluster. For more information, see
+[Managed Prometheus on Kubernetes](../../user/project/integrations/prometheus.md#managed-prometheus-on-kubernetes).
+When GitLab-managed Prometheus is installed, the [Alerts list](#alert-management-list)
+is also enabled.
+
+To populate the alerts with data, see
+[GitLab-Managed Prometheus instances](../metrics/alerts.md#managed-prometheus-instances).
+
+### Enable external Prometheus alerts
+
+You can configure an externally-managed Prometheus instance to send alerts
+to GitLab. To set up this configuration, see the [configuring Prometheus](../metrics/alerts.md#external-prometheus-instances) documentation. Activating the external Prometheus
+configuration also enables the [Alerts list](#alert-management-list).
+
+To populate the alerts with data, see
+[External Prometheus instances](../metrics/alerts.md#external-prometheus-instances).
+
+## Alert Management severity
+
+Each level of alert contains a uniquely shaped and color-coded icon to help
+you identify the severity of a particular alert. These severity icons help you
+immediately identify which alerts you should prioritize investigating:
+
+![Alert Management Severity System](img/alert_management_severity_v13_0.png)
+
+Alerts contain one of the following icons:
+
+| Severity | Icon | Color (hexadecimal) |
+|---|---|---|
+| Critical | **{severity-critical}** | `#8b2615` |
+| High | **{severity-high}** | `#c0341d` |
+| Medium | **{severity-medium}** | `#fca429` |
+| Low | **{severity-low}** | `#fdbc60` |
+| Info | **{severity-info}** | `#418cd8` |
+| Unknown | **{severity-unknown}** | `#bababa` |
+
+## Alert Management list
+
+NOTE: **Note:**
+You will need at least Developer [permissions](../../user/permissions.md) to view the Alert Management list.
+
+You can find the Alert Management list at **{cloud-gear}** **Operations > Alerts** in your project's sidebar.
+Each alert contains the following metrics:
+
+![Alert Management List](../../user/project/operations/img/alert_list_v13_1.png)
+
+- **Severity** - The current importance of a alert and how much attention it should receive.
+- **Start time** - How long ago the alert fired. This field uses the standard GitLab pattern of `X time ago`, but is supported by a granular date/time tooltip depending on the user's locale.
+- **Alert description** - The description of the alert, which attempts to capture the most meaningful data.
+- **Event count** - The number of times that an alert has fired.
+- **Issue** - A link to the incident issue that has been created for the alert.
+- **Status** - The [current status](#alert-management-statuses) of the alert.
+
+### Alert Management list sorting
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/217745) in GitLab 13.1.
+
+The Alert Management list displays alerts sorted by start time, but you can
+change the sort order by clicking the headers in the Alert Management list.
+
+To see if a column is sortable, point your mouse at the header. Sortable columns
+display an arrow next to the column name, as shown in this example:
+
+![Alert Management List Sorting](img/alert_list_sort_v13_1.png)
+
+### Searching alerts
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/213884) in GitLab 13.1.
+
+The alert list supports a simple free text search.
+
+![Alert List Search](img/alert_list_search_v13_1.png)
+
+This search filters on the following fields:
+
+- Title
+- Description
+- Monitoring tool
+- Service
+
+### Alert Management statuses
+
+Each alert contains a status dropdown to indicate which alerts need investigation.
+Standard alert statuses include `triggered`, `acknowledged`, and `resolved`:
+
+- **Triggered**: No one has begun investigation.
+- **Acknowledged**: Someone is actively investigating the problem.
+- **Resolved**: No further work is required.
+
+## Alert Management details
+
+NOTE: **Note:**
+You will need at least Developer [permissions](../../user/permissions.md) to view Alert Management details.
+
+Navigate to the Alert Management detail view by visiting the [Alert Management list](#alert-management-list) and selecting an Alert from the list.
+
+![Alert Management Detail Overview](img/alert_detail_overview_v13_1.png)
+
+![Alert Management Full Details](img/alert_detail_full_v13_1.png)
+
+### Update an Alert's status
+
+The Alert Management detail view enables you to update the Alert Status.
+See [Alert Management statuses](#alert-management-statuses) for more details.
+
+### Create an Issue from an Alert
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/217745) in GitLab 13.1.
+
+The Alert Management detail view enables you to create an issue with a
+description automatically populated from an alert. To create the issue,
+click the **Create Issue** button. You can then view the issue from the
+alert by clicking the **View Issue** button.
+
+Closing a GitLab issue associated with an alert changes the alert's status to Resolved.
+See [Alert Management statuses](#alert-management-statuses) for more details about statuses.
+
+### Update an Alert's assignee
+
+> [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/3066) in GitLab 13.1.
+
+The Alert Management detail view allows users to update the Alert assignee.
+
+In large teams, where there is shared ownership of an alert, it can be difficult
+to track who is investigating and working on it. The Alert Management detail view
+enables you to update the Alert assignee:
+
+NOTE: **Note:**
+GitLab currently only supports a single assignee per alert.
+
+1. To display the list of current alerts, click
+ **{cloud-gear}** **Operations > Alerts**:
+
+ ![Alert Management List View Assignee(s)](img/alert_list_assignees_v13_1.png)
+
+1. Select your desired alert to display its **Alert Management Details View**:
+
+ ![Alert Management Details View Assignee(s)](img/alert_details_assignees_v13_1.png)
+
+1. If the right sidebar is not expanded, click
+ **{angle-double-right}** **Expand sidebar** to expand it.
+1. In the right sidebar, locate the **Assignee** and click **Edit**. From the
+ dropdown menu, select each user you want to assign to the alert. GitLab creates
+ a [To-Do list item](../../user/todos.md) for each user.
+
+ ![Alert Management Details View Assignee(s)](img/alert_todo_assignees_v13_1.png)
+
+To remove an assignee, click **Edit** next to the **Assignee** dropdown menu and
+deselect the user from the list of assignees, or click **Unassigned**.
+
+### Alert system notes
+
+> [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/3066) in GitLab 13.1.
+
+When you take action on an alert, this is logged as a system note,
+which is visible in the Alert Details view. This gives you a linear
+timeline of the alert's investigation and assignment history.
+
+The following actions will result in a system note:
+
+- [Updating the status of an alert](#update-an-alerts-status)
+- [Creating an issue based on an alert](#create-an-issue-from-an-alert)
+- [Assignment of an alert to a user](#update-an-alerts-assignee)
+
+![Alert Management Details View System Notes](img/alert_detail_system_notes_v13_1.png)
+
+### Create a To-Do from an Alert
+
+> [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/3066) in GitLab 13.1.
+
+You can manually create [To-Do list items](../../user/todos.md) for yourself from the
+Alert details screen, and view them later on your **To-Do List**. To add a To-Do:
+
+1. To display the list of current alerts, click
+ **{cloud-gear}** **Operations > Alerts**.
+1. Select your desired alert to display its **Alert Management Details View**.
+1. Click the **Add a To-Do** button in the right sidebar:
+
+ ![Alert Management Details Add A To Do](img/alert_detail_add_todo_v13_1.png)
+
+Click the **To-Do** **{todo-done}** in the navigation bar to view your current To-Do list.
+
+![Alert Management Details Added to Do](img/alert_detail_added_todo_v13_1.png)
+
+### View an Alert's metrics data
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/217768) in GitLab 13.2.
+
+To view the metrics for an alert:
+
+ 1. Sign in as a user with Developer or higher [permissions](../../user/permissions.md).
+ 1. Navigate to **{cloud-gear}** **Operations > Alerts**.
+ 1. Click the alert you want to view.
+ 1. Below the title of the alert, click the **Metrics** tab.
+
+![Alert Management Metrics View](img/alert_detail_metrics_v13_2.png)
+
+For GitLab-managed Prometheus instances, metrics data is automatically available
+for the alert, making it easy to see surrounding behavior. See
+[Managed Prometheus instances](../metrics/alerts.md#managed-prometheus-instances)
+for information on setting up alerts.
+
+For externally-managed Prometheus instances, you can configure your alerting rules to
+display a chart in the alert. See
+[Embedding metrics based on alerts in incident issues](../metrics/embed.md#embedding-metrics-based-on-alerts-in-incident-issues)
+for information on how to appropriately configure your alerting rules. See
+[External Prometheus instances](../metrics/alerts.md#external-prometheus-instances)
+for information on setting up alerts for your self-managed Prometheus instance.
+
+## Use cases for assigning alerts
+
+Consider a team formed by different sections of monitoring, collaborating on a
+single application. After an alert surfaces, it's extremely important to
+route the alert to the team members who can address and resolve the alert.
+
+Assigning Alerts to multiple assignees eases collaboration and delegation. All
+assignees are shown in your team's work-flows, and all assignees receive
+notifications, simplifying communication and ownership of the alert.
+
+After completing their portion of investigating or fixing the alert, users can
+unassign their account from the alert when their role is complete.
+The [alerts status](#alert-management-statuses) can be updated to
+reflect if the alert has been resolved.
+
+### Slack Notifications
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/216326) in GitLab 13.1.
+
+You can be alerted via a Slack message when a new alert has been received.
+
+See the [Slack Notifications Service docs](../../user/project/integrations/slack.md) for information on how to set this up.
## Configure incidents **(ULTIMATE)**
@@ -80,6 +355,16 @@ These emails contain details of the alert, and a link for more information.
To send separate email notifications to users with
[Developer permissions](../../user/permissions.md), see [Configure incidents](#configure-incidents-ultimate).
+## Create an incident manually
+
+> [Moved](https://gitlab.com/gitlab-org/monitor/health/-/issues/24) to GitLab core in 13.3.
+
+For users with at least Developer [permissions](../../user/permissions.md), to create a Incident you can take any of the following actions:
+
+- Navigate to **Operations > Incidents** and click **Create Incident**.
+- Create a new issue using the `incident` template available when creating it.
+- Create a new issue and assign the `incident` label to it.
+
## Configure PagerDuty integration
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/119018) in GitLab 13.3.
@@ -154,7 +439,7 @@ your application's performance and resolve any problems.
Slack slash commands allow you to control GitLab and view GitLab content without leaving Slack.
Learn how to [set up Slack slash commands](../../user/project/integrations/slack_slash_commands.md)
-and how to [use the available slash commands](../../integration/slash_commands.md).
+and how to [use the available slash commands](../../user/project/slash_commands.md).
## Integrate issues with Zoom
diff --git a/doc/operations/index.md b/doc/operations/index.md
index 214cecb742b..bcc3f89f47f 100644
--- a/doc/operations/index.md
+++ b/doc/operations/index.md
@@ -35,7 +35,7 @@ using metrics and logs, and promote the critical alerts to incidents.
Are your alerts too noisy? Alerts configured on GitLab metrics can configured
and fine-tuned in GitLab immediately following a fire-fight.
-- [Manage your external alerts](../user/project/operations/alert_management.md) and [manage Incidents](../user/incident_management/index.md) in GitLab.
+- [Manage alerts and incidents](../user/incident_management/index.md) in GitLab.
- [Configure alerts for metrics](metrics/alerts.md#set-up-alerts-for-prometheus-metrics-core) in GitLab.
- Create a [status page](incident_management/status_page.md)
to communicate efficiently to your users during an incident.
diff --git a/doc/user/infrastructure/index.md b/doc/user/infrastructure/index.md
index 21e8e3298ec..b728a47d9d4 100644
--- a/doc/user/infrastructure/index.md
+++ b/doc/user/infrastructure/index.md
@@ -65,16 +65,16 @@ local machine, this is a simple way to get started:
the `api` scope.
1. On your local machine, run `terraform init`, passing in the following options,
- replacing `<YOUR-PROJECT-NAME>`, `<YOUR-PROJECT-ID>`, `<YOUR-USERNAME>` and
+ replacing `<YOUR-STATE-NAME>`, `<YOUR-PROJECT-ID>`, `<YOUR-USERNAME>` and
`<YOUR-ACCESS-TOKEN>` with the relevant values. This command initializes your
Terraform state, and stores that state within your GitLab project. This example
uses `gitlab.com`:
```shell
terraform init \
- -backend-config="address=https://gitlab.com/api/v4/projects/<YOUR-PROJECT-ID>/terraform/state/<YOUR-PROJECT-NAME>" \
- -backend-config="lock_address=https://gitlab.com/api/v4/projects/<YOUR-PROJECT-ID>/terraform/state/<YOUR-PROJECT-NAME>/lock" \
- -backend-config="unlock_address=https://gitlab.com/api/v4/projects/<YOUR-PROJECT-ID>/terraform/state/<YOUR-PROJECT-NAME>/lock" \
+ -backend-config="address=https://gitlab.com/api/v4/projects/<YOUR-PROJECT-ID>/terraform/state/<YOUR-STATE-NAME>" \
+ -backend-config="lock_address=https://gitlab.com/api/v4/projects/<YOUR-PROJECT-ID>/terraform/state/<YOUR-STATE-NAME>/lock" \
+ -backend-config="unlock_address=https://gitlab.com/api/v4/projects/<YOUR-PROJECT-ID>/terraform/state/<YOUR-STATE-NAME>/lock" \
-backend-config="username=<YOUR-USERNAME>" \
-backend-config="password=<YOUR-ACCESS-TOKEN>" \
-backend-config="lock_method=POST" \
@@ -82,7 +82,7 @@ local machine, this is a simple way to get started:
-backend-config="retry_wait_min=5"
```
-Next, [configure the backend](#configure-the-backend).
+You can now run `terraform plan` and `terraform apply` as you normally would.
## Get started using GitLab CI
@@ -121,17 +121,18 @@ and the CI YAML file:
commands must be executed, `TF_ADDRESS` is the URL to the state on the GitLab
instance where this pipeline runs, and the final path segment in `TF_ADDRESS`
is the name of the Terraform state. Projects may have multiple states, and
- this name is arbitrary, so in this example we will set it to the name of the
- project, and we will ensure that the `.terraform` directory is cached between
- jobs in the pipeline using a cache key based on the state name:
+ this name is arbitrary, so in this example we set it to `example-production`
+ which corresponds with the directory we're using as our `TF_ROOT`, and we
+ ensure that the `.terraform` directory is cached between jobs in the pipeline
+ using a cache key based on the state name (`example-production`):
```yaml
variables:
- TF_ROOT: ${CI_PROJECT_DIR}/environments/cloudflare/production
- TF_ADDRESS: ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/terraform/state/${CI_PROJECT_NAME}
+ TF_ROOT: ${CI_PROJECT_DIR}/environments/example/production
+ TF_ADDRESS: ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/terraform/state/example-production
cache:
- key: ${CI_PROJECT_NAME}
+ key: example-production
paths:
- ${TF_ROOT}/.terraform
```
@@ -275,11 +276,11 @@ can configure this manually as follows:
image: registry.gitlab.com/gitlab-org/terraform-images/stable:latest
variables:
- TF_ROOT: ${CI_PROJECT_DIR}/environments/cloudflare/production
- TF_ADDRESS: ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/terraform/state/${CI_PROJECT_NAME}
+ TF_ROOT: ${CI_PROJECT_DIR}/environments/example/production
+ TF_ADDRESS: ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/terraform/state/example-production
cache:
- key: ${CI_PROJECT_NAME}
+ key: example-production
paths:
- ${TF_ROOT}/.terraform
diff --git a/doc/user/project/integrations/generic_alerts.md b/doc/user/project/integrations/generic_alerts.md
index 9036846282f..3abe18381e4 100644
--- a/doc/user/project/integrations/generic_alerts.md
+++ b/doc/user/project/integrations/generic_alerts.md
@@ -116,7 +116,7 @@ In GitLab versions 13.2 and greater, GitLab groups alerts based on their payload
When an incoming alert contains the same payload as another alert (excluding the
`start_time` and `hosts` attributes), GitLab groups these alerts together and
displays a counter on the
-[Alert Management List](../operations/alert_management.md#alert-management-list)
+[Alert Management List](../../../operations/incident_management/index.md#alert-management-list)
and details pages.
If the existing alert is already `resolved`, then a new alert will be created instead.
diff --git a/doc/user/project/operations/alert_management.md b/doc/user/project/operations/alert_management.md
index 40736537d70..0feed7dbf40 100644
--- a/doc/user/project/operations/alert_management.md
+++ b/doc/user/project/operations/alert_management.md
@@ -1,292 +1,5 @@
---
-stage: Monitor
-group: Health
-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/#designated-technical-writers
+redirect_to: '../../../operations/incident_management/index.md'
---
-# Alert management
-
-> [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/2877) in GitLab 13.0.
-
-Alert Management enables developers to easily discover and view the alerts
-generated by their application. By surfacing alert information where the code is
-being developed, efficiency and awareness can be increased.
-
-## Enable Alert Management
-
-NOTE: **Note:**
-You will need at least Maintainer [permissions](../../permissions.md) to enable the Alert Management feature.
-
-There are several ways to accept alerts into your GitLab project, as outlined below.
-Enabling any of these methods will allow the Alerts list to display. After configuring
-alerts, visit **{cloud-gear}** **Operations > Alerts** in your project's sidebar
-to [view the list](#alert-management-list) of alerts.
-
-### Opsgenie integration **(PREMIUM)**
-
-> [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/3066) in [GitLab Premium](https://about.gitlab.com/pricing/) 13.2.
-
-A new way of monitoring Alerts via a GitLab integration is with
-[Opsgenie](https://www.atlassian.com/software/opsgenie).
-
-NOTE: **Note:**
-If you enable the Opsgenie integration, you cannot have other GitLab alert services,
-such as [Generic Alerts](../integrations/generic_alerts.md) or
-Prometheus alerts, active at the same time.
-
-To enable Opsgenie integration:
-
-1. Sign in as a user with Maintainer or Owner [permissions](../../permissions.md).
-1. Navigate to **{cloud-gear}** **Operations > Alerts**.
-1. In the **Integrations** select box, select Opsgenie.
-1. Click the **Active** toggle.
-1. In the **API URL**, enter the base URL for your Opsgenie integration, such
- as `https://app.opsgenie.com/alert/list`.
-1. Click **Save changes**.
-
-After enabling the integration, navigate to the Alerts list page at **{cloud-gear}** **Operations > Alerts**, and click **View alerts in Opsgenie**.
-
-### Enable a Generic Alerts endpoint
-
-GitLab provides the Generic Alerts endpoint so you can accept alerts from a third-party
-alerts service. See the
-[instructions for toggling generic alerts](../integrations/generic_alerts.md#setting-up-generic-alerts)
-to add this option. After configuring the endpoint, the
-[Alerts list](#alert-management-list) is enabled.
-
-To populate the alerts with data, see [Customizing the payload](../integrations/generic_alerts.md#customizing-the-payload) for requests to the alerts endpoint.
-
-### Enable GitLab-managed Prometheus alerts
-
-You can install the GitLab-managed Prometheus application on your Kubernetes
-cluster. For more information, see
-[Managed Prometheus on Kubernetes](../integrations/prometheus.md#managed-prometheus-on-kubernetes).
-When GitLab-managed Prometheus is installed, the [Alerts list](#alert-management-list)
-is also enabled.
-
-To populate the alerts with data, see
-[GitLab-Managed Prometheus instances](../../../operations/metrics/alerts.md#managed-prometheus-instances).
-
-### Enable external Prometheus alerts
-
-You can configure an externally-managed Prometheus instance to send alerts
-to GitLab. To set up this configuration, see the [configuring Prometheus](../../../operations/metrics/alerts.md#external-prometheus-instances) documentation. Activating the external Prometheus
-configuration also enables the [Alerts list](#alert-management-list).
-
-To populate the alerts with data, see
-[External Prometheus instances](../../../operations/metrics/alerts.md#external-prometheus-instances).
-
-## Alert Management severity
-
-Each level of alert contains a uniquely shaped and color-coded icon to help
-you identify the severity of a particular alert. These severity icons help you
-immediately identify which alerts you should prioritize investigating:
-
-![Alert Management Severity System](img/alert_management_severity_v13_0.png)
-
-Alerts contain one of the following icons:
-
-| Severity | Icon | Color (hexadecimal) |
-|---|---|---|
-| Critical | **{severity-critical}** | `#8b2615` |
-| High | **{severity-high}** | `#c0341d` |
-| Medium | **{severity-medium}** | `#fca429` |
-| Low | **{severity-low}** | `#fdbc60` |
-| Info | **{severity-info}** | `#418cd8` |
-| Unknown | **{severity-unknown}** | `#bababa` |
-
-## Alert Management list
-
-NOTE: **Note:**
-You will need at least Developer [permissions](../../permissions.md) to view the Alert Management list.
-
-You can find the Alert Management list at **{cloud-gear}** **Operations > Alerts** in your project's sidebar.
-Each alert contains the following metrics:
-
-![Alert Management List](img/alert_list_v13_1.png)
-
-- **Severity** - The current importance of a alert and how much attention it should receive.
-- **Start time** - How long ago the alert fired. This field uses the standard GitLab pattern of `X time ago`, but is supported by a granular date/time tooltip depending on the user's locale.
-- **Alert description** - The description of the alert, which attempts to capture the most meaningful data.
-- **Event count** - The number of times that an alert has fired.
-- **Issue** - A link to the incident issue that has been created for the alert.
-- **Status** - The [current status](#alert-management-statuses) of the alert.
-
-### Alert Management list sorting
-
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/217745) in GitLab 13.1.
-
-The Alert Management list displays alerts sorted by start time, but you can
-change the sort order by clicking the headers in the Alert Management list.
-
-To see if a column is sortable, point your mouse at the header. Sortable columns
-display an arrow next to the column name, as shown in this example:
-
-![Alert Management List Sorting](img/alert_list_sort_v13_1.png)
-
-### Searching alerts
-
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/213884) in GitLab 13.1.
-
-The alert list supports a simple free text search.
-
-![Alert List Search](img/alert_list_search_v13_1.png)
-
-This search filters on the following fields:
-
-- Title
-- Description
-- Monitoring tool
-- Service
-
-### Alert Management statuses
-
-Each alert contains a status dropdown to indicate which alerts need investigation.
-Standard alert statuses include `triggered`, `acknowledged`, and `resolved`:
-
-- **Triggered**: No one has begun investigation.
-- **Acknowledged**: Someone is actively investigating the problem.
-- **Resolved**: No further work is required.
-
-## Alert Management details
-
-NOTE: **Note:**
-You will need at least Developer [permissions](../../permissions.md) to view Alert Management details.
-
-Navigate to the Alert Management detail view by visiting the [Alert Management list](#alert-management-list) and selecting an Alert from the list.
-
-![Alert Management Detail Overview](img/alert_detail_overview_v13_1.png)
-
-![Alert Management Full Details](img/alert_detail_full_v13_1.png)
-
-### Update an Alert's status
-
-The Alert Management detail view enables you to update the Alert Status.
-See [Alert Management statuses](#alert-management-statuses) for more details.
-
-### Create an Issue from an Alert
-
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/217745) in GitLab 13.1.
-
-The Alert Management detail view enables you to create an issue with a
-description automatically populated from an alert. To create the issue,
-click the **Create Issue** button. You can then view the issue from the
-alert by clicking the **View Issue** button.
-
-Closing a GitLab issue associated with an alert changes the alert's status to Resolved.
-See [Alert Management statuses](#alert-management-statuses) for more details about statuses.
-
-### Update an Alert's assignee
-
-> [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/3066) in GitLab 13.1.
-
-The Alert Management detail view allows users to update the Alert assignee.
-
-In large teams, where there is shared ownership of an alert, it can be difficult
-to track who is investigating and working on it. The Alert Management detail view
-enables you to update the Alert assignee:
-
-NOTE: **Note:**
-GitLab currently only supports a single assignee per alert.
-
-1. To display the list of current alerts, click
- **{cloud-gear}** **Operations > Alerts**:
-
- ![Alert Management List View Assignee(s)](img/alert_list_assignees_v13_1.png)
-
-1. Select your desired alert to display its **Alert Management Details View**:
-
- ![Alert Management Details View Assignee(s)](img/alert_details_assignees_v13_1.png)
-
-1. If the right sidebar is not expanded, click
- **{angle-double-right}** **Expand sidebar** to expand it.
-1. In the right sidebar, locate the **Assignee** and click **Edit**. From the
- dropdown menu, select each user you want to assign to the alert. GitLab creates
- a [To-Do list item](../../todos.md) for each user.
-
- ![Alert Management Details View Assignee(s)](img/alert_todo_assignees_v13_1.png)
-
-To remove an assignee, click **Edit** next to the **Assignee** dropdown menu and
-deselect the user from the list of assignees, or click **Unassigned**.
-
-### Alert system notes
-
-> [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/3066) in GitLab 13.1.
-
-When you take action on an alert, this is logged as a system note,
-which is visible in the Alert Details view. This gives you a linear
-timeline of the alert's investigation and assignment history.
-
-The following actions will result in a system note:
-
-- [Updating the status of an alert](#update-an-alerts-status)
-- [Creating an issue based on an alert](#create-an-issue-from-an-alert)
-- [Assignment of an alert to a user](#update-an-alerts-assignee)
-
-![Alert Management Details View System Notes](img/alert_detail_system_notes_v13_1.png)
-
-### Create a To-Do from an Alert
-
-> [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/3066) in GitLab 13.1.
-
-You can manually create [To-Do list items](../../todos.md) for yourself from the
-Alert details screen, and view them later on your **To-Do List**. To add a To-Do:
-
-1. To display the list of current alerts, click
- **{cloud-gear}** **Operations > Alerts**.
-1. Select your desired alert to display its **Alert Management Details View**.
-1. Click the **Add a To-Do** button in the right sidebar:
-
- ![Alert Management Details Add A To Do](img/alert_detail_add_todo_v13_1.png)
-
-Click the **To-Do** **{todo-done}** in the navigation bar to view your current To-Do list.
-
-![Alert Management Details Added to Do](img/alert_detail_added_todo_v13_1.png)
-
-### View an Alert's metrics data
-
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/217768) in GitLab 13.2.
-
-To view the metrics for an alert:
-
- 1. Sign in as a user with Developer or higher [permissions](../../permissions.md).
- 1. Navigate to **{cloud-gear}** **Operations > Alerts**.
- 1. Click the alert you want to view.
- 1. Below the title of the alert, click the **Metrics** tab.
-
-![Alert Management Metrics View](img/alert_detail_metrics_v13_2.png)
-
-For GitLab-managed Prometheus instances, metrics data is automatically available
-for the alert, making it easy to see surrounding behavior. See
-[Managed Prometheus instances](../../../operations/metrics/alerts.md#managed-prometheus-instances)
-for information on setting up alerts.
-
-For externally-managed Prometheus instances, you can configure your alerting rules to
-display a chart in the alert. See
-[Embedding metrics based on alerts in incident issues](../../../operations/metrics/embed.md#embedding-metrics-based-on-alerts-in-incident-issues)
-for information on how to appropriately configure your alerting rules. See
-[External Prometheus instances](../../../operations/metrics/alerts.md#external-prometheus-instances)
-for information on setting up alerts for your self-managed Prometheus instance.
-
-## Use cases for assigning alerts
-
-Consider a team formed by different sections of monitoring, collaborating on a
-single application. After an alert surfaces, it's extremely important to
-route the alert to the team members who can address and resolve the alert.
-
-Assigning Alerts to multiple assignees eases collaboration and delegation. All
-assignees are shown in your team's work-flows, and all assignees receive
-notifications, simplifying communication and ownership of the alert.
-
-After completing their portion of investigating or fixing the alert, users can
-unassign their account from the alert when their role is complete.
-The [alerts status](#alert-management-statuses) can be updated to
-reflect if the alert has been resolved.
-
-### Slack Notifications
-
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/216326) in GitLab 13.1.
-
-You can be alerted via a Slack message when a new alert has been received.
-
-See the [Slack Notifications Service docs](../integrations/slack.md) for information on how to set this up.
+This document was moved to [another location](../../../operations/incident_management/index.md).
diff --git a/lib/gitlab/analytics/cycle_analytics/records_fetcher.rb b/lib/gitlab/analytics/cycle_analytics/records_fetcher.rb
index 6901ef1eafe..e45a345d25a 100644
--- a/lib/gitlab/analytics/cycle_analytics/records_fetcher.rb
+++ b/lib/gitlab/analytics/cycle_analytics/records_fetcher.rb
@@ -90,7 +90,7 @@ module Gitlab
end
def ordered_and_limited_query
- order_by_end_event(query).limit(MAX_RECORDS)
+ order_by_end_event(query, columns).limit(MAX_RECORDS)
end
def records
diff --git a/lib/gitlab/analytics/cycle_analytics/stage_query_helpers.rb b/lib/gitlab/analytics/cycle_analytics/stage_query_helpers.rb
index c9a75b39959..80e426e6e17 100644
--- a/lib/gitlab/analytics/cycle_analytics/stage_query_helpers.rb
+++ b/lib/gitlab/analytics/cycle_analytics/stage_query_helpers.rb
@@ -24,13 +24,13 @@ module Gitlab
end
# rubocop: disable CodeReuse/ActiveRecord
- def order_by_end_event(query)
+ def order_by_end_event(query, extra_columns_to_select = [:id])
ordered_query = query.reorder(stage.end_event.timestamp_projection.desc)
# When filtering for more than one label, postgres requires the columns in ORDER BY to be present in the GROUP BY clause
if requires_grouping?
column_list = [
- ordered_query.arel_table[:id],
+ *extra_columns_to_select,
*stage.end_event.column_list,
*stage.start_event.column_list
]
diff --git a/lib/gitlab/metrics/elasticsearch_rack_middleware.rb b/lib/gitlab/metrics/elasticsearch_rack_middleware.rb
index f4bdb08437e..870ab148004 100644
--- a/lib/gitlab/metrics/elasticsearch_rack_middleware.rb
+++ b/lib/gitlab/metrics/elasticsearch_rack_middleware.rb
@@ -24,12 +24,12 @@ module Gitlab
query_time = ::Gitlab::Instrumentation::ElasticsearchTransport.query_time
request_count = ::Gitlab::Instrumentation::ElasticsearchTransport.get_request_count
+ return unless request_count > 0
+
transaction.increment(:http_elasticsearch_requests_total, request_count) do
docstring 'Amount of calls to Elasticsearch servers during web requests'
end
- return unless request_count > 0
-
transaction.observe(:http_elasticsearch_requests_duration_seconds, query_time) do
docstring 'Query time for Elasticsearch servers during web requests'
buckets HISTOGRAM_BUCKETS
diff --git a/qa/qa/page/merge_request/new.rb b/qa/qa/page/merge_request/new.rb
index eda7da89a35..8d0914bac4c 100644
--- a/qa/qa/page/merge_request/new.rb
+++ b/qa/qa/page/merge_request/new.rb
@@ -5,7 +5,7 @@ module QA
module MergeRequest
class New < Page::Issuable::New
view 'app/views/shared/issuable/_form.html.haml' do
- element :issuable_create_button
+ element :issuable_create_button, required: true
end
def create_merge_request
diff --git a/qa/qa/page/project/show.rb b/qa/qa/page/project/show.rb
index 2354a0d9332..22c2ed2a0c2 100644
--- a/qa/qa/page/project/show.rb
+++ b/qa/qa/page/project/show.rb
@@ -143,6 +143,10 @@ module QA
click_element :web_ide_button
end
+ def has_edit_fork_button?
+ has_element?(:web_ide_button, text: 'Edit fork in Web IDE')
+ end
+
def project_name
find_element(:project_name_content).text
end
diff --git a/qa/qa/page/project/web_ide/edit.rb b/qa/qa/page/project/web_ide/edit.rb
index faa3f2cf595..b962b0c673b 100644
--- a/qa/qa/page/project/web_ide/edit.rb
+++ b/qa/qa/page/project/web_ide/edit.rb
@@ -59,12 +59,25 @@ module QA
element :rename_move_button
end
+ view 'app/views/shared/_confirm_fork_modal.html.haml' do
+ element :fork_project_button
+ element :confirm_fork_modal
+ end
+
+ view 'app/assets/javascripts/ide/components/ide_project_header.vue' do
+ element :project_path_content
+ end
+
def has_file?(file_name)
within_element(:file_list) do
page.has_content? file_name
end
end
+ def has_project_path?(project_path)
+ has_element?(:project_path_content, project_path: project_path)
+ end
+
def create_new_file_from_template(file_name, template)
click_element(:new_file, Page::Component::WebIDE::Modal::CreateNewFile)
@@ -91,7 +104,7 @@ module QA
end
end
- def commit_changes
+ def commit_changes(open_merge_request: false)
# Clicking :begin_commit_button switches from the
# edit to the commit view
click_element :begin_commit_button
@@ -107,19 +120,23 @@ module QA
has_element?(:commit_button)
end
- # Click :commit_button and keep retrying just in case part of the
- # animation is still in process even when the buttons have the
- # expected visibility.
- commit_success_msg_shown = retry_until(sleep_interval: 5) do
- click_element(:commit_to_current_branch_radio) if has_element?(:commit_to_current_branch_radio)
- click_element(:commit_button) if has_element?(:commit_button)
-
- wait_until(reload: false) do
- has_text?('Your changes have been committed')
+ if open_merge_request
+ click_element(:commit_button, Page::MergeRequest::New)
+ else
+ # Click :commit_button and keep retrying just in case part of the
+ # animation is still in process even when the buttons have the
+ # expected visibility.
+ commit_success_msg_shown = retry_until(sleep_interval: 5) do
+ click_element(:commit_to_current_branch_radio) if has_element?(:commit_to_current_branch_radio)
+ click_element(:commit_button) if has_element?(:commit_button)
+
+ wait_until(reload: false) do
+ has_text?('Your changes have been committed')
+ end
end
- end
- raise "The changes do not appear to have been committed successfully." unless commit_success_msg_shown
+ raise "The changes do not appear to have been committed successfully." unless commit_success_msg_shown
+ end
end
def add_to_modified_content(content)
@@ -141,6 +158,16 @@ module QA
click_button('Create file')
end
+ def add_file(file_name, file_text)
+ click_element(:new_file, Page::Component::WebIDE::Modal::CreateNewFile)
+ fill_element(:file_name_field, file_name)
+ click_button('Create file')
+ wait_until(reload: false) { has_file?(file_name) }
+ within_element(:editor_container) do
+ find('textarea.inputarea').click.set(file_text)
+ end
+ end
+
def rename_file(file_name, new_file_name)
click_element(:file_name_content, text: file_name)
click_element(:dropdown_button)
@@ -148,6 +175,17 @@ module QA
fill_element(:file_name_field, new_file_name)
click_button('Rename file')
end
+
+ def fork_project!
+ wait_until(reload: false) do
+ has_element?(:confirm_fork_modal)
+ end
+ click_element(:fork_project_button)
+ # wait for the fork to be created
+ wait_until(reload: true) do
+ has_element?(:file_list)
+ end
+ end
end
end
end
diff --git a/qa/qa/specs/features/browser_ui/3_create/web_ide/open_fork_in_web_ide_spec.rb b/qa/qa/specs/features/browser_ui/3_create/web_ide/open_fork_in_web_ide_spec.rb
new file mode 100644
index 00000000000..ad7455242bc
--- /dev/null
+++ b/qa/qa/specs/features/browser_ui/3_create/web_ide/open_fork_in_web_ide_spec.rb
@@ -0,0 +1,67 @@
+# frozen_string_literal: true
+
+module QA
+ RSpec.describe 'Create' do
+ describe 'Open a fork in Web IDE' do
+ let(:parent_project) do
+ Resource::Project.fabricate_via_api! do |project|
+ project.name = 'parent-project'
+ project.initialize_with_readme = true
+ end
+ end
+
+ context 'when a user does not have permissions to commit to the project' do
+ let(:user) { Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1) }
+
+ context 'when no fork is present' do
+ it 'suggests to create a fork when a user clicks Web IDE in the main project' do
+ Flow::Login.sign_in(as: user)
+
+ parent_project.visit!
+ Page::Project::Show.perform(&:open_web_ide!)
+
+ Page::Project::WebIDE::Edit.perform(&:fork_project!)
+
+ submit_merge_request_upstream
+ end
+ end
+
+ context 'when a fork is already created' do
+ let(:fork_project) do
+ Resource::Fork.fabricate_via_api! do |fork|
+ fork.user = user
+ fork.upstream = parent_project
+ end
+ end
+
+ it 'opens the fork when a user clicks Web IDE in the main project' do
+ Flow::Login.sign_in(as: user)
+ fork_project.upstream.visit!
+ Page::Project::Show.perform do |project_page|
+ expect(project_page).to have_edit_fork_button
+
+ project_page.open_web_ide!
+ end
+
+ submit_merge_request_upstream
+ end
+ end
+
+ def submit_merge_request_upstream
+ Page::Project::WebIDE::Edit.perform do |ide|
+ expect(ide).to have_project_path("#{user.username}/#{parent_project.name}")
+
+ ide.add_file('new file', 'some random text')
+ ide.commit_changes(open_merge_request: true)
+ end
+
+ Page::MergeRequest::New.perform(&:create_merge_request)
+
+ parent_project.visit!
+ Page::Project::Menu.perform(&:click_merge_requests)
+ expect(page).to have_content('Update new file')
+ end
+ end
+ end
+ end
+end
diff --git a/spec/frontend/static_site_editor/services/templater_spec.js b/spec/frontend/static_site_editor/services/templater_spec.js
index f29360a4bd0..228c91c006d 100644
--- a/spec/frontend/static_site_editor/services/templater_spec.js
+++ b/spec/frontend/static_site_editor/services/templater_spec.js
@@ -2,25 +2,42 @@
import templater from '~/static_site_editor/services/templater';
describe('templater', () => {
- const source = `Some text
+ const source = `Below this line is a simple ERB (single-line erb block) example.
<% some erb code %>
-Some more text
+Below this line is a complex ERB (multi-line erb block) example.
<% if apptype.maturity && (apptype.maturity != "planned") %>
<% maturity = "This application type is at the \"#{apptype.maturity}\" level of maturity." %>
<% end %>
-With even text with indented code above.
+Below this line is a non-erb (single-line HTML) markup example that also has erb.
+
+<a href="<%= compensation_roadmap.role_path %>"><%= compensation_roadmap.role_path %></a>
+
+Below this line is a non-erb (multi-line HTML block) markup example that also has erb.
+
+<ul>
+<% compensation_roadmap.recommendation.recommendations.each do |recommendation| %>
+ <li><%= recommendation %></li>
+<% end %>
+</ul>
+
+Below this line is a block of HTML.
+
+<div>
+ <h1>Heading</h1>
+ <p>Some paragraph...</p>
+</div>
`;
- const sourceTemplated = `Some text
+ const sourceTemplated = `Below this line is a simple ERB (single-line erb block) example.
\`\`\` sse
<% some erb code %>
\`\`\`
-Some more text
+Below this line is a complex ERB (multi-line erb block) example.
\`\`\` sse
<% if apptype.maturity && (apptype.maturity != "planned") %>
@@ -28,7 +45,30 @@ Some more text
<% end %>
\`\`\`
-With even text with indented code above.
+Below this line is a non-erb (single-line HTML) markup example that also has erb.
+
+\`\`\` sse
+<a href="<%= compensation_roadmap.role_path %>"><%= compensation_roadmap.role_path %></a>
+\`\`\`
+
+Below this line is a non-erb (multi-line HTML block) markup example that also has erb.
+
+\`\`\` sse
+<ul>
+<% compensation_roadmap.recommendation.recommendations.each do |recommendation| %>
+ <li><%= recommendation %></li>
+<% end %>
+</ul>
+\`\`\`
+
+Below this line is a block of HTML.
+
+\`\`\` sse
+<div>
+ <h1>Heading</h1>
+ <p>Some paragraph...</p>
+</div>
+\`\`\`
`;
it.each`
@@ -38,7 +78,7 @@ With even text with indented code above.
${'unwrap'} | ${sourceTemplated} | ${source}
${'unwrap'} | ${source} | ${source}
`(
- 'wraps $initial in a templated sse codeblock if $fn is wrap, unwraps otherwise',
+ 'wraps $initial in a templated sse codeblocks if $fn is wrap, unwraps otherwise',
({ fn, initial, target }) => {
expect(templater[fn](initial)).toMatch(target);
},
diff --git a/spec/lib/gitlab/import_export/safe_model_attributes.yml b/spec/lib/gitlab/import_export/safe_model_attributes.yml
index b3d7c0ab934..86f3978ae4f 100644
--- a/spec/lib/gitlab/import_export/safe_model_attributes.yml
+++ b/spec/lib/gitlab/import_export/safe_model_attributes.yml
@@ -739,6 +739,8 @@ Board:
- milestone_id
- weight
- name
+- hide_backlog_list
+- hide_closed_list
List:
- id
- board_id
diff --git a/spec/lib/gitlab/metrics/elasticsearch_rack_middleware_spec.rb b/spec/lib/gitlab/metrics/elasticsearch_rack_middleware_spec.rb
index 94f99f3ef64..78b73f148e4 100644
--- a/spec/lib/gitlab/metrics/elasticsearch_rack_middleware_spec.rb
+++ b/spec/lib/gitlab/metrics/elasticsearch_rack_middleware_spec.rb
@@ -42,8 +42,9 @@ RSpec.describe Gitlab::Metrics::ElasticsearchRackMiddleware do
context 'when there are no elasticsearch requests' do
let(:elasticsearch_requests_count) { 0 }
- it 'does not record duration if there were no ES calls' do
+ it 'does not record any metrics' do
expect(transaction).not_to receive(:observe).with(:http_elasticsearch_requests_duration_seconds)
+ expect(transaction).not_to receive(:increment).with(:http_elasticsearch_requests_total, 0)
middleware.call(env)
end