diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 54e444e6ec0..423a62b159b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -113,4 +113,7 @@ include: - local: .gitlab/ci/dast.gitlab-ci.yml - local: .gitlab/ci/workhorse.gitlab-ci.yml - local: .gitlab/ci/graphql.gitlab-ci.yml - - remote: 'https://gitlab.com/gitlab-org/frontend/untamper-my-lockfile/-/raw/main/.gitlab-ci-template.yml' + # switch the remote include to a local include until this is resolved: + # https://gitlab.com/gitlab-org/gitlab/-/issues/327299 + # - remote: 'https://gitlab.com/gitlab-org/frontend/untamper-my-lockfile/-/raw/main/.gitlab-ci-template.yml' + - local: .gitlab/ci/untamper-my-lockfile.yml diff --git a/.gitlab/ci/untamper-my-lockfile.yml b/.gitlab/ci/untamper-my-lockfile.yml new file mode 100644 index 00000000000..54ba160f1bd --- /dev/null +++ b/.gitlab/ci/untamper-my-lockfile.yml @@ -0,0 +1,26 @@ +untamper-my-lockfile: + image: registry.gitlab.com/gitlab-org/frontend/untamper-my-lockfile:main + stage: test + needs: [] + before_script: [] + after_script: [] + cache: {} + retry: 1 + script: + - untamper-my-lockfile --lockfile yarn.lock + rules: + # Create a pipeline if the branch is named 'add-untamper-my-lockfile' in + # order to have an integration check added in the MR that introduces it + - if: $CI_COMMIT_REF_NAME == "add-untamper-my-lockfile" + # Create a pipeline if there are changes in yarn.lock _and_ we are in a + # merge request _or_ branch pipeline. + # + # This ensures that the pipeline isn't run in scheduled jobs for example + # + # Also our best effort to support both branch and MR pipelines. In certain + # projects this might trigger _two_ pipelines. These projects can be fixed + # by adding proper workflow:rules + # https://docs.gitlab.com/ee/ci/yaml/#workflowrules + - if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH + changes: + - yarn.lock diff --git a/.gitlab/merge_request_templates/Quarantine End to End Test.md b/.gitlab/merge_request_templates/Quarantine End to End Test.md index cf0a89284ae..5794a62df96 100644 --- a/.gitlab/merge_request_templates/Quarantine End to End Test.md +++ b/.gitlab/merge_request_templates/Quarantine End to End Test.md @@ -3,7 +3,7 @@ @@ -24,15 +24,15 @@ the noise (due to constantly failing tests, flaky tests, and so on) so that new - [ ] Note if the test should be [quarantined for a specific environment](https://docs.gitlab.com/ee/development/testing_guide/end_to_end/environment_selection.html#quarantining-a-test-for-a-specific-environment). - [ ] Dequarantine test check-list - [ ] Follow the [Dequarantining Tests guide](https://about.gitlab.com/handbook/engineering/quality/guidelines/debugging-qa-test-failures/#dequarantining-tests). - - [ ] Confirm the test consistently passes on the target GitLab environment(s). - - [ ] (Optionally) [Trigger a manual GitLab-QA pipeline](https://about.gitlab.com/handbook/engineering/quality/guidelines/tips-and-tricks/#running-gitlab-qa-pipeline-against-a-specific-gitlab-release) against a specific GitLab environment using the `RELEASE` variable from the `package-and-qa` job of the current Merge Request. -- [ ] To ensure a faster turnaround, ask in the `#quality` Slack channel for someone to review and merge the merge request, rather than assigning it directly. + - [ ] Confirm the test consistently passes on the target GitLab environment(s). + - [ ] (Optionally) [Trigger a manual GitLab-QA pipeline](https://about.gitlab.com/handbook/engineering/quality/guidelines/tips-and-tricks/#running-gitlab-qa-pipeline-against-a-specific-gitlab-release) against a specific GitLab environment using the `RELEASE` variable from the `package-and-qa` job of the current merge request. +- [ ] To ensure a faster turnaround, ask in the `#quality` Slack channel for someone to review and merge the merge request, rather than assigning it directly. -/label ~"Quality" ~"QA" ~"feature" ~"feature::maintenance" +/label ~"Quality" ~"QA" ~"feature" ~"feature::maintenance" -/label ~"Pick into auto-deploy" ~"priority::1" ~"severity::1" +/label ~"Pick into auto-deploy" ~"priority::1" ~"severity::1" +
{{ $options.i18n.description }}
+
+
{{ $options.i18n[section].description }}
+".html_safe, code_end: "
".html_safe }
+ = _('In each example, replace %{code_start}TOKEN%{code_end} with the trigger token you generated and replace %{code_start}REF_NAME%{code_end} with the branch or tag name.').html_safe % { code_start: ''.html_safe, code_end: '
'.html_safe }
%h5.gl-mt-3
- = s_("Use cURL")
+ = _('Use cURL')
%pre
:plain
@@ -49,26 +49,26 @@
-F ref=REF_NAME \
#{builds_trigger_url(@project.id)}
%h5.gl-mt-3
- = s_("Use .gitlab-ci.yml")
+ = _('Use .gitlab-ci.yml')
%pre
:plain
script:
- "curl -X POST -F token=TOKEN -F ref=REF_NAME #{builds_trigger_url(@project.id)}"
%h5.gl-mt-3
- = s_("Use webhook")
+ = _('Use webhook')
%pre
:plain
#{builds_trigger_url(@project.id, ref: 'REF_NAME')}?token=TOKEN
%h5.gl-mt-3
- = s_("Pass job variables")
+ = _('Pass job variables')
%p.light
- = s_("Triggers|To pass variables to the triggered pipeline, add %{code_start}variables[VARIABLE]=VALUE%{code_end} to the API request.").html_safe % { code_start: "".html_safe, code_end: "
".html_safe }
+ = _('To pass variables to the triggered pipeline, add %{code_start}variables[VARIABLE]=VALUE%{code_end} to the API request.').html_safe % { code_start: ''.html_safe, code_end: '
'.html_safe }
%p.light
- = s_("cURL:")
+ = _('cURL:')
%pre
:plain
@@ -78,7 +78,7 @@
-F "variables[RUN_NIGHTLY_BUILD]=true" \
#{builds_trigger_url(@project.id)}
%p.light
- = s_("Webhook:")
+ = _('Webhook:')
%pre.gl-mb-0
:plain
diff --git a/changelogs/unreleased/202423-remove-records-without-group-from-webhooks.yml b/changelogs/unreleased/202423-remove-records-without-group-from-webhooks.yml
new file mode 100644
index 00000000000..dff08ca6494
--- /dev/null
+++ b/changelogs/unreleased/202423-remove-records-without-group-from-webhooks.yml
@@ -0,0 +1,5 @@
+---
+title: Remove records without group from webhooks table
+merge_request: 57863
+author:
+type: other
diff --git a/changelogs/unreleased/324796-update-deprecated-glicon-size-and-remove-use-deprecated-sizes.yml b/changelogs/unreleased/324796-update-deprecated-glicon-size-and-remove-use-deprecated-sizes.yml
new file mode 100644
index 00000000000..c46328b6fe7
--- /dev/null
+++ b/changelogs/unreleased/324796-update-deprecated-glicon-size-and-remove-use-deprecated-sizes.yml
@@ -0,0 +1,5 @@
+---
+title: Update GlIcon size in environments.vue
+merge_request: 58208
+author: Md. Pial Ahamed (@root.pial)
+type: changed
diff --git a/changelogs/unreleased/Externalise-strings-in-_registry-html-haml.yml b/changelogs/unreleased/Externalise-strings-in-_registry-html-haml.yml
new file mode 100644
index 00000000000..eff8004de31
--- /dev/null
+++ b/changelogs/unreleased/Externalise-strings-in-_registry-html-haml.yml
@@ -0,0 +1,5 @@
+---
+title: Externalise strings in _registry.html.haml
+merge_request: 58051
+author: nuwe1
+type: other
diff --git a/changelogs/unreleased/Externalise-strings-in-chat_names-_chat_name-html-haml.yml b/changelogs/unreleased/Externalise-strings-in-chat_names-_chat_name-html-haml.yml
new file mode 100644
index 00000000000..6c75f17563d
--- /dev/null
+++ b/changelogs/unreleased/Externalise-strings-in-chat_names-_chat_name-html-haml.yml
@@ -0,0 +1,5 @@
+---
+title: Externalize strings in chat_names/_chat_name.html.haml
+merge_request: 58444
+author: nuwe1
+type: other
diff --git a/changelogs/unreleased/Externalize-strings-in-ssessions_new_ldap-html-haml.yml b/changelogs/unreleased/Externalize-strings-in-ssessions_new_ldap-html-haml.yml
new file mode 100644
index 00000000000..89bd340d9f1
--- /dev/null
+++ b/changelogs/unreleased/Externalize-strings-in-ssessions_new_ldap-html-haml.yml
@@ -0,0 +1,5 @@
+---
+title: Externalize strings in sessions/_new_ldap.html.haml
+merge_request: 58267
+author: nuwe1
+type: other
diff --git a/changelogs/unreleased/fix-commit-status-with-child-pipeline.yml b/changelogs/unreleased/fix-commit-status-with-child-pipeline.yml
new file mode 100644
index 00000000000..eacbcd8bc0f
--- /dev/null
+++ b/changelogs/unreleased/fix-commit-status-with-child-pipeline.yml
@@ -0,0 +1,5 @@
+---
+title: Filter out pipelines that were excluded in the relation scope in Ci::Pipeline#latest_pipeline_per_commit
+merge_request: 55657
+author: Cong Chen @gentcys
+type: fixed
diff --git a/changelogs/unreleased/fix-gb-avoid-inflating-memory-when-aborting-pipelines.yml b/changelogs/unreleased/fix-gb-avoid-inflating-memory-when-aborting-pipelines.yml
new file mode 100644
index 00000000000..ab723b380c6
--- /dev/null
+++ b/changelogs/unreleased/fix-gb-avoid-inflating-memory-when-aborting-pipelines.yml
@@ -0,0 +1,5 @@
+---
+title: Avoid inflating Redis memory when aborting pipelines
+merge_request: 59018
+author:
+type: fixed
diff --git a/changelogs/unreleased/id-bump-devise-two-factor.yml b/changelogs/unreleased/id-bump-devise-two-factor.yml
new file mode 100644
index 00000000000..6a75991aaa4
--- /dev/null
+++ b/changelogs/unreleased/id-bump-devise-two-factor.yml
@@ -0,0 +1,5 @@
+---
+title: Bump devise-two-factor version
+merge_request: 58929
+author:
+type: other
diff --git a/changelogs/unreleased/issue-325836-fix-empty-line-after-let-it-be-api-helpers.yml b/changelogs/unreleased/issue-325836-fix-empty-line-after-let-it-be-api-helpers.yml
new file mode 100644
index 00000000000..68566e26cc8
--- /dev/null
+++ b/changelogs/unreleased/issue-325836-fix-empty-line-after-let-it-be-api-helpers.yml
@@ -0,0 +1,5 @@
+---
+title: Fix EmptyLineAfterFinalLetItBe Rubocop offenses for api helpers
+merge_request: 58194
+author: Huzaifa Iftikhar @huzaifaiftikhar
+type: fixed
diff --git a/changelogs/unreleased/issue-325836-fix-empty-line-after-let-it-be-gitlab-github-import.yml b/changelogs/unreleased/issue-325836-fix-empty-line-after-let-it-be-gitlab-github-import.yml
new file mode 100644
index 00000000000..fb0ece8309f
--- /dev/null
+++ b/changelogs/unreleased/issue-325836-fix-empty-line-after-let-it-be-gitlab-github-import.yml
@@ -0,0 +1,5 @@
+---
+title: Fix EmptyLineAfterFinalLetItBe offenses spec/lib/gitlab/github_import
+merge_request: 58256
+author: Huzaifa Iftikhar @huzaifaiftikhar
+type: fixed
diff --git a/changelogs/unreleased/issue-325836-fix-empty-line-after-let-it-be-gitlab-imoport-export.yml b/changelogs/unreleased/issue-325836-fix-empty-line-after-let-it-be-gitlab-imoport-export.yml
new file mode 100644
index 00000000000..fde96539c7b
--- /dev/null
+++ b/changelogs/unreleased/issue-325836-fix-empty-line-after-let-it-be-gitlab-imoport-export.yml
@@ -0,0 +1,5 @@
+---
+title: Fix EmptyLineAfterFinalLetItBe offenses spec/lib/gitlab/import_export
+merge_request: 58264
+author: Huzaifa Iftikhar @huzaifaiftikhar
+type: fixed
diff --git a/changelogs/unreleased/jonstonchan-fix-triggers-externalization.yml b/changelogs/unreleased/jonstonchan-fix-triggers-externalization.yml
new file mode 100644
index 00000000000..56f6127478b
--- /dev/null
+++ b/changelogs/unreleased/jonstonchan-fix-triggers-externalization.yml
@@ -0,0 +1,5 @@
+---
+title: Fix triggers page externalization
+merge_request: 57637
+author: Jonston Chan @JonstonChan
+type: other
diff --git a/changelogs/unreleased/optimize-query-for-cherry-picked-merge-requests.yml b/changelogs/unreleased/optimize-query-for-cherry-picked-merge-requests.yml
new file mode 100644
index 00000000000..a9921a886f6
--- /dev/null
+++ b/changelogs/unreleased/optimize-query-for-cherry-picked-merge-requests.yml
@@ -0,0 +1,5 @@
+---
+title: Optimize query for cherry picked merge requests
+merge_request: 58967
+author:
+type: performance
diff --git a/changelogs/unreleased/psi-dark-build.yml b/changelogs/unreleased/psi-dark-build.yml
new file mode 100644
index 00000000000..aece4a82cd8
--- /dev/null
+++ b/changelogs/unreleased/psi-dark-build.yml
@@ -0,0 +1,5 @@
+---
+title: Fix dark mode colors of retried jobs in job details page
+merge_request: 58855
+author:
+type: fixed
diff --git a/changelogs/unreleased/psi-dark-navbar.yml b/changelogs/unreleased/psi-dark-navbar.yml
new file mode 100644
index 00000000000..e20a9d0b818
--- /dev/null
+++ b/changelogs/unreleased/psi-dark-navbar.yml
@@ -0,0 +1,5 @@
+---
+title: Dark mode nav improvements
+merge_request: 58891
+author:
+type: fixed
diff --git a/changelogs/unreleased/psi-dark-select2.yml b/changelogs/unreleased/psi-dark-select2.yml
new file mode 100644
index 00000000000..90f9dc7edbe
--- /dev/null
+++ b/changelogs/unreleased/psi-dark-select2.yml
@@ -0,0 +1,5 @@
+---
+title: Fix select2 dropdowns in dark mode
+merge_request: 58862
+author:
+type: fixed
diff --git a/config/feature_flags/development/async_add_build_failure_todo.yml b/config/feature_flags/development/async_add_build_failure_todo.yml
index 6bb1a84ed82..3c1e056a50e 100644
--- a/config/feature_flags/development/async_add_build_failure_todo.yml
+++ b/config/feature_flags/development/async_add_build_failure_todo.yml
@@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/326726
milestone: '13.11'
type: development
group: group::continuous integration
-default_enabled: false
+default_enabled: true
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example
index c451ce6b872..da1a15302da 100644
--- a/config/gitlab.yml.example
+++ b/config/gitlab.yml.example
@@ -6,7 +6,7 @@
# This file should not receive new settings. All configuration options #
# * are being moved to ApplicationSetting model! #
# If a setting requires an application restart say so in that screen. #
-# If you change this file in a Merge Request, please also create #
+# If you change this file in a merge request, please also create #
# a MR on https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests. #
# For more details see https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/settings/gitlab.yml.md #
########################################################################
diff --git a/config/initializers/smtp_settings.rb.sample b/config/initializers/smtp_settings.rb.sample
index bd37080b1c8..babc0a81938 100644
--- a/config/initializers/smtp_settings.rb.sample
+++ b/config/initializers/smtp_settings.rb.sample
@@ -5,7 +5,7 @@
#
# For full list of options and their values see http://api.rubyonrails.org/classes/ActionMailer/Base.html
#
-# If you change this file in a Merge Request, please also create a Merge Request on https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests
+# If you change this file in a merge request, please also create a merge request on https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests
if Rails.env.production?
Rails.application.config.action_mailer.delivery_method = :smtp
diff --git a/config/metrics/counts_all/20210216180246_web_ide_merge_requests.yml b/config/metrics/counts_all/20210216180246_web_ide_merge_requests.yml
index 2df821ee8ad..d8ab29b3ef5 100644
--- a/config/metrics/counts_all/20210216180246_web_ide_merge_requests.yml
+++ b/config/metrics/counts_all/20210216180246_web_ide_merge_requests.yml
@@ -1,6 +1,6 @@
---
key_path: counts.web_ide_merge_requests
-description: Count of Merge Requests created from Web IDE
+description: Count of merge requests created from Web IDE
product_section: dev
product_stage: create
product_group: group::editor
diff --git a/config/redis.cache.yml.example b/config/redis.cache.yml.example
index fb92c205ce1..44d9f7e8632 100644
--- a/config/redis.cache.yml.example
+++ b/config/redis.cache.yml.example
@@ -1,5 +1,5 @@
-# If you change this file in a Merge Request, please also create
-# a Merge Request on https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests
+# If you change this file in a merge request, please also create
+# a merge request on https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests
#
development:
url: redis://localhost:6379/10
diff --git a/config/redis.queues.yml.example b/config/redis.queues.yml.example
index dd6c10e0e06..4194b44cb88 100644
--- a/config/redis.queues.yml.example
+++ b/config/redis.queues.yml.example
@@ -1,5 +1,5 @@
-# If you change this file in a Merge Request, please also create
-# a Merge Request on https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests
+# If you change this file in a merge request, please also create
+# a merge request on https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests
#
development:
url: redis://localhost:6379/11
diff --git a/config/redis.shared_state.yml.example b/config/redis.shared_state.yml.example
index 98f6f330bc7..b3e0c7a8fa9 100644
--- a/config/redis.shared_state.yml.example
+++ b/config/redis.shared_state.yml.example
@@ -1,5 +1,5 @@
-# If you change this file in a Merge Request, please also create
-# a Merge Request on https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests
+# If you change this file in a merge request, please also create
+# a merge request on https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests
#
development:
url: redis://localhost:6379/12
diff --git a/config/resque.yml.example b/config/resque.yml.example
index 0f629a5229c..656cd57a739 100644
--- a/config/resque.yml.example
+++ b/config/resque.yml.example
@@ -1,5 +1,5 @@
-# If you change this file in a Merge Request, please also create
-# a Merge Request on https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests
+# If you change this file in a merge request, please also create
+# a merge request on https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests
#
development:
url: redis://localhost:6379
diff --git a/config/unicorn.rb.example b/config/unicorn.rb.example
index 0e475249868..c930e2ff761 100644
--- a/config/unicorn.rb.example
+++ b/config/unicorn.rb.example
@@ -8,8 +8,8 @@
# See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete
# documentation.
-# Note: If you change this file in a Merge Request, please also create a
-# Merge Request on https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests
+# Note: If you change this file in a merge request, please also create a
+# merge request on https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests
# Relative URL support
# WARNING: We recommend using an FQDN to host GitLab in a root path instead
diff --git a/db/migrate/20210409084242_create_index_on_notes_for_cherry_picked_merge_requests.rb b/db/migrate/20210409084242_create_index_on_notes_for_cherry_picked_merge_requests.rb
new file mode 100644
index 00000000000..2bcdf4c8982
--- /dev/null
+++ b/db/migrate/20210409084242_create_index_on_notes_for_cherry_picked_merge_requests.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class CreateIndexOnNotesForCherryPickedMergeRequests < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+ NAME = 'index_notes_for_cherry_picked_merge_requests'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :notes, [:project_id, :commit_id], where: "((noteable_type)::text = 'MergeRequest'::text)", name: NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :notes, name: NAME
+ end
+end
diff --git a/db/post_migrate/20210330091751_remove_records_without_group_from_webhooks_table.rb b/db/post_migrate/20210330091751_remove_records_without_group_from_webhooks_table.rb
new file mode 100644
index 00000000000..c384aa25ac4
--- /dev/null
+++ b/db/post_migrate/20210330091751_remove_records_without_group_from_webhooks_table.rb
@@ -0,0 +1,30 @@
+# frozen_string_literal: true
+
+class RemoveRecordsWithoutGroupFromWebhooksTable < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ class WebHook < ActiveRecord::Base
+ include EachBatch
+
+ self.table_name = 'web_hooks'
+ end
+
+ class Group < ActiveRecord::Base
+ self.inheritance_column = :_type_disabled
+ self.table_name = 'namespaces'
+ end
+
+ def up
+ subquery = Group.select(1).where(Group.arel_table[:id].eq(WebHook.arel_table[:group_id]))
+
+ WebHook.each_batch(of: 500, column: :id) do |relation|
+ relation.where(type: 'GroupHook').where.not('EXISTS (?)', subquery).delete_all
+ end
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/schema_migrations/20210330091751 b/db/schema_migrations/20210330091751
new file mode 100644
index 00000000000..0536252e980
--- /dev/null
+++ b/db/schema_migrations/20210330091751
@@ -0,0 +1 @@
+3a195b9671846409cf6665b13caad9713541d9cdd95c9f246c22b7db225ab02c
\ No newline at end of file
diff --git a/db/schema_migrations/20210409084242 b/db/schema_migrations/20210409084242
new file mode 100644
index 00000000000..2d932018355
--- /dev/null
+++ b/db/schema_migrations/20210409084242
@@ -0,0 +1 @@
+6bd35117ca922fc0d9cb8cbd9b0e6d5d9216457182d5679e705c1f03eef05921
\ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index a553b47ff84..94779cafdc3 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -23207,6 +23207,8 @@ CREATE INDEX index_non_requested_project_members_on_source_id_and_type ON member
CREATE UNIQUE INDEX index_note_diff_files_on_diff_note_id ON note_diff_files USING btree (diff_note_id);
+CREATE INDEX index_notes_for_cherry_picked_merge_requests ON notes USING btree (project_id, commit_id) WHERE ((noteable_type)::text = 'MergeRequest'::text);
+
CREATE INDEX index_notes_on_author_id_and_created_at_and_id ON notes USING btree (author_id, created_at, id);
CREATE INDEX index_notes_on_commit_id ON notes USING btree (commit_id);
diff --git a/doc/api/jobs.md b/doc/api/jobs.md
index fbcdc3f106c..a19dbecb430 100644
--- a/doc/api/jobs.md
+++ b/doc/api/jobs.md
@@ -295,7 +295,8 @@ In GitLab 13.3 and later, this endpoint [returns data for any pipeline](pipeline
including [child pipelines](../ci/parent_child_pipelines.md).
In GitLab 13.5 and later, this endpoint does not return retried jobs in the response
-by default.
+by default. Additionally, jobs are sorted by ID in ascending order (oldest first).
+In earlier GitLab versions, jobs are sorted by ID in descending order (newest first).
In GitLab 13.9 and later, this endpoint can include retried jobs in the response
with `include_retried` set to `true`.
diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md
index 4873385d808..17f52cea50b 100644
--- a/doc/ci/yaml/README.md
+++ b/doc/ci/yaml/README.md
@@ -250,8 +250,41 @@ workflow:
- if: $CI_COMMIT_REF_NAME =~ /feature/
variables:
IS_A_FEATURE: "true" # Define a new variable.
+ - when: always # Run the pipeline in other cases
+
+job1:
+ variables:
+ DEPLOY_VARIABLE: "job1-default-deploy"
+ rules:
+ - if: $CI_COMMIT_REF_NAME =~ /master/
+ variables: # Override DEPLOY_VARIABLE defined
+ DEPLOY_VARIABLE: "job1-deploy-production" # at the job level.
+ - when: on_success # Run the job in other cases
+ script:
+ - echo "Run script with $DEPLOY_VARIABLE as an argument"
+ - echo "Run another script if $IS_A_FEATURE exists"
+
+job2:
+ script:
+ - echo "Run script with $DEPLOY_VARIABLE as an argument"
+ - echo "Run another script if $IS_A_FEATURE exists"
```
+When the branch is `master`:
+
+- job1's `DEPLOY_VARIABLE` is `job1-deploy-production`.
+- job2's `DEPLOY_VARIABLE` is `deploy-production`.
+
+When the branch is `feature`:
+
+- job1's `DEPLOY_VARIABLE` is `job1-default-deploy`, and `IS_A_FEATURE` is `true`.
+- job2's `DEPLOY_VARIABLE` is `default-deploy`, and `IS_A_FEATURE` is `true`.
+
+When the branch is something else:
+
+- job1's `DEPLOY_VARIABLE` is `job1-default-deploy`.
+- job2's `DEPLOY_VARIABLE` is `default-deploy`.
+
##### Enable or disable workflow:rules:variables **(CORE ONLY)**
rules:variables is under development and not ready for production use.
diff --git a/doc/development/merge_request_performance_guidelines.md b/doc/development/merge_request_performance_guidelines.md
index 772ce1d6b59..0f696d39092 100644
--- a/doc/development/merge_request_performance_guidelines.md
+++ b/doc/development/merge_request_performance_guidelines.md
@@ -158,6 +158,27 @@ objects_to_update.update_all(some_field: some_value)
This uses ActiveRecord's `update_all` method to update all rows in a single
query. This in turn makes it much harder for this code to overload a database.
+## Use read replicas when possible
+
+In a DB cluster we have many read replicas and one primary. A classic use of scaling the DB is to have read-only actions be performed by the replicas. We use [load balancing](../administration/database_load_balancing.md) to distribute this load. This allows for the replicas to grow as the pressure on the DB grows.
+
+By default, queries use read-only replicas, but due to [primary sticking](../administration/database_load_balancing.md#primary-sticking), GitLab sticks to using the primary for a certain period of time and reverts back to secondaries after they have either caught up or after 30 seconds, which can lead to a considerable amount of unnecessary load on the primary. In this [merge request](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56849) we introduced the `without_sticky_writes` block to prevent switching to the primary. This [merge request example](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/57328) provides a good use case for when queries can stick to the primary and how to prevent this by using `without_sticky_writes`.
+
+Internally, our database load balancer classifies the queries based on their main statement (`select`, `update`, `delete`, etc.). When in doubt, it redirects the queries to the primary database. Hence, there are some common cases the load balancer sends the queries to the primary unnecessarily:
+
+- Custom queries (via `exec_query`, `execute_statement`, `execute`, etc.)
+- Read-only transactions
+- In-flight connection configuration set
+- Sidekiq background jobs
+
+Worse, after the above queries are executed, GitLab [sticks to the primary](../administration/database_load_balancing.md#primary-sticking). In [this merge request](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56476), we introduced `use_replica_if_possible` to make the inside queries prefer to use the replicas. That MR is also an example how we redirected a costly, time-consuming query to the replicas.
+
+## Use CTEs wisely
+
+Read about [complex queries on the relation object](iterating_tables_in_batches.md#complex-queries-on-the-relation-object) for considerations on how to use CTEs. We have found in some situations that CTEs can become problematic in use (similar to the n+1 problem above). In particular, hierarchical recursive CTE queries such as the CTE in [AuthorizedProjectsWorker](https://gitlab.com/gitlab-org/gitlab/-/issues/325688) are very difficult to optimize and don't scale. We should avoid them when implementing new features that require any kind of hierarchical structure.
+
+However, in many simpler cases, such as this [example](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/43242#note_61416277), CTEs can be quite effective as an optimization fence.
+
## Cached Queries
**Summary:** a merge request **should not** execute duplicated cached queries.
diff --git a/doc/development/usage_ping/dictionary.md b/doc/development/usage_ping/dictionary.md
index 67466a607cf..4709c18fcbe 100644
--- a/doc/development/usage_ping/dictionary.md
+++ b/doc/development/usage_ping/dictionary.md
@@ -5986,7 +5986,7 @@ Tiers: `free`, `premium`, `ultimate`
### `counts.web_ide_merge_requests`
-Count of Merge Requests created from Web IDE
+Count of merge requests created from Web IDE
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216180246_web_ide_merge_requests.yml)
diff --git a/doc/user/project/settings/import_export.md b/doc/user/project/settings/import_export.md
index 7b5a0cbb377..6fa1b0aa368 100644
--- a/doc/user/project/settings/import_export.md
+++ b/doc/user/project/settings/import_export.md
@@ -39,8 +39,8 @@ Note the following:
The Importing GitLab version must be greater than or equal to the Exporting GitLab version.
- Imports will fail unless the import and export GitLab instances are
compatible as described in the [Version history](#version-history).
-- Exports are stored in a temporary [shared directory](../../../development/shared_files.md)
- and are deleted every 24 hours by a specific worker.
+- Exports are generated in your configured `shared_path`, a temporary [shared directory](../../../development/shared_files.md)
+ and are moved to your configured `uploads_directory`. Every 24 hours, a specific worker deletes these export files.
- Group members are exported as project members, as long as the user has
maintainer or administrator access to the group where the exported project lives.
- Project members with owner access will be imported as maintainers.
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 2c173ea73a8..aa62ceb14f8 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -2019,6 +2019,9 @@ msgstr ""
msgid "Add to tree"
msgstr ""
+msgid "Add trigger"
+msgstr ""
+
msgid "Add user(s) to the group:"
msgstr ""
@@ -4480,6 +4483,9 @@ msgstr ""
msgid "Authorization required"
msgstr ""
+msgid "Authorization token duration (minutes)"
+msgstr ""
+
msgid "Authorization was granted by entering your username and password in the application."
msgstr ""
@@ -16152,6 +16158,9 @@ msgstr ""
msgid "In case of pull mirroring, your user will be the author of all events in the activity feed that are the result of an update, like new branches being created or new commits being pushed to existing branches."
msgstr ""
+msgid "In each example, replace %{code_start}TOKEN%{code_end} with the trigger token you generated and replace %{code_start}REF_NAME%{code_end} with the branch or tag name."
+msgstr ""
+
msgid "In progress"
msgstr ""
@@ -18424,10 +18433,7 @@ msgstr ""
msgid "LearnGitLab|Route code reviews to the right reviewers, every time."
msgstr ""
-msgid "LearnGitLab|Run a Security scan"
-msgstr ""
-
-msgid "LearnGitLab|Run a security scan"
+msgid "LearnGitLab|Run a Security scan using CI/CD"
msgstr ""
msgid "LearnGitLab|Save time by automating your integration and deployment tasks."
@@ -18463,6 +18469,9 @@ msgstr ""
msgid "LearnGitLab|Use your new GitLab workflow to deploy your application, monitor its health, and keep it secure:"
msgstr ""
+msgid "LearnGitlab|Trial only"
+msgstr ""
+
msgid "Leave"
msgstr ""
@@ -32381,6 +32390,9 @@ msgstr ""
msgid "To open Jaeger from GitLab to view tracing from the %{link} page, add a URL to your Jaeger server."
msgstr ""
+msgid "To pass variables to the triggered pipeline, add %{code_start}variables[VARIABLE]=VALUE%{code_end} to the API request."
+msgstr ""
+
msgid "To personalize your GitLab experience, we'd like to know a bit more about you. We won't share this information with anyone."
msgstr ""
@@ -32767,12 +32779,6 @@ msgstr ""
msgid "Triggerer"
msgstr ""
-msgid "Triggers|In each example, replace %{code_start}TOKEN%{code_end} with the trigger token you generated and replace %{code_start}REF_NAME%{code_end} with the branch or tag name."
-msgstr ""
-
-msgid "Triggers|To pass variables to the triggered pipeline, add %{code_start}variables[VARIABLE]=VALUE%{code_end} to the API request."
-msgstr ""
-
msgid "Troubleshoot and monitor your application with tracing"
msgstr ""
diff --git a/spec/frontend/issuable_show/mock_data.js b/spec/frontend/issuable_show/mock_data.js
index 9ecff705617..986d32b4982 100644
--- a/spec/frontend/issuable_show/mock_data.js
+++ b/spec/frontend/issuable_show/mock_data.js
@@ -32,6 +32,7 @@ export const mockIssuableShowProps = {
editFormVisible: false,
enableAutocomplete: true,
enableAutosave: true,
+ enableZenMode: true,
enableTaskList: true,
enableEdit: true,
showFieldTitle: false,
diff --git a/spec/frontend/pages/projects/learn_gitlab/components/__snapshots__/learn_gitlab_a_spec.js.snap b/spec/frontend/pages/projects/learn_gitlab/components/__snapshots__/learn_gitlab_a_spec.js.snap
index 1c1327e7a4e..cecaa3fc365 100644
--- a/spec/frontend/pages/projects/learn_gitlab/components/__snapshots__/learn_gitlab_a_spec.js.snap
+++ b/spec/frontend/pages/projects/learn_gitlab/components/__snapshots__/learn_gitlab_a_spec.js.snap
@@ -1,70 +1,308 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`Learn GitLab Design A should render the loading state 1`] = `
-- Start a free Ultimate trial -
+ 25% completed +
+ ++ Complete these tasks first so you can enjoy GitLab's features to their fullest: +
++ Create a workflow for your new workspace, and learn how GitLab features work together: +
++ Use your new GitLab workflow to deploy your application, monitor its health, and keep it secure: +
+
- Run a Security scan
+ Run a Security scan using CI/CD
diff --git a/spec/frontend/pages/projects/learn_gitlab/components/__snapshots__/learn_gitlab_section_card_spec.js.snap b/spec/frontend/pages/projects/learn_gitlab/components/__snapshots__/learn_gitlab_section_card_spec.js.snap
new file mode 100644
index 00000000000..831c027cd66
--- /dev/null
+++ b/spec/frontend/pages/projects/learn_gitlab/components/__snapshots__/learn_gitlab_section_card_spec.js.snap
@@ -0,0 +1,63 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`Learn GitLab Section Card renders correctly 1`] = `
+
+ Complete these tasks first so you can enjoy GitLab's features to their fullest:
+
+ Set up your workspace
+
+
+