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>2023-02-01 09:07:27 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-02-01 09:07:27 +0300
commit510bc67dd2222ef511c08aff145cce2317d280df (patch)
treec5c60b0e824631ee576d0e15ebbf293341f53158
parented0dc960f6e0ec6d8e3de6925129b8db76647f4d (diff)
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--.gitlab-ci.yml3
-rw-r--r--.gitlab/ci/dev-fixtures.gitlab-ci.yml2
-rw-r--r--.gitlab/ci/rails.gitlab-ci.yml19
-rw-r--r--.gitlab/ci/setup.gitlab-ci.yml6
-rw-r--r--app/assets/javascripts/pages/projects/edit/index.js2
-rw-r--r--app/helpers/page_layout_helper.rb2
-rw-r--r--app/views/profiles/show.html.haml2
-rw-r--r--app/views/projects/edit.html.haml2
-rw-r--r--config/feature_flags/development/project_analytics_dashboards_page.yml8
-rw-r--r--db/migrate/20230124173255_raise_group_and_project_ci_variable_limits.rb17
-rw-r--r--db/migrate/20230127151529_add_project_pointer_for_analytics_dashboard.rb29
-rw-r--r--db/migrate/20230127151530_migrate_project_pointer_for_analytics_dashboard.rb15
-rw-r--r--db/migrate/20230127151531_change_dashboard_analytics_project_pointer_project_null.rb29
-rw-r--r--db/migrate/20230131123923_raise_ci_variables_default_limits.rb8
-rw-r--r--db/schema_migrations/202301241732551
-rw-r--r--db/schema_migrations/202301271515291
-rw-r--r--db/schema_migrations/202301271515301
-rw-r--r--db/schema_migrations/202301271515311
-rw-r--r--db/schema_migrations/202301311239231
-rw-r--r--db/structure.sql17
-rw-r--r--doc/administration/reference_architectures/10k_users.md4
-rw-r--r--doc/administration/reference_architectures/25k_users.md4
-rw-r--r--doc/administration/reference_architectures/3k_users.md4
-rw-r--r--doc/administration/reference_architectures/50k_users.md4
-rw-r--r--doc/administration/reference_architectures/5k_users.md4
-rw-r--r--doc/ci/jobs/index.md3
-rw-r--r--doc/ci/variables/index.md4
-rw-r--r--doc/integration/arkose.md43
-rw-r--r--locale/gitlab.pot18
-rwxr-xr-xscripts/db_tasks21
-rw-r--r--scripts/prepare_build.sh10
-rw-r--r--scripts/rspec_helpers.sh10
-rwxr-xr-xscripts/verify-tff-mapping4
-rw-r--r--spec/helpers/page_layout_helper_spec.rb9
-rw-r--r--spec/lib/gitlab/import_export/all_models.yml2
-rw-r--r--spec/models/factories_spec.rb211
-rw-r--r--spec/requests/api/graphql/ci/group_variables_spec.rb2
-rw-r--r--spec/requests/api/graphql/ci/project_variables_spec.rb2
-rw-r--r--spec/views/profiles/show.html.haml_spec.rb28
-rw-r--r--tests.yml2
40 files changed, 307 insertions, 248 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 9fb604e7a25..0354a2b650b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -150,8 +150,9 @@ variables:
RSPEC_FOSS_IMPACT_PIPELINE_YML: rspec-foss-impact-pipeline.yml
RSPEC_LAST_RUN_RESULTS_FILE: rspec/rspec_last_run_results.txt
RSPEC_MATCHING_JS_FILES_PATH: rspec/js_matching_files.txt
- RSPEC_MATCHING_TESTS_FOSS_PATH: rspec/matching_tests-foss.txt
RSPEC_MATCHING_TESTS_PATH: rspec/matching_tests.txt
+ RSPEC_MATCHING_TESTS_FOSS_PATH: rspec/matching_tests-foss.txt
+ RSPEC_MATCHING_TESTS_EE_PATH: rspec/matching_tests-ee.txt
RSPEC_PACKED_TESTS_MAPPING_PATH: crystalball/packed-mapping.json
RSPEC_PROFILING_FOLDER_PATH: rspec/profiling
RSPEC_TESTS_MAPPING_PATH: crystalball/mapping.json
diff --git a/.gitlab/ci/dev-fixtures.gitlab-ci.yml b/.gitlab/ci/dev-fixtures.gitlab-ci.yml
index ea868ada621..0ff469d7114 100644
--- a/.gitlab/ci/dev-fixtures.gitlab-ci.yml
+++ b/.gitlab/ci/dev-fixtures.gitlab-ci.yml
@@ -16,7 +16,7 @@
.run-dev-fixtures-script: &run-dev-fixtures-script
- run_timed_command "scripts/gitaly-test-spawn"
- - run_timed_command "RAILS_ENV=test bundle exec rake db:seed_fu"
+ - run_timed_command "bundle exec rake db:seed_fu"
run-dev-fixtures:
extends:
diff --git a/.gitlab/ci/rails.gitlab-ci.yml b/.gitlab/ci/rails.gitlab-ci.yml
index d0c5336de25..6de0ad42235 100644
--- a/.gitlab/ci/rails.gitlab-ci.yml
+++ b/.gitlab/ci/rails.gitlab-ci.yml
@@ -794,20 +794,33 @@ rspec-ee system pg13:
##################################################
# EE: Canonical MR pipelines
-rspec fail-fast:
+.rspec-fail-fast:
extends:
- - .rspec-ee-base-pg12 # This job also runs EE spec which needs elasticsearch
- .rails:rules:rspec fail-fast
stage: test
needs: ["setup-test-env", "retrieve-tests-metadata", "compile-test-assets", "detect-tests"]
script:
- !reference [.base-script, script]
- - rspec_fail_fast "${RSPEC_MATCHING_TESTS_PATH}" "--tag ~quarantine --tag ~zoekt"
+ - rspec_fail_fast "${MATCHING_TESTS_PATH}" "--tag ~quarantine --tag ~zoekt"
artifacts:
expire_in: 7d
paths:
- tmp/capybara/
+rspec fail-fast:
+ extends:
+ - .rspec-fail-fast
+ - .rspec-base-pg12
+ variables:
+ MATCHING_TESTS_PATH: "${RSPEC_MATCHING_TESTS_FOSS_PATH}"
+
+rspec-ee fail-fast:
+ extends:
+ - .rspec-fail-fast
+ - .rspec-base-pg12
+ variables:
+ MATCHING_TESTS_PATH: "${RSPEC_MATCHING_TESTS_EE_PATH}"
+
rspec-foss-impact:pipeline-generate:
extends:
- .rails:rules:rspec-foss-impact
diff --git a/.gitlab/ci/setup.gitlab-ci.yml b/.gitlab/ci/setup.gitlab-ci.yml
index 852c4739d9d..f9ef0f7ad49 100644
--- a/.gitlab/ci/setup.gitlab-ci.yml
+++ b/.gitlab/ci/setup.gitlab-ci.yml
@@ -137,10 +137,11 @@ detect-tests:
tooling/bin/find_tests ${RSPEC_CHANGED_FILES_PATH} ${RSPEC_MATCHING_TESTS_PATH};
tooling/bin/find_changes ${RSPEC_CHANGED_FILES_PATH} ${RSPEC_MATCHING_TESTS_PATH} ${FRONTEND_FIXTURES_MAPPING_PATH};
filter_rspec_matched_foss_tests ${RSPEC_MATCHING_TESTS_PATH} ${RSPEC_MATCHING_TESTS_FOSS_PATH};
+ filter_rspec_matched_ee_tests ${RSPEC_MATCHING_TESTS_PATH} ${RSPEC_MATCHING_TESTS_EE_PATH};
tooling/bin/view_to_js_mappings ${RSPEC_CHANGED_FILES_PATH} ${RSPEC_MATCHING_JS_FILES_PATH};
echoinfo "Changed files: $(cat $RSPEC_CHANGED_FILES_PATH)";
- echoinfo "Related RSpec tests: $(cat $RSPEC_MATCHING_TESTS_PATH)";
echoinfo "Related FOSS RSpec tests: $(cat $RSPEC_MATCHING_TESTS_FOSS_PATH)";
+ echoinfo "Related EE RSpec tests: $(cat $RSPEC_MATCHING_TESTS_EE_PATH)";
echoinfo "Related JS files: $(cat $RSPEC_MATCHING_JS_FILES_PATH)";
fi
artifacts:
@@ -149,8 +150,9 @@ detect-tests:
- ${FRONTEND_FIXTURES_MAPPING_PATH}
- ${RSPEC_CHANGED_FILES_PATH}
- ${RSPEC_MATCHING_JS_FILES_PATH}
- - ${RSPEC_MATCHING_TESTS_FOSS_PATH}
- ${RSPEC_MATCHING_TESTS_PATH}
+ - ${RSPEC_MATCHING_TESTS_FOSS_PATH}
+ - ${RSPEC_MATCHING_TESTS_EE_PATH}
detect-previous-failed-tests:
extends:
diff --git a/app/assets/javascripts/pages/projects/edit/index.js b/app/assets/javascripts/pages/projects/edit/index.js
index c0eb2a8fd77..7d81ef30f2c 100644
--- a/app/assets/javascripts/pages/projects/edit/index.js
+++ b/app/assets/javascripts/pages/projects/edit/index.js
@@ -10,6 +10,7 @@ import initSearchSettings from '~/search_settings';
import initSettingsPanels from '~/settings_panels';
import UserCallout from '~/user_callout';
import initTopicsTokenSelector from '~/projects/settings/topics';
+import { initProjectSelects } from '~/vue_shared/components/entity_select/init_project_selects';
import initProjectPermissionsSettings from '../shared/permissions';
import initProjectLoadingSpinner from '../shared/save_project_loader';
@@ -30,3 +31,4 @@ dirtySubmitFactory(document.querySelectorAll('.js-general-settings-form, .js-mr-
initSearchSettings();
initTopicsTokenSelector();
+initProjectSelects();
diff --git a/app/helpers/page_layout_helper.rb b/app/helpers/page_layout_helper.rb
index 6f7b2877100..4a218984af1 100644
--- a/app/helpers/page_layout_helper.rb
+++ b/app/helpers/page_layout_helper.rb
@@ -175,7 +175,7 @@ module PageLayoutHelper
current_emoji: user.status.emoji.to_s,
current_message: user.status.message.to_s,
current_availability: user.status.availability.to_s,
- current_clear_status_after: user.status.clear_status_at.to_s
+ current_clear_status_after: user.status.clear_status_at&.to_s(:iso8601)
})
end
diff --git a/app/views/profiles/show.html.haml b/app/views/profiles/show.html.haml
index a140d780180..1bc1e0614de 100644
--- a/app/views/profiles/show.html.haml
+++ b/app/views/profiles/show.html.haml
@@ -53,7 +53,7 @@
= status_form.hidden_field :emoji, data: { js_name: 'emoji' }
= status_form.hidden_field :message, data: { js_name: 'message' }
= status_form.hidden_field :availability, data: { js_name: 'availability' }
- = status_form.hidden_field :clear_status_after, data: { js_name: 'clearStatusAfter' }
+ = status_form.hidden_field :clear_status_after, value: @user.status&.clear_status_at&.to_s(:iso8601), data: { js_name: 'clearStatusAfter' }
.col-lg-12
%hr
.row.user-time-preferences.js-search-settings-section
diff --git a/app/views/projects/edit.html.haml b/app/views/projects/edit.html.haml
index f6e3c15c08b..e9335762577 100644
--- a/app/views/projects/edit.html.haml
+++ b/app/views/projects/edit.html.haml
@@ -36,6 +36,8 @@
= c.body do
= _('On the left sidebar, select %{merge_requests_link} to view them.').html_safe % { merge_requests_link: link_to('Settings > Merge requests', project_settings_merge_requests_path(@project)).html_safe }
+= render_if_exists 'projects/settings/analytics_dashboards', expanded: expanded
+
%section.settings.no-animate{ class: ('expanded' if expanded), data: { qa_selector: 'badges_settings_content' } }
.settings-header
%h4.settings-title.js-settings-toggle.js-settings-toggle-trigger-only
diff --git a/config/feature_flags/development/project_analytics_dashboards_page.yml b/config/feature_flags/development/project_analytics_dashboards_page.yml
new file mode 100644
index 00000000000..192d86bd30a
--- /dev/null
+++ b/config/feature_flags/development/project_analytics_dashboards_page.yml
@@ -0,0 +1,8 @@
+---
+name: project_analytics_dashboards_page
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/109618
+rollout_issue_url:
+milestone: '15.9'
+type: development
+group: group::optimize
+default_enabled: false
diff --git a/db/migrate/20230124173255_raise_group_and_project_ci_variable_limits.rb b/db/migrate/20230124173255_raise_group_and_project_ci_variable_limits.rb
new file mode 100644
index 00000000000..7a5f05c977c
--- /dev/null
+++ b/db/migrate/20230124173255_raise_group_and_project_ci_variable_limits.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class RaiseGroupAndProjectCiVariableLimits < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ def up
+ create_or_update_plan_limit('project_ci_variables', 'default', 8000)
+ create_or_update_plan_limit('group_ci_variables', 'default', 30000)
+ end
+
+ def down
+ create_or_update_plan_limit('project_ci_variables', 'default', 200)
+ create_or_update_plan_limit('group_ci_variables', 'default', 200)
+ end
+end
diff --git a/db/migrate/20230127151529_add_project_pointer_for_analytics_dashboard.rb b/db/migrate/20230127151529_add_project_pointer_for_analytics_dashboard.rb
new file mode 100644
index 00000000000..bbfb0c90596
--- /dev/null
+++ b/db/migrate/20230127151529_add_project_pointer_for_analytics_dashboard.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+class AddProjectPointerForAnalyticsDashboard < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ change_column_null :analytics_dashboards_pointers, :project_id, true
+ change_column_null :analytics_dashboards_pointers, :namespace_id, true
+
+ unless column_exists?(:analytics_dashboards_pointers, :target_project_id)
+ add_column :analytics_dashboards_pointers, :target_project_id, :bigint
+ end
+
+ add_concurrent_foreign_key :analytics_dashboards_pointers, :projects,
+ column: :target_project_id,
+ on_delete: :cascade
+
+ add_concurrent_index :analytics_dashboards_pointers, :target_project_id
+ end
+
+ def down
+ change_column_null :analytics_dashboards_pointers, :project_id, false
+ change_column_null :analytics_dashboards_pointers, :namespace_id, false
+
+ return unless column_exists?(:analytics_dashboards_pointers, :target_project_id)
+
+ remove_column :analytics_dashboards_pointers, :target_project_id
+ end
+end
diff --git a/db/migrate/20230127151530_migrate_project_pointer_for_analytics_dashboard.rb b/db/migrate/20230127151530_migrate_project_pointer_for_analytics_dashboard.rb
new file mode 100644
index 00000000000..233474d0918
--- /dev/null
+++ b/db/migrate/20230127151530_migrate_project_pointer_for_analytics_dashboard.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class MigrateProjectPointerForAnalyticsDashboard < Gitlab::Database::Migration[2.1]
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ def up
+ execute 'UPDATE analytics_dashboards_pointers SET target_project_id = project_id'
+ execute 'UPDATE analytics_dashboards_pointers SET project_id = NULL'
+ end
+
+ def down
+ execute 'UPDATE analytics_dashboards_pointers SET project_id = target_project_id'
+ execute 'UPDATE analytics_dashboards_pointers SET target_project_id = NULL'
+ end
+end
diff --git a/db/migrate/20230127151531_change_dashboard_analytics_project_pointer_project_null.rb b/db/migrate/20230127151531_change_dashboard_analytics_project_pointer_project_null.rb
new file mode 100644
index 00000000000..d615185fe8a
--- /dev/null
+++ b/db/migrate/20230127151531_change_dashboard_analytics_project_pointer_project_null.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+class ChangeDashboardAnalyticsProjectPointerProjectNull < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ EXISTENCE_CONSTRAINT = 'chk_analytics_dashboards_pointers_project_or_namespace'
+ NEW_UNIQ_INDEX = 'idx_uniq_analytics_dashboards_pointers_on_project_id'
+ OLD_INDEX = 'index_analytics_dashboards_pointers_on_project_id'
+
+ def up
+ add_check_constraint :analytics_dashboards_pointers,
+ "(project_id IS NULL) <> (namespace_id IS NULL)",
+ EXISTENCE_CONSTRAINT
+
+ change_column_null :analytics_dashboards_pointers, :target_project_id, false
+
+ add_concurrent_index :analytics_dashboards_pointers, :project_id, name: NEW_UNIQ_INDEX, unique: true
+ remove_concurrent_index_by_name :analytics_dashboards_pointers, OLD_INDEX
+ end
+
+ def down
+ remove_check_constraint :analytics_dashboards_pointers, EXISTENCE_CONSTRAINT
+
+ change_column_null :analytics_dashboards_pointers, :target_project_id, true
+
+ add_concurrent_index :analytics_dashboards_pointers, :project_id, name: OLD_INDEX
+ remove_concurrent_index_by_name :analytics_dashboards_pointers, NEW_UNIQ_INDEX
+ end
+end
diff --git a/db/migrate/20230131123923_raise_ci_variables_default_limits.rb b/db/migrate/20230131123923_raise_ci_variables_default_limits.rb
new file mode 100644
index 00000000000..ebe59c13e18
--- /dev/null
+++ b/db/migrate/20230131123923_raise_ci_variables_default_limits.rb
@@ -0,0 +1,8 @@
+# frozen_string_literal: true
+
+class RaiseCiVariablesDefaultLimits < Gitlab::Database::Migration[2.1]
+ def change
+ change_column_default(:plan_limits, :project_ci_variables, from: 200, to: 8000)
+ change_column_default(:plan_limits, :group_ci_variables, from: 200, to: 30000)
+ end
+end
diff --git a/db/schema_migrations/20230124173255 b/db/schema_migrations/20230124173255
new file mode 100644
index 00000000000..b1134aad384
--- /dev/null
+++ b/db/schema_migrations/20230124173255
@@ -0,0 +1 @@
+e11768af160039168f1badf070a8da705660f8a3518198570a0ad4fc39913d92 \ No newline at end of file
diff --git a/db/schema_migrations/20230127151529 b/db/schema_migrations/20230127151529
new file mode 100644
index 00000000000..b36a1842904
--- /dev/null
+++ b/db/schema_migrations/20230127151529
@@ -0,0 +1 @@
+a3ba269ba178efa2a9025448ba9bf6cd4089484580510a1edc0aa111d5f92b23 \ No newline at end of file
diff --git a/db/schema_migrations/20230127151530 b/db/schema_migrations/20230127151530
new file mode 100644
index 00000000000..35951a5aadd
--- /dev/null
+++ b/db/schema_migrations/20230127151530
@@ -0,0 +1 @@
+54678c1253121aaa9b3378b05621f212a6addaf88bd735c697706272a4dae2f8 \ No newline at end of file
diff --git a/db/schema_migrations/20230127151531 b/db/schema_migrations/20230127151531
new file mode 100644
index 00000000000..ab576c0772d
--- /dev/null
+++ b/db/schema_migrations/20230127151531
@@ -0,0 +1 @@
+4403e5a0350da73dc83f6a4fd42e5e8721c3983fe8582d9df58f20b7fbc73333 \ No newline at end of file
diff --git a/db/schema_migrations/20230131123923 b/db/schema_migrations/20230131123923
new file mode 100644
index 00000000000..1368a92047e
--- /dev/null
+++ b/db/schema_migrations/20230131123923
@@ -0,0 +1 @@
+5acafd951bd7a1a521d2b82de5e4b2146e43dab401b3bae82b3d0bb5255c3373 \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index 3aba342d1db..a7e230d4cf1 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -10982,8 +10982,10 @@ ALTER SEQUENCE analytics_cycle_analytics_stage_event_hashes_id_seq OWNED BY anal
CREATE TABLE analytics_dashboards_pointers (
id bigint NOT NULL,
- namespace_id bigint NOT NULL,
- project_id bigint NOT NULL
+ namespace_id bigint,
+ project_id bigint,
+ target_project_id bigint NOT NULL,
+ CONSTRAINT chk_analytics_dashboards_pointers_project_or_namespace CHECK (((project_id IS NULL) <> (namespace_id IS NULL)))
);
CREATE SEQUENCE analytics_dashboards_pointers_id_seq
@@ -19660,8 +19662,8 @@ CREATE TABLE plan_limits (
security_policy_scan_execution_schedules integer DEFAULT 0 NOT NULL,
web_hook_calls_mid integer DEFAULT 0 NOT NULL,
web_hook_calls_low integer DEFAULT 0 NOT NULL,
- project_ci_variables integer DEFAULT 200 NOT NULL,
- group_ci_variables integer DEFAULT 200 NOT NULL,
+ project_ci_variables integer DEFAULT 8000 NOT NULL,
+ group_ci_variables integer DEFAULT 30000 NOT NULL,
ci_max_artifact_size_cyclonedx integer DEFAULT 1 NOT NULL,
rpm_max_file_size bigint DEFAULT '5368709120'::bigint NOT NULL,
ci_max_artifact_size_requirements_v2 integer DEFAULT 0 NOT NULL,
@@ -28657,6 +28659,8 @@ CREATE INDEX idx_streaming_headers_on_external_audit_event_destination_id ON aud
CREATE INDEX idx_test_reports_on_issue_id_created_at_and_id ON requirements_management_test_reports USING btree (issue_id, created_at, id);
+CREATE UNIQUE INDEX idx_uniq_analytics_dashboards_pointers_on_project_id ON analytics_dashboards_pointers USING btree (project_id);
+
CREATE INDEX idx_user_details_on_provisioned_by_group_id_user_id ON user_details USING btree (provisioned_by_group_id, user_id);
CREATE UNIQUE INDEX idx_vuln_signatures_on_occurrences_id_and_signature_sha ON vulnerability_finding_signatures USING btree (finding_id, signature_sha);
@@ -28757,7 +28761,7 @@ CREATE INDEX index_analytics_cycle_analytics_group_stages_custom_only ON analyti
CREATE UNIQUE INDEX index_analytics_dashboards_pointers_on_namespace_id ON analytics_dashboards_pointers USING btree (namespace_id);
-CREATE INDEX index_analytics_dashboards_pointers_on_project_id ON analytics_dashboards_pointers USING btree (project_id);
+CREATE INDEX index_analytics_dashboards_pointers_on_target_project_id ON analytics_dashboards_pointers USING btree (target_project_id);
CREATE INDEX index_application_settings_on_custom_project_templates_group_id ON application_settings USING btree (custom_project_templates_group_id);
@@ -33483,6 +33487,9 @@ ALTER TABLE ONLY service_desk_settings
ALTER TABLE ONLY design_management_designs_versions
ADD CONSTRAINT fk_03c671965c FOREIGN KEY (design_id) REFERENCES design_management_designs(id) ON DELETE CASCADE;
+ALTER TABLE ONLY analytics_dashboards_pointers
+ ADD CONSTRAINT fk_05d96922bd FOREIGN KEY (target_project_id) REFERENCES projects(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY issues
ADD CONSTRAINT fk_05f1e72feb FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL;
diff --git a/doc/administration/reference_architectures/10k_users.md b/doc/administration/reference_architectures/10k_users.md
index fb6fbc5a37e..bcf106b9d14 100644
--- a/doc/administration/reference_architectures/10k_users.md
+++ b/doc/administration/reference_architectures/10k_users.md
@@ -1168,6 +1168,10 @@ However, large repositories or monorepos not following these practices can signi
impact Gitaly performance and requirements.
Refer to [Large repositories](index.md#large-repositories) for more information.
+NOTE:
+This architecture uses [Gitaly Cluster](../gitaly/praefect.md). If you have existing repositories that aren't already managed by Gitaly Cluster, you must first
+[migrate to Gitaly Cluster](../gitaly/index.md#migrate-to-gitaly-cluster).
+
The recommended cluster setup includes the following components:
- 3 Gitaly nodes: Replicated storage of Git repositories.
diff --git a/doc/administration/reference_architectures/25k_users.md b/doc/administration/reference_architectures/25k_users.md
index 93985c0ef55..37bb6455347 100644
--- a/doc/administration/reference_architectures/25k_users.md
+++ b/doc/administration/reference_architectures/25k_users.md
@@ -1188,6 +1188,10 @@ However, large repositories or monorepos not following these practices can signi
impact Gitaly performance and requirements.
Refer to [Large repositories](index.md#large-repositories) for more information.
+NOTE:
+This architecture uses [Gitaly Cluster](../gitaly/praefect.md). If you have existing repositories that aren't already managed by Gitaly Cluster, you must first
+[migrate to Gitaly Cluster](../gitaly/index.md#migrate-to-gitaly-cluster).
+
The recommended cluster setup includes the following components:
- 3 Gitaly nodes: Replicated storage of Git repositories.
diff --git a/doc/administration/reference_architectures/3k_users.md b/doc/administration/reference_architectures/3k_users.md
index b1d2916b7ac..b4aeba6e855 100644
--- a/doc/administration/reference_architectures/3k_users.md
+++ b/doc/administration/reference_architectures/3k_users.md
@@ -1123,6 +1123,10 @@ However, large repositories or monorepos not following these practices can signi
impact Gitaly performance and requirements.
Refer to [Large repositories](index.md#large-repositories) for more information.
+NOTE:
+This architecture uses [Gitaly Cluster](../gitaly/praefect.md). If you have existing repositories that aren't already managed by Gitaly Cluster, you must first
+[migrate to Gitaly Cluster](../gitaly/index.md#migrate-to-gitaly-cluster).
+
The recommended cluster setup includes the following components:
- 3 Gitaly nodes: Replicated storage of Git repositories.
diff --git a/doc/administration/reference_architectures/50k_users.md b/doc/administration/reference_architectures/50k_users.md
index fa9da08fad1..df70233c80e 100644
--- a/doc/administration/reference_architectures/50k_users.md
+++ b/doc/administration/reference_architectures/50k_users.md
@@ -1181,6 +1181,10 @@ However, large repositories or monorepos not following these practices can signi
impact Gitaly performance and requirements.
Refer to [Large repositories](index.md#large-repositories) for more information.
+NOTE:
+This architecture uses [Gitaly Cluster](../gitaly/praefect.md). If you have existing repositories that aren't already managed by Gitaly Cluster, you must first
+[migrate to Gitaly Cluster](../gitaly/index.md#migrate-to-gitaly-cluster).
+
The recommended cluster setup includes the following components:
- 3 Gitaly nodes: Replicated storage of Git repositories.
diff --git a/doc/administration/reference_architectures/5k_users.md b/doc/administration/reference_architectures/5k_users.md
index 8684fe98b1d..37a765ab0a8 100644
--- a/doc/administration/reference_architectures/5k_users.md
+++ b/doc/administration/reference_architectures/5k_users.md
@@ -1119,6 +1119,10 @@ However, large repositories or monorepos not following these practices can signi
impact Gitaly performance and requirements.
Refer to [Large repositories](index.md#large-repositories) for more information.
+NOTE:
+This architecture uses [Gitaly Cluster](../gitaly/praefect.md). If you have existing repositories that aren't already managed by Gitaly Cluster, you must first
+[migrate to Gitaly Cluster](../gitaly/index.md#migrate-to-gitaly-cluster).
+
The recommended cluster setup includes the following components:
- 3 Gitaly nodes: Replicated storage of Git repositories.
diff --git a/doc/ci/jobs/index.md b/doc/ci/jobs/index.md
index 753a755cbf3..9497083ae8d 100644
--- a/doc/ci/jobs/index.md
+++ b/doc/ci/jobs/index.md
@@ -40,7 +40,8 @@ When you access a pipeline, you can see the related jobs for that pipeline.
Selecting an individual job shows you its job log, and allows you to:
- Cancel the job.
-- Retry the job.
+- Retry the job, if it failed.
+- Run the job again, if it passed.
- Erase the job log.
### View all jobs in a project
diff --git a/doc/ci/variables/index.md b/doc/ci/variables/index.md
index 799a9d9ddd0..ec5c6c240a6 100644
--- a/doc/ci/variables/index.md
+++ b/doc/ci/variables/index.md
@@ -124,7 +124,8 @@ all variables become available to the pipeline.
### For a project
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/362227) in GitLab 15.7, projects can define a maximum of 200 CI/CD variables.
+> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/362227) in GitLab 15.7, projects can define a maximum of 200 CI/CD variables.
+> - [Updated](https://gitlab.com/gitlab-org/gitlab/-/issues/373289) in GitLab 15.9, projects can define a maximum of 8000 CI/CD variables.
You can add CI/CD variables to a project's settings.
@@ -153,6 +154,7 @@ or in [job scripts](#use-cicd-variables-in-job-scripts).
> - Support for environment scopes [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/2874) in GitLab Premium 13.11
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/362227) in GitLab 15.7, groups can define a maximum of 200 CI/CD variables.
+> - [Updated](https://gitlab.com/gitlab-org/gitlab/-/issues/373289) in GitLab 15.9, groups can define a maximum of 30000 CI/CD variables.
You can make a CI/CD variable available to all projects in a group.
diff --git a/doc/integration/arkose.md b/doc/integration/arkose.md
index 36c0784cb94..ae90f1f9574 100644
--- a/doc/integration/arkose.md
+++ b/doc/integration/arkose.md
@@ -26,6 +26,28 @@ the `Sign in` button. The challenge needs to be completed to proceed with the si
attempt. If Arkose Protect trusts the user, the challenge runs in transparent mode, meaning that the
user doesn't need to take any additional action and can sign in as usual.
+```mermaid
+sequenceDiagram
+ participant U as User
+ participant G as GitLab
+ participant A as Arkose Labs
+ U->>G: User loads form <br />(POST /api/:version/users/captcha_check)
+ G->>A: Sends device fingerprint and telemetry
+ A->>U: Returns Session token and decision on if to challenge
+ opt Requires Challenge
+ U->>U: User interacts with Challenge iframe
+ end
+ U->>G: Submits form with Arkose Labs token
+ G ->> A: Sends token to be verified
+ A ->> G: Returns verification response
+ Note over G: records `UserCustomAttribute::risk_band`
+ alt session_details.solved == true
+ G ->> U: Proceed
+ else session_details.solved == false
+ G ->> U: Do not proceed
+ end
+```
+
## How do we treat malicious sign-in attempts?
Users are not denied access if Arkose Protect considers they are malicious. However,
@@ -104,6 +126,27 @@ You can find the usage of the allowlist telltale in our [Arkose::VerifyResponse]
To help Arkose improve their protection service, we created a daily background job to send them the list of blocked users by us.
This job is performed by the `Arkose::BlockedUsersReportWorker` class.
+## Test your integration
+
+In staging and development environments only, you can suppress a challenge, or force one to appear.
+You can use this feature if you want to receive a specific risk band.
+
+To force a challenge, change your browser [user agent string](https://developer.chrome.com/docs/devtools/device-mode/override-user-agent/). You can find the appropriate string in [1Password](https://start.1password.com/open/i?a=LKATQYUATRBRDHRRABEBH4RJ5Y&v=6gq44ckmq23vqk5poqunurdgay&i=5v3ushqmfgifpwyqohop5gv5xe&h=gitlab.1password.com).
+
+Alternatively, to request specific behaviors, modify the `setConfig` to include a `data.id` property:
+
+- `'ML_defence'` - Force a challenge to appear.
+- `'customer_request'` - Suppress a challenge. If you suppress a challenge, ArkoseLabs considers your session safe.
+
+For example, this `setConfig` suppresses a challenge:
+
+```javascript
+ arkoseObject.setConfig({
+ data: { id: 'customer_request' },
+ ...
+ });
+```
+
## Additional resources
<!-- markdownlint-disable MD044 -->
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index fd43e1fb8a5..74fca2846b5 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -27435,6 +27435,9 @@ msgstr ""
msgid "Namespace or group to import repository into does not exist."
msgstr ""
+msgid "Namespace or project is required"
+msgstr ""
+
msgid "Namespace:"
msgstr ""
@@ -29298,6 +29301,9 @@ msgstr ""
msgid "Only members of this group can access the wiki."
msgstr ""
+msgid "Only one source is required but both were provided"
+msgstr ""
+
msgid "Only policy:"
msgstr ""
@@ -33161,6 +33167,9 @@ msgstr ""
msgid "ProjectSettings|Analytics"
msgstr ""
+msgid "ProjectSettings|Analytics Dashboards"
+msgstr ""
+
msgid "ProjectSettings|Anyone can pull packages with a package manager API."
msgstr ""
@@ -33434,6 +33443,12 @@ msgstr ""
msgid "ProjectSettings|Select the default branch for this project, and configure the template for branch names."
msgstr ""
+msgid "ProjectSettings|Select the project containing Analytics Dashboards configuration files"
+msgstr ""
+
+msgid "ProjectSettings|Select the project containing Analytics Dashboards configuration files."
+msgstr ""
+
msgid "ProjectSettings|Set the default behavior of this option in merge requests. Changes to this are also applied to existing merge requests."
msgstr ""
@@ -33548,6 +33563,9 @@ msgstr ""
msgid "ProjectSettings|What are merge trains?"
msgstr ""
+msgid "ProjectSettings|What is Analytics Dashboards?"
+msgstr ""
+
msgid "ProjectSettings|What is squashing?"
msgstr ""
diff --git a/scripts/db_tasks b/scripts/db_tasks
index 56c2eefef68..c3b7bb84355 100755
--- a/scripts/db_tasks
+++ b/scripts/db_tasks
@@ -1,12 +1,17 @@
-#!/bin/bash
+#!/usr/bin/env ruby
+# frozen_string_literal: true
-root_path="$(cd "$(dirname "$0")/.." || exit ; pwd -P)"
-task=$1
+require 'yaml'
-shift
+rails_env = ENV.fetch('RAILS_ENV')
+database_config = YAML.load_file(File.join(File.expand_path('..', __dir__), 'config', 'database.yml'))[rails_env]
-if [[ -d "${root_path}/ee/" || "${DECOMPOSED_DB}" == "true" ]]; then
- task="${task}:main"
-fi
+task = ARGV.shift
+raise ArgumentError, 'You need to pass a task name!' unless task
-eval "bundle exec rake ${task} ${*}"
+task = "${task}:main" unless database_config.one?
+cmd = ['bundle', 'exec', 'rake', task, *ARGV]
+
+puts "Running: `#{cmd.join(' ')}`"
+
+system(*cmd)
diff --git a/scripts/prepare_build.sh b/scripts/prepare_build.sh
index d68432d9ec0..500e61ab76a 100644
--- a/scripts/prepare_build.sh
+++ b/scripts/prepare_build.sh
@@ -17,10 +17,12 @@ else
cp config/database.yml.postgresql config/database.yml
fi
-# Remove Geo database setting if `ee/` directory does not exist. When it does
-# not exist, it runs the GitLab test suite "as if FOSS", meaning the jobs run
-# in the context of gitlab-org/gitlab-foss where the Geo is not available.
-if [ ! -d "ee/" ] ; then
+# Set up Geo database if the job name matches `rspec-ee` or `geo`.
+# Since Geo is an EE feature, we shouldn't set it up for non-EE tests.
+if [[ "${CI_JOB_NAME}" =~ "rspec-ee" ]] || [[ "${CI_JOB_NAME}" =~ "geo" ]]; then
+ echoinfo "Geo DB will be set up."
+else
+ echoinfo "Geo DB won't be set up."
sed -i '/geo:/,/^$/d' config/database.yml
fi
diff --git a/scripts/rspec_helpers.sh b/scripts/rspec_helpers.sh
index 5845a6e3f25..5b2c84059ee 100644
--- a/scripts/rspec_helpers.sh
+++ b/scripts/rspec_helpers.sh
@@ -351,10 +351,18 @@ function filter_rspec_matched_foss_tests() {
local matching_tests_file="${1}"
local foss_matching_tests_file="${2}"
- # Keep only files that exists (i.e. exclude EE speficic files)
+ # Keep only FOSS files that exists
cat ${matching_tests_file} | ruby -e 'puts $stdin.read.split(" ").select { |f| f.start_with?("spec/") && File.exist?(f) }.join(" ")' > "${foss_matching_tests_file}"
}
+function filter_rspec_matched_ee_tests() {
+ local matching_tests_file="${1}"
+ local ee_matching_tests_file="${2}"
+
+ # Keep only EE files that exists
+ cat ${matching_tests_file} | ruby -e 'puts $stdin.read.split(" ").select { |f| f.start_with?("ee/spec/") && File.exist?(f) }.join(" ")' > "${ee_matching_tests_file}"
+}
+
function generate_frontend_fixtures_mapping() {
local pattern=""
diff --git a/scripts/verify-tff-mapping b/scripts/verify-tff-mapping
index 08d9d7a33fd..a9470337761 100755
--- a/scripts/verify-tff-mapping
+++ b/scripts/verify-tff-mapping
@@ -127,13 +127,13 @@ tests = [
{
explanation: 'FOSS factory should map to factories spec',
source: 'spec/factories/users.rb',
- expected: ['spec/models/factories_spec.rb']
+ expected: ['ee/spec/models/factories_spec.rb']
},
{
explanation: 'EE factory should map to factories spec',
source: 'ee/spec/factories/users.rb',
- expected: ['spec/models/factories_spec.rb']
+ expected: ['ee/spec/models/factories_spec.rb']
},
{
diff --git a/spec/helpers/page_layout_helper_spec.rb b/spec/helpers/page_layout_helper_spec.rb
index 34d7cadf048..eb42ce18da0 100644
--- a/spec/helpers/page_layout_helper_spec.rb
+++ b/spec/helpers/page_layout_helper_spec.rb
@@ -257,12 +257,17 @@ RSpec.describe PageLayoutHelper do
let(:time) { 3.hours.ago }
before do
- user.status = UserStatus.new(message: 'Some message', emoji: 'basketball', availability: 'busy', clear_status_at: time)
+ user.status = UserStatus.new(
+ message: 'Some message',
+ emoji: 'basketball',
+ availability: 'busy',
+ clear_status_at: time
+ )
end
it 'merges the status properties with the defaults' do
is_expected.to eq({
- current_clear_status_after: time.to_s,
+ current_clear_status_after: time.to_s(:iso8601),
current_availability: 'busy',
current_emoji: 'basketball',
current_message: 'Some message',
diff --git a/spec/lib/gitlab/import_export/all_models.yml b/spec/lib/gitlab/import_export/all_models.yml
index 8750bf4387c..4b5fde600a8 100644
--- a/spec/lib/gitlab/import_export/all_models.yml
+++ b/spec/lib/gitlab/import_export/all_models.yml
@@ -669,6 +669,8 @@ project:
- disable_download_button
- dependency_list_exports
- sbom_occurrences
+- analytics_dashboards_configuration_project
+- analytics_dashboards_pointer
award_emoji:
- awardable
- user
diff --git a/spec/models/factories_spec.rb b/spec/models/factories_spec.rb
deleted file mode 100644
index d6e746986d6..00000000000
--- a/spec/models/factories_spec.rb
+++ /dev/null
@@ -1,211 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-# `:saas` is used to test `gitlab_subscription` factory.
-# It's not available on FOSS but also this very factory is not.
-RSpec.describe 'factories', :saas, :with_license, feature_category: :tooling do
- include Database::DatabaseHelpers
-
- # Used in `skipped` and indicates whether to skip any traits including the
- # plain factory.
- any = Object.new
-
- # https://gitlab.com/groups/gitlab-org/-/epics/5464 tracks the remaining
- # skipped factories or traits.
- #
- # Consider adding a code comment if a trait cannot produce a valid object.
- skipped = [
- [:audit_event, :unauthenticated],
- [:ci_build_trace_chunk, :fog_with_data],
- [:ci_job_artifact, :remote_store],
- [:ci_job_artifact, :raw],
- [:ci_job_artifact, :gzip],
- [:ci_job_artifact, :correct_checksum],
- [:dependency_proxy_blob, :remote_store],
- [:environment, :non_playable],
- [:composer_cache_file, :object_storage],
- [:debian_project_component_file, :object_storage],
- [:debian_project_distribution, :object_storage],
- [:debian_file_metadatum, :unknown],
- [:issue_customer_relations_contact, :for_contact],
- [:issue_customer_relations_contact, :for_issue],
- [:package_file, :object_storage],
- [:rpm_repository_file, :object_storage],
- [:pages_domain, :without_certificate],
- [:pages_domain, :without_key],
- [:pages_domain, :with_missing_chain],
- [:pages_domain, :with_trusted_chain],
- [:pages_domain, :with_trusted_expired_chain],
- [:pages_domain, :explicit_ecdsa],
- [:project_member, :blocked],
- [:remote_mirror, :ssh],
- [:user_preference, :only_comments],
- [:ci_pipeline_artifact, :remote_store],
- # EE
- [:dast_profile, :with_dast_site_validation],
- [:dependency_proxy_manifest, :remote_store],
- [:geo_dependency_proxy_manifest_state, any],
- [:ee_ci_build, :dependency_scanning_report],
- [:ee_ci_build, :license_scan_v1],
- [:ee_ci_job_artifact, :v1],
- [:ee_ci_job_artifact, :v1_1],
- [:ee_ci_job_artifact, :v2],
- [:ee_ci_job_artifact, :v2_1],
- [:geo_ci_secure_file_state, any],
- [:geo_dependency_proxy_blob_state, any],
- [:geo_event_log, :geo_event],
- [:geo_job_artifact_state, any],
- [:geo_lfs_object_state, any],
- [:geo_pages_deployment_state, any],
- [:geo_upload_state, any],
- [:geo_ci_secure_file_state, any],
- [:lfs_object, :checksum_failure],
- [:lfs_object, :checksummed],
- [:merge_request, :blocked],
- [:merge_request_diff, :verification_failed],
- [:merge_request_diff, :verification_succeeded],
- [:package_file, :verification_failed],
- [:package_file, :verification_succeeded],
- [:project, :with_vulnerabilities],
- [:scan_execution_policy, :with_schedule_and_agent],
- [:vulnerability, :with_cluster_image_scanning_finding],
- [:vulnerability, :with_findings],
- [:vulnerability_export, :finished]
- ].freeze
-
- shared_examples 'factory' do |factory|
- skip_any = skipped.include?([factory.name, any])
-
- describe "#{factory.name} factory" do
- it 'does not raise error when built' do
- # We use `skip` here because using `build` mostly work even if
- # factories break when creating them.
- skip 'Factory skipped linting due to legacy error' if skip_any
-
- expect { build(factory.name) }.not_to raise_error
- end
-
- it 'does not raise error when created' do
- pending 'Factory skipped linting due to legacy error' if skip_any
-
- expect { create(factory.name) }.not_to raise_error # rubocop:disable Rails/SaveBang
- end
-
- factory.definition.defined_traits.map(&:name).each do |trait_name|
- skip_trait = skip_any || skipped.include?([factory.name, trait_name.to_sym])
-
- describe "linting :#{trait_name} trait" do
- it 'does not raise error when created' do
- pending 'Trait skipped linting due to legacy error' if skip_trait
-
- expect { create(factory.name, trait_name) }.not_to raise_error
- end
- end
- end
- end
- end
-
- # FactoryDefault speed up specs by creating associations only once
- # and reuse them in other factories.
- #
- # However, for some factories we cannot use FactoryDefault because the
- # associations must be unique and cannot be reused, or the factory default
- # is being mutated.
- skip_factory_defaults = %i[
- ci_job_token_project_scope_link
- ci_subscriptions_project
- evidence
- exported_protected_branch
- fork_network_member
- group_member
- import_state
- issue_customer_relations_contact
- member_task
- merge_request_block
- milestone_release
- namespace
- project_namespace
- project_repository
- project_security_setting
- prometheus_alert
- prometheus_alert_event
- prometheus_metric
- protected_branch
- protected_branch_merge_access_level
- protected_branch_push_access_level
- protected_branch_unprotect_access_level
- protected_tag
- protected_tag_create_access_level
- release
- release_link
- self_managed_prometheus_alert_event
- shard
- users_star_project
- vulnerabilities_finding_identifier
- wiki_page
- wiki_page_meta
- ].to_set.freeze
-
- # Some factories and their corresponding models are based on
- # database views. In order to use those, we have to swap the
- # view out with a table of the same structure.
- factories_based_on_view = %i[
- postgres_index
- postgres_index_bloat_estimate
- postgres_autovacuum_activity
- ].to_set.freeze
-
- without_fd, with_fd = FactoryBot.factories
- .partition { |factory| skip_factory_defaults.include?(factory.name) }
-
- # Some EE models check licensed features so stub them.
- shared_context 'with licensed features' do
- licensed_features = %i[
- board_milestone_lists
- board_assignee_lists
- ].index_with(true)
-
- if Gitlab.jh?
- licensed_features.merge! %i[
- dingtalk_integration
- feishu_bot_integration
- ].index_with(true)
- end
-
- before do
- stub_licensed_features(licensed_features)
- end
- end
-
- include_context 'with licensed features' if Gitlab.ee?
-
- context 'with factory defaults', factory_default: :keep do
- let_it_be(:namespace) { create_default(:namespace).freeze }
- let_it_be(:project) { create_default(:project, :repository).freeze }
- let_it_be(:user) { create_default(:user).freeze }
-
- before do
- factories_based_on_view.each do |factory|
- view = build(factory).class.table_name
- view_gitlab_schema = Gitlab::Database::GitlabSchema.table_schema(view)
- Gitlab::Database.database_base_models.each_value.select do |base_model|
- connection = base_model.connection
- next unless Gitlab::Database.gitlab_schemas_for_connection(connection).include?(view_gitlab_schema)
-
- swapout_view_for_table(view, connection: connection)
- end
- end
- end
-
- with_fd.each do |factory|
- it_behaves_like 'factory', factory
- end
- end
-
- context 'without factory defaults' do
- without_fd.each do |factory|
- it_behaves_like 'factory', factory
- end
- end
-end
diff --git a/spec/requests/api/graphql/ci/group_variables_spec.rb b/spec/requests/api/graphql/ci/group_variables_spec.rb
index e45ddbb1585..d78b30787c9 100644
--- a/spec/requests/api/graphql/ci/group_variables_spec.rb
+++ b/spec/requests/api/graphql/ci/group_variables_spec.rb
@@ -47,7 +47,7 @@ RSpec.describe 'Query.group(fullPath).ciVariables', feature_category: :pipeline_
post_graphql(query, current_user: user)
- expect(graphql_data.dig('group', 'ciVariables', 'limit')).to be(200)
+ expect(graphql_data.dig('group', 'ciVariables', 'limit')).to be(30000)
expect(graphql_data.dig('group', 'ciVariables', 'nodes')).to contain_exactly({
'id' => variable.to_global_id.to_s,
'key' => 'TEST_VAR',
diff --git a/spec/requests/api/graphql/ci/project_variables_spec.rb b/spec/requests/api/graphql/ci/project_variables_spec.rb
index f9a32b42b4d..0ddcac89b34 100644
--- a/spec/requests/api/graphql/ci/project_variables_spec.rb
+++ b/spec/requests/api/graphql/ci/project_variables_spec.rb
@@ -41,7 +41,7 @@ RSpec.describe 'Query.project(fullPath).ciVariables', feature_category: :pipelin
post_graphql(query, current_user: user)
- expect(graphql_data.dig('project', 'ciVariables', 'limit')).to be(200)
+ expect(graphql_data.dig('project', 'ciVariables', 'limit')).to be(8000)
expect(graphql_data.dig('project', 'ciVariables', 'nodes')).to contain_exactly({
'id' => variable.to_global_id.to_s,
'key' => 'TEST_VAR',
diff --git a/spec/views/profiles/show.html.haml_spec.rb b/spec/views/profiles/show.html.haml_spec.rb
index 5751d47ee97..d5cb5694031 100644
--- a/spec/views/profiles/show.html.haml_spec.rb
+++ b/spec/views/profiles/show.html.haml_spec.rb
@@ -3,7 +3,8 @@
require 'spec_helper'
RSpec.describe 'profiles/show' do
- let(:user) { create(:user) }
+ let_it_be(:user_status) { create(:user_status, clear_status_at: 8.hours.from_now) }
+ let_it_be(:user) { user_status.user }
before do
assign(:user, user)
@@ -23,5 +24,30 @@ RSpec.describe 'profiles/show' do
"rel=\"noopener noreferrer\">#{_('Learn more.')}</a>"
expect(rendered.include?(expected_link_html)).to eq(true)
end
+
+ it 'renders required hidden inputs for set status form' do
+ render
+
+ expect(rendered).to have_field(
+ 'user[status][emoji]',
+ with: user_status.emoji,
+ type: :hidden
+ )
+ expect(rendered).to have_field(
+ 'user[status][message]',
+ with: user_status.message,
+ type: :hidden
+ )
+ expect(rendered).to have_field(
+ 'user[status][availability]',
+ with: user_status.availability,
+ type: :hidden
+ )
+ expect(rendered).to have_field(
+ 'user[status][clear_status_after]',
+ with: user_status.clear_status_at.to_s(:iso8601),
+ type: :hidden
+ )
+ end
end
end
diff --git a/tests.yml b/tests.yml
index 4526c9cf1f5..1135d475cc4 100644
--- a/tests.yml
+++ b/tests.yml
@@ -63,7 +63,7 @@ mapping:
# EE/FOSS factory should map to factories spec
- source: (ee/)?spec/factories/.+\.rb
- test: spec/models/factories_spec.rb
+ test: ee/spec/models/factories_spec.rb
# Whats New should map to its respective spec
- source: data/whats_new/\w*.yml