Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-10-05 00:09:27 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-10-05 00:09:27 +0300
commit8c6c2136e8cf8d0a857e587c36448db86965d146 (patch)
tree760c57fb2f4f0ed7f37d42a30ba4eebb1c7aa65e
parent8a0a54ab92c509c6b480059a5f2730869c99d454 (diff)
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--.gitlab/CODEOWNERS28
-rw-r--r--.gitlab/ci/frontend.gitlab-ci.yml2
-rw-r--r--app/assets/javascripts/environments/folder/environments_folder_bundle.js2
-rw-r--r--app/graphql/mutations/issues/create.rb5
-rw-r--r--app/helpers/issuables_helper.rb2
-rw-r--r--app/models/ci/processable.rb3
-rw-r--r--app/services/base_project_service.rb10
-rw-r--r--app/views/shared/issuable/_nav.html.haml24
-rw-r--r--app/views/shared/issuable/nav_links/_all.html.haml5
-rw-r--r--config/initializers/load_balancing.rb4
-rw-r--r--db/migrate/20210923151641_change_default_for_integrated_error_tracking.rb11
-rw-r--r--db/post_migrate/20210923135909_remove_delayed_project_removal_from_namespaces.rb19
-rw-r--r--db/schema_migrations/202109231359091
-rw-r--r--db/schema_migrations/202109231516411
-rw-r--r--db/structure.sql7
-rw-r--r--doc/administration/packages/container_registry.md5
-rw-r--r--doc/api/graphql/reference/index.md11
-rw-r--r--doc/ci/resource_groups/index.md57
-rw-r--r--doc/user/clusters/agent/index.md16
-rw-r--r--doc/user/packages/container_registry/index.md8
-rw-r--r--locale/gitlab.pot9
-rw-r--r--qa/qa/specs/features/browser_ui/5_package/maven_repository_spec.rb6
-rw-r--r--qa/qa/support/formatters/test_stats_formatter.rb6
-rw-r--r--qa/qa/tools/delete_subgroups.rb28
-rw-r--r--spec/factories/project_error_tracking_settings.rb1
-rw-r--r--spec/features/dashboard/issuables_counter_spec.rb2
-rw-r--r--spec/features/projects/settings/monitor_settings_spec.rb6
-rw-r--r--spec/helpers/issuables_helper_spec.rb12
-rw-r--r--spec/models/ci/processable_spec.rb9
-rw-r--r--spec/services/projects/operations/update_service_spec.rb8
30 files changed, 183 insertions, 125 deletions
diff --git a/.gitlab/CODEOWNERS b/.gitlab/CODEOWNERS
index cd6aec3f9ea..c277d52f5b0 100644
--- a/.gitlab/CODEOWNERS
+++ b/.gitlab/CODEOWNERS
@@ -11,39 +11,39 @@
/doc/.markdownlint @marcel.amirault @eread @aqualls @cnorris
/doc/ @gl-docsteam
/doc/.vale/ @marcel.amirault @eread @aqualls @cnorris
-/doc/administration/geo/ @axil
+/doc/administration/geo/ @marcel.amirault
/doc/administration/gitaly/ @eread
/doc/administration/lfs/ @aqualls
/doc/administration/monitoring/ @ngaskill
-/doc/administration/operations/ @axil @eread @marcia
+/doc/administration/operations/ @marcel.amirault @eread @marcia
/doc/administration/packages/ @ngaskill
-/doc/administration/pages/ @axil @kpaizee
+/doc/administration/pages/ @rdickenson @kpaizee
/doc/administration/postgresql/ @marcia
-/doc/administration/raketasks/ @axil @eread
-/doc/administration/redis/ @axil
-/doc/administration/reference_architectures/ @axil
+/doc/administration/raketasks/ @marcel.amirault @eread
+/doc/administration/redis/ @marcel.amirault
+/doc/administration/reference_architectures/ @marcel.amirault
/doc/administration/snippets/ @aqualls
-/doc/administration/troubleshooting @axil @marcia @eread
+/doc/administration/troubleshooting @marcel.amirault @marcia @eread
/doc/api/graphql/ @msedlakjakubowski @kpaizee
/doc/api/graphql/reference/ @kpaizee
/doc/api/group_activity_analytics.md @msedlakjakubowski
/doc/ci/ @marcel.amirault @sselhorn
-/doc/ci/environments/ @axil
+/doc/ci/environments/ @rdickenson
/doc/ci/services/ @sselhorn
/doc/ci/test_cases/ @msedlakjakubowski
/doc/development/ @marcia
-/doc/development/documentation/ @cnorris
+/doc/development/documentation/ @cnorris @dianalogan
/doc/development/i18n/ @ngaskill
/doc/development/value_stream_analytics.md @msedlakjakubowski
/doc/gitlab-basics/ @aqualls
-/doc/install/ @axil
-/doc/operations/ @ngaskill @axil
+/doc/install/ @marcel.amirault
+/doc/operations/ @ngaskill @rdickenson
/doc/push_rules/ @aqualls
/doc/ssh/ @eread
/doc/subscriptions/ @sselhorn
/doc/topics/autodevops/ @marcia
/doc/topics/git/ @aqualls
-/doc/update/ @axil @marcia
+/doc/update/ @marcel.amirault @marcia
/doc/user/analytics/ @msedlakjakubowski @ngaskill
/doc/user/application_security/ @rdickenson
/doc/user/application_security/container_scanning/ @ngaskill
@@ -62,13 +62,13 @@
/doc/user/packages/infrastructure_registry/ @marcia
/doc/user/packages/terraform_module_registry/ @marcia
/doc/user/profile/ @msedlakjakubowski @eread
-/doc/user/project/ @aqualls @axil @eread @msedlakjakubowski @ngaskill
+/doc/user/project/ @aqualls @rdickenson @eread @msedlakjakubowski @ngaskill
/doc/user/project/clusters/ @marcia
/doc/user/project/import/ @ngaskill @msedlakjakubowski
/doc/user/project/issues/ @msedlakjakubowski
/doc/user/project/merge_requests/ @aqualls @eread
/doc/user/project/milestones/ @msedlakjakubowski
-/doc/user/project/pages/ @axil
+/doc/user/project/pages/ @rdickenson
/doc/user/project/repository/ @aqualls
/doc/user/project/settings/ @aqualls @eread
/doc/user/project/static_site_editor/index.md @aqualls
diff --git a/.gitlab/ci/frontend.gitlab-ci.yml b/.gitlab/ci/frontend.gitlab-ci.yml
index eba4bf077ba..9931f005088 100644
--- a/.gitlab/ci/frontend.gitlab-ci.yml
+++ b/.gitlab/ci/frontend.gitlab-ci.yml
@@ -115,8 +115,6 @@ update-storybook-yarn-cache:
needs: ["setup-test-env", "retrieve-tests-metadata", "compile-test-assets"]
variables:
WEBPACK_VENDOR_DLL: "true"
- GITLAB_NO_AR_DB_PREPEND_LOAD_BALANCING: "true"
- GITLAB_USE_PREPARED_STATEMENTS: "true"
script:
- run_timed_command "gem install knapsack --no-document"
- run_timed_command "scripts/gitaly-test-spawn"
diff --git a/app/assets/javascripts/environments/folder/environments_folder_bundle.js b/app/assets/javascripts/environments/folder/environments_folder_bundle.js
index 206381e0b7e..f248e9ec079 100644
--- a/app/assets/javascripts/environments/folder/environments_folder_bundle.js
+++ b/app/assets/javascripts/environments/folder/environments_folder_bundle.js
@@ -8,7 +8,7 @@ Vue.use(Translate);
Vue.use(VueApollo);
const apolloProvider = new VueApollo({
- defaultClient: createDefaultClient(),
+ defaultClient: createDefaultClient({}, { assumeImmutableResults: true }),
});
export default () => {
diff --git a/app/graphql/mutations/issues/create.rb b/app/graphql/mutations/issues/create.rb
index 70a8f539ccf..32f96f1bfe6 100644
--- a/app/graphql/mutations/issues/create.rb
+++ b/app/graphql/mutations/issues/create.rb
@@ -71,7 +71,7 @@ module Mutations
def resolve(project_path:, **attributes)
project = authorized_find!(project_path)
- params = build_create_issue_params(attributes.merge(author_id: current_user.id), project)
+ params = build_create_issue_params(attributes.merge(author_id: current_user.id))
spam_params = ::Spam::SpamParams.new_from_request(request: context[:request])
issue = ::Issues::CreateService.new(project: project, current_user: current_user, params: params, spam_params: spam_params).execute
@@ -88,8 +88,7 @@ module Mutations
private
- # _project argument is unused here, but it is necessary on the EE version of the method
- def build_create_issue_params(params, _project)
+ def build_create_issue_params(params)
params[:milestone_id] &&= params[:milestone_id]&.model_id
params[:assignee_ids] &&= params[:assignee_ids].map { |assignee_id| assignee_id&.model_id }
params[:label_ids] &&= params[:label_ids].map { |label_id| label_id&.model_id }
diff --git a/app/helpers/issuables_helper.rb b/app/helpers/issuables_helper.rb
index f3cc46216e5..24c6ef8cd68 100644
--- a/app/helpers/issuables_helper.rb
+++ b/app/helpers/issuables_helper.rb
@@ -198,7 +198,7 @@ module IssuablesHelper
if count != -1
html << " " << content_tag(:span,
format_count(issuable_type, count, Gitlab::IssuablesCountForState::THRESHOLD),
- class: 'badge badge-muted badge-pill gl-badge gl-tab-counter-badge sm'
+ class: 'badge badge-muted badge-pill gl-badge gl-tab-counter-badge sm gl-display-none gl-sm-display-inline-flex'
)
end
diff --git a/app/models/ci/processable.rb b/app/models/ci/processable.rb
index 30d335fd7d5..372df8cc264 100644
--- a/app/models/ci/processable.rb
+++ b/app/models/ci/processable.rb
@@ -58,7 +58,8 @@ module Ci
after_transition any => ::Ci::Processable.completed_statuses do |processable|
next unless processable.with_resource_group?
- next unless processable.resource_group.release_resource_from(processable)
+
+ processable.resource_group.release_resource_from(processable)
processable.run_after_commit do
Ci::ResourceGroups::AssignResourceFromResourceGroupWorker
diff --git a/app/services/base_project_service.rb b/app/services/base_project_service.rb
index 1bf4a235a79..fb466e61673 100644
--- a/app/services/base_project_service.rb
+++ b/app/services/base_project_service.rb
@@ -2,8 +2,6 @@
# Base class, scoped by project
class BaseProjectService < ::BaseContainerService
- include ::Gitlab::Utils::StrongMemoize
-
attr_accessor :project
def initialize(project:, current_user: nil, params: {})
@@ -13,12 +11,4 @@ class BaseProjectService < ::BaseContainerService
end
delegate :repository, to: :project
-
- private
-
- def project_group
- strong_memoize(:project_group) do
- project.group
- end
- end
end
diff --git a/app/views/shared/issuable/_nav.html.haml b/app/views/shared/issuable/_nav.html.haml
index cff50eef88b..4a33f625347 100644
--- a/app/views/shared/issuable/_nav.html.haml
+++ b/app/views/shared/issuable/_nav.html.haml
@@ -2,22 +2,16 @@
- page_context_word = type.to_s.humanize(capitalize: false)
- display_count = local_assigns.fetch(:display_count, true)
-%ul.nav-links.issues-state-filters.mobile-separator.nav.nav-tabs
- %li{ class: active_when(params[:state] == 'opened') }>
- = link_to page_filter_path(state: 'opened'), id: 'state-opened', title: _("Filter by %{page_context_word} that are currently open.") % { page_context_word: page_context_word }, data: { state: 'opened' } do
- #{issuables_state_counter_text(type, :opened, display_count)}
-
+= gl_tabs_nav({ class: 'issues-state-filters gl-border-b-0 gl-flex-grow-1' }) do
+ = gl_tab_link_to page_filter_path(state: 'opened'), { item_active: params[:state] == 'opened', id: 'state-opened', title: _("Filter by %{page_context_word} that are currently open.") % { page_context_word: page_context_word }, data: { state: 'opened' } } do
+ #{issuables_state_counter_text(type, :opened, display_count)}
- if type == :merge_requests
- %li{ class: active_when(params[:state] == 'merged') }>
- = link_to page_filter_path(state: 'merged'), id: 'state-merged', title: _('Filter by merge requests that are currently merged.'), data: { state: 'merged' } do
- #{issuables_state_counter_text(type, :merged, display_count)}
-
- %li{ class: active_when(params[:state] == 'closed') }>
- = link_to page_filter_path(state: 'closed'), id: 'state-closed', title: _('Filter by merge requests that are currently closed and unmerged.'), data: { state: 'closed' } do
- #{issuables_state_counter_text(type, :closed, display_count)}
+ = gl_tab_link_to page_filter_path(state: 'merged'), item_active: params[:state] == 'merged', id: 'state-merged', title: _('Filter by merge requests that are currently merged.'), data: { state: 'merged' } do
+ #{issuables_state_counter_text(type, :merged, display_count)}
+ = gl_tab_link_to page_filter_path(state: 'closed'), item_active: params[:state] == 'closed', id: 'state-closed', title: _('Filter by merge requests that are currently closed and unmerged.'), data: { state: 'closed' } do
+ #{issuables_state_counter_text(type, :closed, display_count)}
- else
- %li{ class: active_when(params[:state] == 'closed') }>
- = link_to page_filter_path(state: 'closed'), id: 'state-closed', title: _('Filter by issues that are currently closed.'), data: { state: 'closed', qa_selector: 'closed_issues_link' } do
- #{issuables_state_counter_text(type, :closed, display_count)}
+ = gl_tab_link_to page_filter_path(state: 'closed'), item_active: params[:state] == 'closed', id: 'state-closed', title: _('Filter by issues that are currently closed.'), data: { state: 'closed', qa_selector: 'closed_issues_link' } do
+ #{issuables_state_counter_text(type, :closed, display_count)}
= render 'shared/issuable/nav_links/all', page_context_word: page_context_word, counter: issuables_state_counter_text(type, :all, display_count)
diff --git a/app/views/shared/issuable/nav_links/_all.html.haml b/app/views/shared/issuable/nav_links/_all.html.haml
index c92a50bcb70..7afa194d5db 100644
--- a/app/views/shared/issuable/nav_links/_all.html.haml
+++ b/app/views/shared/issuable/nav_links/_all.html.haml
@@ -1,6 +1,5 @@
- page_context_word = local_assigns.fetch(:page_context_word)
- counter = local_assigns.fetch(:counter)
-%li{ class: active_when(params[:state] == 'all') }>
- = link_to page_filter_path(state: 'all'), id: 'state-all', title: "Show all #{page_context_word}.", data: { state: 'all' } do
- #{counter}
+= gl_tab_link_to page_filter_path(state: 'all'), item_active: params[:state] == 'all', id: 'state-all', title: _("Show all %{issuable_type}.") % { issuable_type: page_context_word }, data: { state: 'all' } do
+ #{counter}
diff --git a/config/initializers/load_balancing.rb b/config/initializers/load_balancing.rb
index b696eafd4e8..29700b37c7d 100644
--- a/config/initializers/load_balancing.rb
+++ b/config/initializers/load_balancing.rb
@@ -2,7 +2,7 @@
ActiveRecord::Base.singleton_class.attr_accessor :load_balancing_proxy
-Gitlab::Database.main.disable_prepared_statements unless ENV['GITLAB_USE_PREPARED_STATEMENTS'] == 'true'
+Gitlab::Database.main.disable_prepared_statements
Gitlab::Application.configure do |config|
config.middleware.use(Gitlab::Database::LoadBalancing::RackMiddleware)
@@ -11,7 +11,7 @@ end
# This hijacks the "connection" method to ensure both
# `ActiveRecord::Base.connection` and all models use the same load
# balancing proxy.
-ActiveRecord::Base.singleton_class.prepend(Gitlab::Database::LoadBalancing::ActiveRecordProxy) unless ENV['GITLAB_NO_AR_DB_PREPEND_LOAD_BALANCING'] == 'true'
+ActiveRecord::Base.singleton_class.prepend(Gitlab::Database::LoadBalancing::ActiveRecordProxy)
# The load balancer needs to be configured immediately, and re-configured after
# forking. This ensures queries that run before forking use the load balancer,
diff --git a/db/migrate/20210923151641_change_default_for_integrated_error_tracking.rb b/db/migrate/20210923151641_change_default_for_integrated_error_tracking.rb
new file mode 100644
index 00000000000..fc4cc1945f3
--- /dev/null
+++ b/db/migrate/20210923151641_change_default_for_integrated_error_tracking.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class ChangeDefaultForIntegratedErrorTracking < Gitlab::Database::Migration[1.0]
+ def up
+ change_column_default :project_error_tracking_settings, :integrated, from: false, to: true
+ end
+
+ def down
+ change_column_default :project_error_tracking_settings, :integrated, from: true, to: false
+ end
+end
diff --git a/db/post_migrate/20210923135909_remove_delayed_project_removal_from_namespaces.rb b/db/post_migrate/20210923135909_remove_delayed_project_removal_from_namespaces.rb
new file mode 100644
index 00000000000..531410a91d9
--- /dev/null
+++ b/db/post_migrate/20210923135909_remove_delayed_project_removal_from_namespaces.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class RemoveDelayedProjectRemovalFromNamespaces < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ def up
+ with_lock_retries do
+ remove_column :namespaces, :delayed_project_removal
+ end
+ end
+
+ def down
+ with_lock_retries do
+ add_column :namespaces, :delayed_project_removal, :boolean, default: false, null: false, if_not_exists: true # rubocop:disable Migration/AddColumnsToWideTables
+ end
+
+ add_concurrent_index :namespaces, :id, name: 'tmp_idx_on_namespaces_delayed_project_removal', where: 'delayed_project_removal = TRUE'
+ end
+end
diff --git a/db/schema_migrations/20210923135909 b/db/schema_migrations/20210923135909
new file mode 100644
index 00000000000..b7b1ecc6bf2
--- /dev/null
+++ b/db/schema_migrations/20210923135909
@@ -0,0 +1 @@
+2afb8292fcdf9a56c11d9404275ffecfde4b2a474e733e3e19f4db62c628aa6c \ No newline at end of file
diff --git a/db/schema_migrations/20210923151641 b/db/schema_migrations/20210923151641
new file mode 100644
index 00000000000..bd38d8c6a28
--- /dev/null
+++ b/db/schema_migrations/20210923151641
@@ -0,0 +1 @@
+30c135ab62a57208160dd0949d6615f42af39117e25769d70a9658de5417b7e4 \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index 9506bc96f01..54704711f0c 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -16180,8 +16180,7 @@ CREATE TABLE namespaces (
push_rule_id bigint,
shared_runners_enabled boolean DEFAULT true NOT NULL,
allow_descendants_override_disabled_shared_runners boolean DEFAULT false NOT NULL,
- traversal_ids integer[] DEFAULT '{}'::integer[] NOT NULL,
- delayed_project_removal boolean DEFAULT false NOT NULL
+ traversal_ids integer[] DEFAULT '{}'::integer[] NOT NULL
);
CREATE SEQUENCE namespaces_id_seq
@@ -17829,7 +17828,7 @@ CREATE TABLE project_error_tracking_settings (
encrypted_token_iv character varying,
project_name character varying,
organization_name character varying,
- integrated boolean DEFAULT false NOT NULL
+ integrated boolean DEFAULT true NOT NULL
);
CREATE TABLE project_export_jobs (
@@ -26923,8 +26922,6 @@ CREATE UNIQUE INDEX term_agreements_unique_index ON term_agreements USING btree
CREATE INDEX tmp_idx_deduplicate_vulnerability_occurrences ON vulnerability_occurrences USING btree (project_id, report_type, location_fingerprint, primary_identifier_id, id);
-CREATE INDEX tmp_idx_on_namespaces_delayed_project_removal ON namespaces USING btree (id) WHERE (delayed_project_removal = true);
-
CREATE INDEX tmp_index_namespaces_empty_traversal_ids_with_child_namespaces ON namespaces USING btree (id) WHERE ((parent_id IS NOT NULL) AND (traversal_ids = '{}'::integer[]));
CREATE INDEX tmp_index_namespaces_empty_traversal_ids_with_root_namespaces ON namespaces USING btree (id) WHERE ((parent_id IS NULL) AND (traversal_ids = '{}'::integer[]));
diff --git a/doc/administration/packages/container_registry.md b/doc/administration/packages/container_registry.md
index 8c6adcee055..7e711bb5740 100644
--- a/doc/administration/packages/container_registry.md
+++ b/doc/administration/packages/container_registry.md
@@ -119,6 +119,11 @@ GitLab from source respectively.
Ensure you choose a port different than the one that Registry listens to (`5000` by default),
otherwise conflicts occur.
+NOTE:
+Host and container firewall rules must be configured to allow traffic in through the port listed
+under the `registry_external_url` line, rather than the port listed under
+`gitlab_rails['registry_port']` (default `5000`).
+
**Omnibus GitLab installations**
1. Your `/etc/gitlab/gitlab.rb` should contain the Registry URL as well as the
diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md
index 7be0a27350b..f7f2a4b5aef 100644
--- a/doc/api/graphql/reference/index.md
+++ b/doc/api/graphql/reference/index.md
@@ -1267,9 +1267,6 @@ Input type: `CreateIssueInput`
| <a id="mutationcreateissueepicid"></a>`epicId` | [`EpicID`](#epicid) | ID of an epic to associate the issue with. |
| <a id="mutationcreateissuehealthstatus"></a>`healthStatus` | [`HealthStatus`](#healthstatus) | Desired health status. |
| <a id="mutationcreateissueiid"></a>`iid` | [`Int`](#int) | IID (internal ID) of a project issue. Only admins and project owners can modify. |
-| <a id="mutationcreateissueiterationcadenceid"></a>`iterationCadenceId` | [`IterationsCadenceID`](#iterationscadenceid) | Global iteration cadence ID. Required when `iterationWildcardId` is provided. |
-| <a id="mutationcreateissueiterationid"></a>`iterationId` | [`IterationID`](#iterationid) | Global iteration ID. Mutually exlusive argument with `iterationWildcardId`. |
-| <a id="mutationcreateissueiterationwildcardid"></a>`iterationWildcardId` | [`IssueCreationIterationWildcardId`](#issuecreationiterationwildcardid) | Iteration wildcard ID. Supported values are: `CURRENT`. Mutually exclusive argument with `iterationId`. iterationCadenceId also required when this argument is provided. |
| <a id="mutationcreateissuelabelids"></a>`labelIds` | [`[LabelID!]`](#labelid) | IDs of labels to be added to the issue. |
| <a id="mutationcreateissuelabels"></a>`labels` | [`[String!]`](#string) | Labels of the issue. |
| <a id="mutationcreateissuelocked"></a>`locked` | [`Boolean`](#boolean) | Indicates discussion is locked on the issue. |
@@ -15815,14 +15812,6 @@ State of a GitLab issue or merge request.
| <a id="issuablestatelocked"></a>`locked` | Discussion has been locked. |
| <a id="issuablestateopened"></a>`opened` | In open state. |
-### `IssueCreationIterationWildcardId`
-
-Iteration ID wildcard values for issue creation.
-
-| Value | Description |
-| ----- | ----------- |
-| <a id="issuecreationiterationwildcardidcurrent"></a>`CURRENT` | Current iteration. |
-
### `IssueSort`
Values for sorting issues.
diff --git a/doc/ci/resource_groups/index.md b/doc/ci/resource_groups/index.md
index e5ff919a70c..06b715efc9c 100644
--- a/doc/ci/resource_groups/index.md
+++ b/doc/ci/resource_groups/index.md
@@ -155,14 +155,53 @@ See the [API documentation](../../api/resource_groups.md).
Read more how you can use GitLab for [safe deployments](../environments/deployment_safety.md).
-<!-- ## Troubleshooting
+## Troubleshooting
-Include any troubleshooting steps that you can foresee. If you know beforehand what issues
-one might have when setting this up, or when something is changed, or on upgrading, it's
-important to describe those, too. Think of things that may go wrong and include them here.
-This is important to minimize requests for support, and to avoid doc comments with
-questions that you know someone might ask.
+### Avoid dead locks in pipeline configurations
-Each scenario can be a third-level heading, e.g. `### Getting error message X`.
-If you have none to add when creating a doc, leave this section in place
-but commented out to help encourage others to add to it in the future. -->
+Since [`oldest_first` process mode](#process-modes) enforces the jobs to be executed in a pipeline order,
+there is a case that it doesn't work well with the other CI features.
+
+For example, when you run [a child pipeline](../pipelines/parent_child_pipelines.md)
+that requires the same resource group with the parent pipeline,
+a dead lock could happen. Here is an example of a _bad_ setup:
+
+```yaml
+# BAD
+test:
+ stage: test
+ trigger:
+ include: child-pipeline-requires-production-resource-group.yml
+ strategy: depend
+
+deploy:
+ stage: deploy
+ script: echo
+ resource_group: production
+```
+
+In a parent pipeline, it runs the `test` job that subsequently runs a child pipeline,
+and the [`strategy: depend` option](../yaml/index.md#linking-pipelines-with-triggerstrategy) makes the `test` job wait until the child pipeline has finished.
+The parent pipeline runs the `deploy` job in the next stage, that requires a resource from the `production` resource group.
+If the process mode is `oldest_first`, it executes the jobs from the oldest pipelines, meaning the `deploy` job is going to be executed next.
+
+However, a child pipeline also requires a resource from the `production` resource group.
+Since the child pipeline is newer than the parent pipeline, the child pipeline
+waits until the `deploy` job is finished, something that will never happen.
+
+In this case, you should specify the `resource_group` keyword in the parent pipeline configuration instead:
+
+```yaml
+# GOOD
+test:
+ stage: test
+ trigger:
+ include: child-pipeline.yml
+ strategy: depend
+ resource_group: production # Specify the resource group in the parent pipeline
+
+deploy:
+ stage: deploy
+ script: echo
+ resource_group: production
+```
diff --git a/doc/user/clusters/agent/index.md b/doc/user/clusters/agent/index.md
index a5c0514d319..557d389147d 100644
--- a/doc/user/clusters/agent/index.md
+++ b/doc/user/clusters/agent/index.md
@@ -15,7 +15,7 @@ The [GitLab Kubernetes Agent](https://gitlab.com/gitlab-org/cluster-integration/
is an active in-cluster component for solving GitLab and Kubernetes integration
tasks in a secure and cloud-native way. It enables:
-- Integrating GitLab with a Kubernetes cluster behind a firewall or NAT
+- GitLab integration with a Kubernetes cluster behind a firewall or NAT
(network address translation).
- Pull-based GitOps deployments.
- [Inventory object](../../infrastructure/clusters/deploy/inventory_object.md) to keep track of objects applied to your cluster.
@@ -28,7 +28,7 @@ and [our development documentation](https://gitlab.com/gitlab-org/cluster-integr
## GitLab Agent GitOps workflow
-The GitLab Agent uses multiple GitLab projects to provide a flexible workflow
+The GitLab Agent, herein _Agent_, uses multiple GitLab projects to provide a flexible workflow
that can suit various needs. This diagram shows these repositories and the main
actors involved in a deployment:
@@ -54,10 +54,10 @@ There are several components that work in concert for the Agent to accomplish Gi
- A properly-configured Kubernetes cluster where the Agent is running.
- A configuration repository that contains a `config.yaml` file, which tells the
- Agent which repositories to synchronize with the cluster.
+ Agent the repositories to synchronize with the cluster.
- A manifest repository that contains manifest files. Any changes to manifest files are applied to the cluster.
-You can use the same GitLab project or separate projects for configuration and manifest files, as follows:
+You can use the same GitLab project or projects for configuration and manifest files, as follows:
- Single GitLab project (recommended): when you use a single repository to hold both the manifest and the configuration files, these projects can be either private or public, as you prefer.
- Two GitLab projects: when you opt to use two different GitLab projects, one for manifest files, and another for configuration files, the manifests project must be public, while the configuration project can be either private or public. Our backlog contains issues for adding support for
@@ -73,8 +73,8 @@ The setup process involves a few steps to enable GitOps deployments:
1. [Set up the Kubernetes Agent Server](#set-up-the-kubernetes-agent-server) for your GitLab instance.
1. [Define a configuration repository](#define-a-configuration-repository).
1. [Create an Agent record in GitLab](#create-an-agent-record-in-gitlab).
-1. [Generate and copy a Secret token used to connect to the Agent](#create-the-kubernetes-secret).
1. [Install the Agent into the cluster](#install-the-agent-into-the-cluster).
+1. [Generate and copy a Secret token used to connect to the Agent](#create-the-kubernetes-secret).
1. [Create manifest files](#create-manifest-files).
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i> Watch a GitLab 14.2 [walking-through video](https://www.youtube.com/watch?v=XuBpKtsgGkE) with this process.
@@ -200,7 +200,7 @@ For more advanced configurations, we recommend to use [the `kpt` based installat
Otherwise, follow the manual installation steps described below.
-##### Create the Kubernetes secret
+### Create the Kubernetes secret
After generating the token, you must apply it to the Kubernetes cluster.
@@ -256,7 +256,7 @@ NAMESPACE NAME READY S
gitlab-kubernetes-agent gitlab-kubernetes-agent-77689f7dcb-5skqk 1/1 Running 0 51s
```
-##### Example `resources.yml` file
+#### Example `resources.yml` file
```yaml
---
@@ -403,7 +403,7 @@ The following example projects can help you get started with the Kubernetes Agen
- [Configuration repository](https://gitlab.com/gitlab-org/configure/examples/kubernetes-agent)
- This basic GitOps example deploys NGINX: [Manifest repository](https://gitlab.com/gitlab-org/configure/examples/gitops-project)
-### Deploying GitLab Runner with the Agent
+### GitLab Runner Deployment with the Agent
You can use the Kubernetes Agent to
[deploy GitLab Runner in a Kubernetes cluster](https://docs.gitlab.com/runner/install/kubernetes-agent.html).
diff --git a/doc/user/packages/container_registry/index.md b/doc/user/packages/container_registry/index.md
index 06232f5994b..7d0edad406e 100644
--- a/doc/user/packages/container_registry/index.md
+++ b/doc/user/packages/container_registry/index.md
@@ -648,7 +648,11 @@ For self-managed instances, those settings can be updated in the [Rails console]
ApplicationSetting.last.update(container_registry_expiration_policies_worker_capacity: 3)
```
-Alternatively, once the limits are [enabled](#enable-or-disable-cleanup-policy-limits), they are available in the [admin area](../../admin_area/index.md) **Settings > CI/CD > Container Registry**.
+Alternatively, once the limits are [enabled](#enable-or-disable-cleanup-policy-limits),
+they are available in the [administrator area](../../admin_area/index.md):
+
+1. On the top bar, select **Menu > Admin**.
+1. Go to **Settings > CI/CD > Container Registry**.
#### Enable or disable cleanup policy limits
@@ -902,7 +906,7 @@ these steps:
while read -r LINE || [[ -n $LINE ]]; do echo ${LINE}; curl --request DELETE --header 'PRIVATE-TOKEN: <PAT>' "https://gitlab.example.com/api/v4/projects/<Project_id>/registry/repositories/<container_repo_id>/tags/${LINE}"; sleep 0.1; echo; done < list_o_tags.out > delete.logs
```
-### Troubleshoot as a GitLab server admin
+### Troubleshoot as a GitLab server administrator
Troubleshooting the GitLab Container Registry, most of the times, requires
you to log in to GitLab server with the Administrator role.
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index b750df89e83..3705fb1348b 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -22544,9 +22544,6 @@ msgstr ""
msgid "NetworkPolicies|Network traffic"
msgstr ""
-msgid "NetworkPolicies|New policy"
-msgstr ""
-
msgid "NetworkPolicies|None selected"
msgstr ""
@@ -22559,9 +22556,6 @@ msgstr ""
msgid "NetworkPolicies|Policy definition"
msgstr ""
-msgid "NetworkPolicies|Policy editor"
-msgstr ""
-
msgid "NetworkPolicies|Rule"
msgstr ""
@@ -31264,6 +31258,9 @@ msgstr ""
msgid "Show Pipeline IID"
msgstr ""
+msgid "Show all %{issuable_type}."
+msgstr ""
+
msgid "Show all activity"
msgstr ""
diff --git a/qa/qa/specs/features/browser_ui/5_package/maven_repository_spec.rb b/qa/qa/specs/features/browser_ui/5_package/maven_repository_spec.rb
index 10b1ea18c1c..bf1d2a04dba 100644
--- a/qa/qa/specs/features/browser_ui/5_package/maven_repository_spec.rb
+++ b/qa/qa/specs/features/browser_ui/5_package/maven_repository_spec.rb
@@ -183,7 +183,7 @@ module QA
another_project.remove_via_api!
end
- it 'pushes and pulls a Maven package via CI and deletes it', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1627', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/341414', type: :investigating } do
+ it 'pushes and pulls a Maven package via CI and deletes it', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1627' do
Resource::Repository::Commit.fabricate_via_api! do |commit|
commit.project = project
commit.commit_message = 'Add .gitlab-ci.yml'
@@ -256,7 +256,7 @@ module QA
Page::Group::Settings::PackageRegistries.perform(&:set_allow_duplicates_disabled)
end
- it 'prevents users from publishing duplicate Maven packages at the group level', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1830', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/341209', type: :investigating } do
+ it 'prevents users from publishing duplicate Maven packages at the group level', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1830' do
with_fixtures([pom_xml, settings_xml]) do |dir|
Service::DockerRun::Maven.new(dir).publish!
end
@@ -301,7 +301,7 @@ module QA
Page::Group::Settings::PackageRegistries.perform(&:set_allow_duplicates_enabled)
end
- it 'allows users to publish duplicate Maven packages at the group level', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1829', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/341209', type: :investigating } do
+ it 'allows users to publish duplicate Maven packages at the group level', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1829' do
with_fixtures([pom_xml, settings_xml]) do |dir|
Service::DockerRun::Maven.new(dir).publish!
end
diff --git a/qa/qa/support/formatters/test_stats_formatter.rb b/qa/qa/support/formatters/test_stats_formatter.rb
index 5c0daca3b06..f097cde2976 100644
--- a/qa/qa/support/formatters/test_stats_formatter.rb
+++ b/qa/qa/support/formatters/test_stats_formatter.rb
@@ -116,11 +116,11 @@ module QA
@merge_request ||= (!!env('CI_MERGE_REQUEST_IID') || !!env('TOP_UPSTREAM_MERGE_REQUEST_IID')).to_s
end
- # Test run type from staging, canary or production env
+ # Test run type from staging, canary, preprod or production env
#
- # @return [String>, nil]
+ # @return [String, nil]
def run_type
- return unless %w[staging canary production].include?(project_name)
+ return unless %w[staging canary preprod production].include?(project_name)
@run_type ||= begin
test_subset = if env('NO_ADMIN') == 'true'
diff --git a/qa/qa/tools/delete_subgroups.rb b/qa/qa/tools/delete_subgroups.rb
index 2734a702536..bc905fdeadd 100644
--- a/qa/qa/tools/delete_subgroups.rb
+++ b/qa/qa/tools/delete_subgroups.rb
@@ -20,16 +20,10 @@ module QA
end
def run
- $stdout.puts 'Running...'
+ $stdout.puts 'Fetching subgroups for deletion...'
- # Fetch group's id
- group_id = fetch_group_id
-
- sub_groups_head_response = head Runtime::API::Request.new(@api_client, "/groups/#{group_id}/subgroups", per_page: "100").url
- total_sub_group_pages = sub_groups_head_response.headers[:x_total_pages]
-
- sub_group_ids = fetch_subgroup_ids(group_id, total_sub_group_pages)
- $stdout.puts "Number of Sub Groups not already marked for deletion: #{sub_group_ids.length}"
+ sub_group_ids = fetch_subgroup_ids
+ $stdout.puts "\nNumber of Sub Groups not already marked for deletion: #{sub_group_ids.length}"
delete_subgroups(sub_group_ids) unless sub_group_ids.empty?
$stdout.puts "\nDone"
@@ -52,12 +46,20 @@ module QA
JSON.parse(group_search_response.body)["id"]
end
- def fetch_subgroup_ids(group_id, group_pages)
+ def fetch_subgroup_ids
+ group_id = fetch_group_id
sub_groups_ids = []
+ page_no = '1'
+
+ # When we reach the last page, the x-next-page header is a blank string
+ while page_no.present?
+ $stdout.print '.'
+
+ sub_groups_response = get Runtime::API::Request.new(@api_client, "/groups/#{group_id}/subgroups", page: page_no, per_page: '100').url
+ sub_groups_ids.concat(JSON.parse(sub_groups_response.body)
+ .reject { |subgroup| !subgroup["marked_for_deletion_on"].nil? }.map { |subgroup| subgroup['id'] })
- group_pages.to_i.times do |page_no|
- sub_groups_response = get Runtime::API::Request.new(@api_client, "/groups/#{group_id}/subgroups", page: (page_no + 1).to_s, per_page: "100").url
- sub_groups_ids.concat(JSON.parse(sub_groups_response.body).reject { |subgroup| !subgroup["marked_for_deletion_on"].nil? }.map { |subgroup| subgroup["id"] })
+ page_no = sub_groups_response.headers[:x_next_page].to_s
end
sub_groups_ids.uniq
diff --git a/spec/factories/project_error_tracking_settings.rb b/spec/factories/project_error_tracking_settings.rb
index 424f462e1a0..ed743d8283c 100644
--- a/spec/factories/project_error_tracking_settings.rb
+++ b/spec/factories/project_error_tracking_settings.rb
@@ -8,6 +8,7 @@ FactoryBot.define do
token { 'access_token_123' }
project_name { 'Sentry Project' }
organization_name { 'Sentry Org' }
+ integrated { false }
trait :disabled do
enabled { false }
diff --git a/spec/features/dashboard/issuables_counter_spec.rb b/spec/features/dashboard/issuables_counter_spec.rb
index d4c6b6faa79..8e938fef155 100644
--- a/spec/features/dashboard/issuables_counter_spec.rb
+++ b/spec/features/dashboard/issuables_counter_spec.rb
@@ -55,7 +55,7 @@ RSpec.describe 'Navigation bar counter', :use_clean_rails_memory_store_caching d
end
def expect_counters(issuable_type, count)
- dashboard_count = find('.nav-links li.active')
+ dashboard_count = find('.gl-tabs-nav li a.active')
nav_count = find(".dashboard-shortcuts-#{issuable_type}")
header_count = find(".header-content .#{issuable_type.tr('_', '-')}-count")
diff --git a/spec/features/projects/settings/monitor_settings_spec.rb b/spec/features/projects/settings/monitor_settings_spec.rb
index bf2e814ae25..a8b064c8752 100644
--- a/spec/features/projects/settings/monitor_settings_spec.rb
+++ b/spec/features/projects/settings/monitor_settings_spec.rb
@@ -97,7 +97,9 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do
within '.js-error-tracking-settings' do
click_button('Expand')
+ choose('cloud-hosted Sentry')
end
+
expect(page).to have_content('Sentry API URL')
expect(page.body).to include('Error Tracking')
expect(page).to have_button('Connect')
@@ -140,8 +142,10 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do
within '.js-error-tracking-settings' do
click_button('Expand')
+ choose('cloud-hosted Sentry')
+ check('Active')
end
- check('Active')
+
fill_in('error-tracking-api-host', with: 'http://sentry.example.com')
fill_in('error-tracking-token', with: 'token')
diff --git a/spec/helpers/issuables_helper_spec.rb b/spec/helpers/issuables_helper_spec.rb
index 3eb3c73cfcc..30049745433 100644
--- a/spec/helpers/issuables_helper_spec.rb
+++ b/spec/helpers/issuables_helper_spec.rb
@@ -133,13 +133,13 @@ RSpec.describe IssuablesHelper do
it 'returns navigation with badges' do
expect(helper.issuables_state_counter_text(:issues, :opened, true))
- .to eq('<span>Open</span> <span class="badge badge-muted badge-pill gl-badge gl-tab-counter-badge sm">42</span>')
+ .to eq('<span>Open</span> <span class="badge badge-muted badge-pill gl-badge gl-tab-counter-badge sm gl-display-none gl-sm-display-inline-flex">42</span>')
expect(helper.issuables_state_counter_text(:issues, :closed, true))
- .to eq('<span>Closed</span> <span class="badge badge-muted badge-pill gl-badge gl-tab-counter-badge sm">42</span>')
+ .to eq('<span>Closed</span> <span class="badge badge-muted badge-pill gl-badge gl-tab-counter-badge sm gl-display-none gl-sm-display-inline-flex">42</span>')
expect(helper.issuables_state_counter_text(:merge_requests, :merged, true))
- .to eq('<span>Merged</span> <span class="badge badge-muted badge-pill gl-badge gl-tab-counter-badge sm">42</span>')
+ .to eq('<span>Merged</span> <span class="badge badge-muted badge-pill gl-badge gl-tab-counter-badge sm gl-display-none gl-sm-display-inline-flex">42</span>')
expect(helper.issuables_state_counter_text(:merge_requests, :all, true))
- .to eq('<span>All</span> <span class="badge badge-muted badge-pill gl-badge gl-tab-counter-badge sm">42</span>')
+ .to eq('<span>All</span> <span class="badge badge-muted badge-pill gl-badge gl-tab-counter-badge sm gl-display-none gl-sm-display-inline-flex">42</span>')
end
end
@@ -176,7 +176,7 @@ RSpec.describe IssuablesHelper do
it 'returns complete count' do
expect(helper.issuables_state_counter_text(:issues, :opened, true))
- .to eq('<span>Open</span> <span class="badge badge-muted badge-pill gl-badge gl-tab-counter-badge sm">1,100</span>')
+ .to eq('<span>Open</span> <span class="badge badge-muted badge-pill gl-badge gl-tab-counter-badge sm gl-display-none gl-sm-display-inline-flex">1,100</span>')
end
end
@@ -187,7 +187,7 @@ RSpec.describe IssuablesHelper do
it 'returns truncated count' do
expect(helper.issuables_state_counter_text(:issues, :opened, true))
- .to eq('<span>Open</span> <span class="badge badge-muted badge-pill gl-badge gl-tab-counter-badge sm">1.1k</span>')
+ .to eq('<span>Open</span> <span class="badge badge-muted badge-pill gl-badge gl-tab-counter-badge sm gl-display-none gl-sm-display-inline-flex">1.1k</span>')
end
end
end
diff --git a/spec/models/ci/processable_spec.rb b/spec/models/ci/processable_spec.rb
index 0a43f785598..ac1a8247aaa 100644
--- a/spec/models/ci/processable_spec.rb
+++ b/spec/models/ci/processable_spec.rb
@@ -147,13 +147,20 @@ RSpec.describe Ci::Processable do
end
it 'releases a resource when build finished' do
- expect(build.resource_group).to receive(:release_resource_from).with(build).and_call_original
+ expect(build.resource_group).to receive(:release_resource_from).with(build).and_return(true).and_call_original
expect(Ci::ResourceGroups::AssignResourceFromResourceGroupWorker).to receive(:perform_async).with(build.resource_group_id)
build.enqueue_waiting_for_resource!
build.success!
end
+ it 're-checks the resource group even if the processable does not retain a resource' do
+ expect(build.resource_group).to receive(:release_resource_from).with(build).and_return(false).and_call_original
+ expect(Ci::ResourceGroups::AssignResourceFromResourceGroupWorker).to receive(:perform_async).with(build.resource_group_id)
+
+ build.success!
+ end
+
context 'when build has prerequisites' do
before do
allow(build).to receive(:any_unmet_prerequisites?) { true }
diff --git a/spec/services/projects/operations/update_service_spec.rb b/spec/services/projects/operations/update_service_spec.rb
index a71fafb2121..b64f2d1e7d6 100644
--- a/spec/services/projects/operations/update_service_spec.rb
+++ b/spec/services/projects/operations/update_service_spec.rb
@@ -294,10 +294,10 @@ RSpec.describe Projects::Operations::UpdateService do
end
context 'without setting' do
- it 'does not create a setting' do
- expect(result[:status]).to eq(:error)
-
- expect(project.reload.error_tracking_setting).to be_nil
+ it 'creates setting with default values' do
+ expect(result[:status]).to eq(:success)
+ expect(project.error_tracking_setting.enabled).to be_truthy
+ expect(project.error_tracking_setting.integrated).to be_truthy
end
end
end