summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-01-19 15:07:31 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-01-19 15:07:31 +0000
commit30cd626f8c1028ba096e84349580e0772a34b1af (patch)
treee304b473a86427bc2c7f8992cab8a1479fc8e6c2
parent9320083e480a8a1f2584af4e3d9a4538ab14cf1e (diff)
downloadgitlab-ce-30cd626f8c1028ba096e84349580e0772a34b1af.tar.gz
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--GITLAB_ELASTICSEARCH_INDEXER_VERSION2
-rw-r--r--Gemfile2
-rw-r--r--Gemfile.checksum2
-rw-r--r--Gemfile.lock4
-rw-r--r--app/assets/config/manifest.js120
-rw-r--r--app/assets/javascripts/mirrors/ssh_mirror.js3
-rw-r--r--app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals.vue3
-rw-r--r--app/assets/javascripts/vue_merge_request_widget/extensions/test_report/index.js3
-rw-r--r--app/controllers/groups/email_campaigns_controller.rb2
-rw-r--r--app/controllers/groups_controller.rb1
-rw-r--r--config/application.rb183
-rw-r--r--config/feature_flags/development/hash_oauth_secrets.yml4
-rw-r--r--data/deprecations/15-8-deprecate-backups-support-for-openstack-rackspace-apis.yml13
-rw-r--r--doc/api/import.md3
-rw-r--r--doc/integration/oauth_provider.md7
-rw-r--r--doc/raketasks/backup_gitlab.md3
-rw-r--r--doc/update/deprecations.md18
-rw-r--r--doc/update/index.md2
-rw-r--r--qa/qa/fixtures/package_managers/helm/helm_install_package.yaml.erb3
-rw-r--r--qa/qa/fixtures/package_managers/helm/helm_upload_package.yaml.erb3
-rw-r--r--spec/frontend/add_context_commits_modal/store/actions_spec.js3
-rw-r--r--spec/frontend/api/alert_management_alerts_api_spec.js5
-rw-r--r--spec/frontend/api_spec.js2
-rw-r--r--spec/frontend/ci/reports/codequality_report/store/actions_spec.js13
-rw-r--r--spec/frontend/error_tracking/store/details/actions_spec.js3
-rw-r--r--spec/frontend/import_entities/import_projects/store/actions_spec.js4
-rw-r--r--spec/frontend/issuable/related_issues/components/related_issues_root_spec.js5
-rw-r--r--spec/frontend/merge_request_spec.js3
-rw-r--r--spec/frontend/notes/components/comment_form_spec.js16
-rw-r--r--spec/frontend/notes/stores/actions_spec.js3
-rw-r--r--spec/frontend/packages_and_registries/dependency_proxy/app_spec.js3
-rw-r--r--spec/frontend/projects/settings/components/shared_runners_toggle_spec.js8
-rw-r--r--spec/frontend/vue_merge_request_widget/mr_widget_options_spec.js4
-rw-r--r--spec/frontend/vue_merge_request_widget/stores/artifacts_list/actions_spec.js3
34 files changed, 245 insertions, 211 deletions
diff --git a/GITLAB_ELASTICSEARCH_INDEXER_VERSION b/GITLAB_ELASTICSEARCH_INDEXER_VERSION
index 944880fa15e..fcdb2e109f6 100644
--- a/GITLAB_ELASTICSEARCH_INDEXER_VERSION
+++ b/GITLAB_ELASTICSEARCH_INDEXER_VERSION
@@ -1 +1 @@
-3.2.0
+4.0.0
diff --git a/Gemfile b/Gemfile
index 61368292997..03a9ec7ed88 100644
--- a/Gemfile
+++ b/Gemfile
@@ -29,7 +29,7 @@ gem 'ipaddr', '1.2.2'
# Responders respond_to and respond_with
gem 'responders', '~> 3.0'
-gem 'sprockets', '~> 3.7.0'
+gem 'sprockets', '~> 4.1.1'
gem 'view_component', '~> 2.74.1'
diff --git a/Gemfile.checksum b/Gemfile.checksum
index c75e1530c47..ada5d80de1c 100644
--- a/Gemfile.checksum
+++ b/Gemfile.checksum
@@ -565,7 +565,7 @@
{"name":"spring","version":"4.1.0","platform":"ruby","checksum":"f17f080fb0df558d663c897a6229ed3d5cc54819ab51876ea6eef49a67f0a3cb"},
{"name":"spring-commands-rspec","version":"1.0.4","platform":"ruby","checksum":"6202e54fa4767452e3641461a83347645af478bf45dddcca9737b43af0dd1a2c"},
{"name":"sprite-factory","version":"1.7.1","platform":"ruby","checksum":"5586524a1aec003241f1abc6852b61433e988aba5ee2b55f906387bf49b01ba2"},
-{"name":"sprockets","version":"3.7.2","platform":"ruby","checksum":"5ea1d7facd09203c1aa196afd6178208cd25abdbcc2a9978810a2f0754e152a0"},
+{"name":"sprockets","version":"4.1.1","platform":"ruby","checksum":"68b10b0e574fc2a080e4779d025bf39bc7a20bc8659e32f827cccce9581348e2"},
{"name":"sprockets-rails","version":"3.4.2","platform":"ruby","checksum":"36d6327757ccf7460a00d1d52b2d5ef0019a4670503046a129fa1fb1300931ad"},
{"name":"sqlite3","version":"1.4.2","platform":"ruby","checksum":"e8b8ef3b0f75c18e1a7ee62c5678c827e99389e53fa55eb7a9a5f57459004a52"},
{"name":"ssh_data","version":"1.3.0","platform":"ruby","checksum":"ec7c1e95a3aebeee412147998f4c147b4b05da6ed0aafda6083f9449318eaac0"},
diff --git a/Gemfile.lock b/Gemfile.lock
index 3b65e2b4061..a37c27439a4 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1405,7 +1405,7 @@ GEM
spring-commands-rspec (1.0.4)
spring (>= 0.9.1)
sprite-factory (1.7.1)
- sprockets (3.7.2)
+ sprockets (4.1.1)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.4.2)
@@ -1843,7 +1843,7 @@ DEPENDENCIES
spring (~> 4.1.0)
spring-commands-rspec (~> 1.0.4)
sprite-factory (~> 1.7)
- sprockets (~> 3.7.0)
+ sprockets (~> 4.1.1)
ssh_data (~> 1.3)
stackprof (~> 0.2.21)
state_machines-activerecord (~> 0.8.0)
diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js
new file mode 100644
index 00000000000..c8dc05847bb
--- /dev/null
+++ b/app/assets/config/manifest.js
@@ -0,0 +1,120 @@
+//= link_tree ../images
+
+//= link application_utilities.css
+//= link application_utilities_dark.css
+//= link application.css
+//= link application_dark.css
+
+//= link_directory ../stylesheets/startup .css
+
+//= link print.css
+//= link mailer.css
+//= link mailer_client_specific.css
+//= link notify.css
+//= link notify_enhanced.css
+
+//= link mailers/highlighted_diff_email.css
+//= link page_bundles/_mixins_and_variables_and_functions.css
+
+//= link page_bundles/admin/application_settings_metrics_and_profiling.css
+//= link page_bundles/admin/geo_nodes.css
+//= link page_bundles/admin/geo_replicable.css
+//= link page_bundles/admin/jobs_index.css
+
+//= link page_bundles/alert_management_details.css
+//= link page_bundles/alert_management_settings.css
+//= link page_bundles/boards.css
+//= link page_bundles/branches.css
+//= link page_bundles/build.css
+//= link page_bundles/ci_status.css
+//= link page_bundles/cluster_agents.css
+//= link page_bundles/clusters.css
+//= link page_bundles/dashboard.css
+//= link page_bundles/dashboard_projects.css
+//= link page_bundles/design_management.css
+//= link page_bundles/editor.css
+//= link page_bundles/environments.css
+//= link page_bundles/error_tracking_details.css
+//= link page_bundles/error_tracking_index.css
+//= link page_bundles/escalation_policies.css
+//= link page_bundles/graph_charts.css
+//= link page_bundles/group.css
+//= link page_bundles/ide.css
+//= link page_bundles/import.css
+//= link page_bundles/incident_management_list.css
+//= link page_bundles/incidents.css
+//= link page_bundles/issuable.css
+//= link page_bundles/issuable_list.css
+//= link page_bundles/issues_list.css
+//= link page_bundles/issues_show.css
+//= link page_bundles/jira_connect.css
+//= link page_bundles/jira_connect_users.css
+//= link page_bundles/learn_gitlab.css
+//= link page_bundles/members.css
+//= link page_bundles/merge_conflicts.css
+//= link page_bundles/merge_requests.css
+//= link page_bundles/milestone.css
+//= link page_bundles/new_namespace.css
+//= link page_bundles/notifications.css
+//= link page_bundles/oncall_schedules.css
+//= link page_bundles/operations.css
+//= link page_bundles/pipeline.css
+//= link page_bundles/pipeline_editor.css
+//= link page_bundles/pipeline_schedules.css
+//= link page_bundles/pipelines.css
+//= link page_bundles/profile.css
+//= link page_bundles/profile_two_factor_auth.css
+//= link page_bundles/profiles/preferences.css
+//= link page_bundles/project.css
+//= link page_bundles/projects_edit.css
+//= link page_bundles/prometheus.css
+//= link page_bundles/releases.css
+//= link page_bundles/reports.css
+//= link page_bundles/runner_details.css
+//= link page_bundles/search.css
+//= link page_bundles/settings.css
+//= link page_bundles/signup.css
+//= link page_bundles/terminal.css
+//= link page_bundles/terms.css
+//= link page_bundles/todos.css
+//= link page_bundles/tree.css
+//= link page_bundles/users.css
+//= link page_bundles/wiki.css
+//= link page_bundles/work_items.css
+//= link page_bundles/xterm.css
+
+//= link lazy_bundles/cropper.css
+//= link lazy_bundles/select2.css
+//= link lazy_bundles/gridstack.css
+
+//= link performance_bar.css
+//= link disable_animations.css
+//= link test_environment.css
+//= link snippets.css
+//= link fonts.css
+
+//= link_tree ../javascripts/locale .js
+//= link gettext/all
+
+//= link emoji_sprites.css
+//= link errors.css
+
+//= link_directory ../stylesheets/themes .css
+
+//= link_directory ../stylesheets/highlight/themes .css
+//= link highlight/diff_custom_colors_addition.css
+//= link highlight/diff_custom_colors_deletion.css
+
+// @gitlab/fonts package
+//= link gitlab-sans/GitLabSans.woff2
+//= link jetbrains-mono/JetBrainsMono.woff2
+
+// @gitlab-svg package
+//= link icons.svg
+//= link icons.json
+//= link_tree ../../../node_modules/@gitlab/svgs/dist/illustrations .svg
+//= link_tree ../../../node_modules/@gitlab/svgs/dist/illustrations .png
+
+//= link xterm/src/xterm.css
+
+//= link snowplow/sp.js
diff --git a/app/assets/javascripts/mirrors/ssh_mirror.js b/app/assets/javascripts/mirrors/ssh_mirror.js
index 3b7e5a5f2ee..037120a0d81 100644
--- a/app/assets/javascripts/mirrors/ssh_mirror.js
+++ b/app/assets/javascripts/mirrors/ssh_mirror.js
@@ -3,6 +3,7 @@ import { escape } from 'lodash';
import { createAlert } from '~/flash';
import axios from '~/lib/utils/axios_utils';
import { backOff } from '~/lib/utils/common_utils';
+import { HTTP_STATUS_NO_CONTENT } from '~/lib/utils/http_status';
import { __ } from '~/locale';
import AUTH_METHOD from './constants';
@@ -87,7 +88,7 @@ export default class SSHMirror {
)}`,
)
.then(({ data, status }) => {
- if (status === 204) {
+ if (status === HTTP_STATUS_NO_CONTENT) {
this.backOffRequestCounter += 1;
if (this.backOffRequestCounter < 3) {
next();
diff --git a/app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals.vue b/app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals.vue
index 3226cd45077..a04b082fa87 100644
--- a/app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals.vue
+++ b/app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals.vue
@@ -2,6 +2,7 @@
import { GlButton, GlSprintf, GlLink } from '@gitlab/ui';
import { createAlert } from '~/flash';
import { BV_SHOW_MODAL } from '~/lib/utils/constants';
+import { HTTP_STATUS_UNAUTHORIZED } from '~/lib/utils/http_status';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { s__, __ } from '~/locale';
import eventHub from '../../event_hub';
@@ -167,7 +168,7 @@ export default {
this.updateApproval(
() => this.service.approveMergeRequestWithAuth(data),
(error) => {
- if (error && error.response && error.response.status === 401) {
+ if (error && error.response && error.response.status === HTTP_STATUS_UNAUTHORIZED) {
this.hasApprovalAuthError = true;
return;
}
diff --git a/app/assets/javascripts/vue_merge_request_widget/extensions/test_report/index.js b/app/assets/javascripts/vue_merge_request_widget/extensions/test_report/index.js
index 97b9b59e2c3..7566e083f14 100644
--- a/app/assets/javascripts/vue_merge_request_widget/extensions/test_report/index.js
+++ b/app/assets/javascripts/vue_merge_request_widget/extensions/test_report/index.js
@@ -1,6 +1,7 @@
import { uniqueId } from 'lodash';
import { __ } from '~/locale';
import axios from '~/lib/utils/axios_utils';
+import { HTTP_STATUS_NO_CONTENT } from '~/lib/utils/http_status';
import TestCaseDetails from '~/pipelines/components/test_reports/test_case_details.vue';
import { EXTENSION_ICONS } from '../../constants';
import {
@@ -91,7 +92,7 @@ export default {
...response,
data: {
hasSuiteError: suites.some((suite) => suite.status === ERROR_STATUS),
- parsingInProgress: status === 204,
+ parsingInProgress: status === HTTP_STATUS_NO_CONTENT,
...data,
summary: {
recentlyFailed: countRecentlyFailedTests(suites),
diff --git a/app/controllers/groups/email_campaigns_controller.rb b/app/controllers/groups/email_campaigns_controller.rb
index 38087e3fc11..1ccaf5798b6 100644
--- a/app/controllers/groups/email_campaigns_controller.rb
+++ b/app/controllers/groups/email_campaigns_controller.rb
@@ -3,7 +3,7 @@
class Groups::EmailCampaignsController < Groups::ApplicationController
EMAIL_CAMPAIGNS_SCHEMA_URL = 'iglu:com.gitlab/email_campaigns/jsonschema/1-0-0'
- feature_category :navigation
+ feature_category :experimentation_activation
urgency :low
before_action :check_params
diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb
index e440b60ad1f..7af6e666c26 100644
--- a/app/controllers/groups_controller.rb
+++ b/app/controllers/groups_controller.rb
@@ -36,6 +36,7 @@ class GroupsController < Groups::ApplicationController
before_action only: :issues do
push_frontend_feature_flag(:or_issuable_queries, group)
+ push_frontend_feature_flag(:frontend_caching, group)
push_force_frontend_feature_flag(:work_items, group.work_items_feature_flag_enabled?)
end
diff --git a/config/application.rb b/config/application.rb
index 61dfa59a90d..49bb7207c24 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -240,145 +240,32 @@ module Gitlab
# Support legacy unicode file named img emojis, `1F939.png`
config.assets.paths << TanukiEmoji.images_path
- config.assets.paths << "#{config.root}/vendor/assets/fonts"
-
- config.assets.precompile << "application_utilities.css"
- config.assets.precompile << "application_utilities_dark.css"
- config.assets.precompile << "application_dark.css"
-
- config.assets.precompile << "startup/*.css"
-
- config.assets.precompile << "print.css"
- config.assets.precompile << "mailer.css"
- config.assets.precompile << "mailer_client_specific.css"
- config.assets.precompile << "notify.css"
- config.assets.precompile << "notify_enhanced.css"
- config.assets.precompile << "mailers/*.css"
- config.assets.precompile << "page_bundles/_mixins_and_variables_and_functions.css"
- config.assets.precompile << "page_bundles/admin/application_settings_metrics_and_profiling.css"
- config.assets.precompile << "page_bundles/admin/geo_nodes.css"
- config.assets.precompile << "page_bundles/admin/geo_replicable.css"
- config.assets.precompile << "page_bundles/admin/jobs_index.css"
- config.assets.precompile << "page_bundles/alert_management_details.css"
- config.assets.precompile << "page_bundles/alert_management_settings.css"
- config.assets.precompile << "page_bundles/billings.css"
- config.assets.precompile << "page_bundles/boards.css"
- config.assets.precompile << "page_bundles/branches.css"
- config.assets.precompile << "page_bundles/build.css"
- config.assets.precompile << "page_bundles/ci_status.css"
- config.assets.precompile << "page_bundles/cluster_agents.css"
- config.assets.precompile << "page_bundles/clusters.css"
- config.assets.precompile << "page_bundles/cycle_analytics.css"
- config.assets.precompile << "page_bundles/dashboard.css"
- config.assets.precompile << "page_bundles/dashboard_projects.css"
- config.assets.precompile << "page_bundles/design_management.css"
- config.assets.precompile << "page_bundles/dev_ops_reports.css"
- config.assets.precompile << "page_bundles/editor.css"
- config.assets.precompile << "page_bundles/environments.css"
- config.assets.precompile << "page_bundles/epics.css"
- config.assets.precompile << "page_bundles/error_tracking_details.css"
- config.assets.precompile << "page_bundles/error_tracking_index.css"
- config.assets.precompile << "page_bundles/graph_charts.css"
- config.assets.precompile << "page_bundles/group.css"
- config.assets.precompile << "page_bundles/ide.css"
- config.assets.precompile << "page_bundles/import.css"
- config.assets.precompile << "page_bundles/incident_management_list.css"
- config.assets.precompile << "page_bundles/incidents.css"
- config.assets.precompile << "page_bundles/issues_analytics.css"
- config.assets.precompile << "page_bundles/issuable.css"
- config.assets.precompile << "page_bundles/issuable_list.css"
- config.assets.precompile << "page_bundles/issues_list.css"
- config.assets.precompile << "page_bundles/issues_show.css"
- config.assets.precompile << "page_bundles/jira_connect.css"
- config.assets.precompile << "page_bundles/jira_connect_users.css"
- config.assets.precompile << "page_bundles/learn_gitlab.css"
- config.assets.precompile << "page_bundles/marketing_popover.css"
- config.assets.precompile << "page_bundles/members.css"
- config.assets.precompile << "page_bundles/merge_conflicts.css"
- config.assets.precompile << "page_bundles/merge_request_analytics.css"
- config.assets.precompile << "page_bundles/merge_requests.css"
- config.assets.precompile << "page_bundles/milestone.css"
- config.assets.precompile << "page_bundles/new_namespace.css"
- config.assets.precompile << "page_bundles/notifications.css"
- config.assets.precompile << "page_bundles/oncall_schedules.css"
- config.assets.precompile << "page_bundles/operations.css"
- config.assets.precompile << "page_bundles/escalation_policies.css"
- config.assets.precompile << "page_bundles/pipeline.css"
- config.assets.precompile << "page_bundles/pipeline_schedules.css"
- config.assets.precompile << "page_bundles/pipelines.css"
- config.assets.precompile << "page_bundles/pipeline_editor.css"
- config.assets.precompile << "page_bundles/productivity_analytics.css"
- config.assets.precompile << "page_bundles/profile.css"
- config.assets.precompile << "page_bundles/profile_two_factor_auth.css"
- config.assets.precompile << "page_bundles/profiles/preferences.css"
- config.assets.precompile << "page_bundles/project.css"
- config.assets.precompile << "page_bundles/projects_edit.css"
- config.assets.precompile << "page_bundles/prometheus.css"
- config.assets.precompile << "page_bundles/releases.css"
- config.assets.precompile << "page_bundles/reports.css"
- config.assets.precompile << "page_bundles/roadmap.css"
- config.assets.precompile << "page_bundles/requirements.css"
- config.assets.precompile << "page_bundles/runner_details.css"
- config.assets.precompile << "page_bundles/search.css"
- config.assets.precompile << "page_bundles/security_dashboard.css"
- config.assets.precompile << "page_bundles/security_discover.css"
- config.assets.precompile << "page_bundles/settings.css"
- config.assets.precompile << "page_bundles/signup.css"
- config.assets.precompile << "page_bundles/terminal.css"
- config.assets.precompile << "page_bundles/terms.css"
- config.assets.precompile << "page_bundles/todos.css"
- config.assets.precompile << "page_bundles/tree.css"
- config.assets.precompile << "page_bundles/users.css"
- config.assets.precompile << "page_bundles/wiki.css"
- config.assets.precompile << "page_bundles/work_items.css"
- config.assets.precompile << "page_bundles/xterm.css"
- config.assets.precompile << "lazy_bundles/cropper.css"
- config.assets.precompile << "lazy_bundles/select2.css"
- config.assets.precompile << "lazy_bundles/gridstack.css"
- config.assets.precompile << "performance_bar.css"
- config.assets.precompile << "disable_animations.css"
- config.assets.precompile << "test_environment.css"
- config.assets.precompile << "snippets.css"
- config.assets.precompile << "fonts.css"
- config.assets.precompile << "locale/**/app.js"
- config.assets.precompile << "emoji_sprites.css"
- config.assets.precompile << "errors.css"
- config.assets.precompile << "jira_connect.js"
-
- config.assets.precompile << "themes/*.css"
-
- config.assets.precompile << "highlight/themes/*.css"
- config.assets.precompile << "highlight/diff_custom_colors_addition.css"
- config.assets.precompile << "highlight/diff_custom_colors_deletion.css"
-
- # Import woff2 for fonts
- config.assets.paths << "#{config.root}/node_modules/@gitlab/fonts/"
- config.assets.precompile << "gitlab-sans/*.woff2"
- config.assets.precompile << "jetbrains-mono/*.woff2"
# Import gitlab-svgs directly from vendored directory
config.assets.paths << "#{config.root}/node_modules/@gitlab/svgs/dist"
- config.assets.paths << "#{config.root}/node_modules/@jihulab/svgs/dist" if Gitlab.jh?
- config.assets.precompile << "illustrations/jh/*.svg" if Gitlab.jh?
- config.assets.precompile << "icons.svg"
- config.assets.precompile << "icons.json"
- config.assets.precompile << "illustrations/*.svg"
- config.assets.precompile << "illustrations/*.png"
-
- # Import css for xterm
- config.assets.paths << "#{config.root}/node_modules/xterm/src/"
- config.assets.precompile << "xterm.css"
-
- # Import path for EE specific SCSS entry point
+
+ config.assets.paths << "#{config.root}/node_modules/@gitlab/fonts"
+
+ # BEGIN Import path for EE/JH specific SCSS entry point
# In CE it will import a noop file, in EE a functioning file
# Order is important, so that the ee file takes precedence:
- config.assets.paths << "#{config.root}/jh/app/assets/stylesheets/_jh" if Gitlab.jh?
- config.assets.paths << "#{config.root}/ee/app/assets/stylesheets/_ee" if Gitlab.ee?
+ if Gitlab.jh?
+ config.assets.precompile << "#{config.root}/jh/app/assets/config/jh.js"
+ config.assets.paths << "#{config.root}/jh/app/assets"
+ config.assets.paths << "#{config.root}/jh/app/assets/stylesheets/_jh"
+ end
+
+ if Gitlab.ee?
+ config.assets.precompile << "#{config.root}/ee/app/assets/config/ee.js"
+ config.assets.paths << "#{config.root}/ee/app/assets"
+ config.assets.paths << "#{config.root}/ee/app/assets/stylesheets/_ee"
+ end
+
config.assets.paths << "#{config.root}/app/assets/stylesheets/_jh"
config.assets.paths << "#{config.root}/app/assets/stylesheets/_ee"
+ # END Import path for EE/JH specific SCSS entry point
config.assets.paths << "#{config.root}/vendor/assets/javascripts/"
- config.assets.precompile << "snowplow/sp.js"
# This path must come last to avoid confusing sprockets
# See https://gitlab.com/gitlab-org/gitlab-foss/issues/64091#note_194512508
@@ -501,42 +388,6 @@ module Gitlab
config.factory_bot.definition_file_paths << 'jh/spec/factories' if Gitlab.jh?
end
- # sprocket-rails adds some precompile assets we actually do not need.
- #
- # It copies all _non_ js and CSS files from the app/assets/ older.
- #
- # In our case this copies for example: Vue, Markdown and Graphql, which we do not need
- # for production.
- #
- # We remove this default behavior and then reimplement it in order to consider ee/ as well
- # and remove those other files we do not need.
- #
- # For reference: https://github.com/rails/sprockets-rails/blob/v3.2.1/lib/sprockets/railtie.rb#L84-L87
- initializer :correct_precompile_targets, after: :set_default_precompile do |app|
- app.config.assets.precompile.reject! { |entry| entry == Sprockets::Railtie::LOOSE_APP_ASSETS }
-
- # if two files in assets are named the same, it'll likely resolve to the normal app/assets version.
- # See https://gitlab.com/gitlab-jh/gitlab/-/merge_requests/27#note_609101582 for more details
- asset_roots = []
-
- if Gitlab.jh?
- asset_roots << config.root.join("jh/app/assets").to_s
- end
-
- asset_roots << config.root.join("app/assets").to_s
-
- if Gitlab.ee?
- asset_roots << config.root.join("ee/app/assets").to_s
- end
-
- LOOSE_APP_ASSETS = lambda do |logical_path, filename|
- filename.start_with?(*asset_roots) &&
- !['.js', '.css', '.md', '.vue', '.graphql', ''].include?(File.extname(logical_path))
- end
-
- app.config.assets.precompile << LOOSE_APP_ASSETS
- end
-
# This empty initializer forces the :let_zeitwerk_take_over initializer to run before we load
# initializers in config/initializers. This is done because autoloading before Zeitwerk takes
# over is deprecated but our initializers do a lot of autoloading.
diff --git a/config/feature_flags/development/hash_oauth_secrets.yml b/config/feature_flags/development/hash_oauth_secrets.yml
index 7730d319bab..4f42dc6883c 100644
--- a/config/feature_flags/development/hash_oauth_secrets.yml
+++ b/config/feature_flags/development/hash_oauth_secrets.yml
@@ -1,8 +1,8 @@
---
name: hash_oauth_secrets
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96252
-rollout_issue_url:
+rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/374588
milestone: '15.4'
type: development
group: group::authentication and authorization
-default_enabled: false
+default_enabled: true
diff --git a/data/deprecations/15-8-deprecate-backups-support-for-openstack-rackspace-apis.yml b/data/deprecations/15-8-deprecate-backups-support-for-openstack-rackspace-apis.yml
new file mode 100644
index 00000000000..0097f59d1f9
--- /dev/null
+++ b/data/deprecations/15-8-deprecate-backups-support-for-openstack-rackspace-apis.yml
@@ -0,0 +1,13 @@
+- title: "Automatic backup upload using Openstack Swift and Rackspace APIs" # (required) The name of the feature to be deprecated
+ announcement_milestone: "15.8" # (required) The milestone when this feature was first announced as deprecated.
+ removal_milestone: "15.10" # (required) The milestone when this feature is planned to be removed
+ end_of_support_milestone: "15.10" # (optional) Use "XX.YY" format. The milestone when support for this feature will end.
+ breaking_change: true # (required) If this deprecation is a breaking change, set this value to true
+ reporter: sranasinghe # (required) GitLab username of the person reporting the deprecation
+ stage: Enablement # (required) String value of the stage that the feature was created in. e.g., Growth
+ issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/387976 # (required) Link to the deprecation issue in GitLab
+ body: | # (required) Do not modify this line, instead modify the lines below.
+ We are deprecating support for [uploading backups to remote storage](https://docs.gitlab.com/ee/raketasks/backup_gitlab.html#upload-backups-to-a-remote-cloud-storage) using Openstack Swift and Rackspace APIs. The support for these APIs depends on third-party libraries that are no longer actively maintained and have not been updated for Ruby 3. GitLab is switching over to Ruby 3 prior to EOL of Ruby 2 in order to stay up to date on security patches.
+
+ - If you're using OpenStack, you need to change you configuration to use the S3 API instead of Swift.
+ - If you're using Rackspace storage, you need to switch to a different provider or manually upload the backup file after the backup task is complete.
diff --git a/doc/api/import.md b/doc/api/import.md
index 407f1974f7d..67ee7bc60a1 100644
--- a/doc/api/import.md
+++ b/doc/api/import.md
@@ -122,11 +122,12 @@ Returns the following status codes:
## Import GitHub gists into GitLab snippets
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/371099) in GitLab 15.8 [with a flag](../administration/feature_flags.md) named `github_import_gists`. Disabled by default.
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/371099) in GitLab 15.8 [with a flag](../administration/feature_flags.md) named `github_import_gists`. Disabled by default. Enabled on GitLab.com.
FLAG:
On self-managed GitLab, by default this feature is not available. To make it available,
ask an administrator to [enable the feature flag](../administration/feature_flags.md) named `github_import_gists`.
+On GitLab.com, this feature is available.
You can use the GitLab API to import personal GitHub gists (with up to 10 files) into personal GitLab snippets.
GitHub gists with more than 10 files are skipped. You should manually migrate these GitHub gists.
diff --git a/doc/integration/oauth_provider.md b/doc/integration/oauth_provider.md
index d738796def1..1c7b3f1f560 100644
--- a/doc/integration/oauth_provider.md
+++ b/doc/integration/oauth_provider.md
@@ -124,13 +124,14 @@ When applications are deleted, all grants and tokens associated with the applica
## Hashed OAuth application secrets
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/374588) in GitLab 15.4 [with a flag](../administration/feature_flags.md) named `hash_oauth_secrets`. Disabled by default.
-> - [Enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/374588) in GitLab 15.8.
+> - [Enabled on GitLab.com and self-managed](https://gitlab.com/gitlab-org/gitlab/-/issues/374588) in GitLab 15.8.
FLAG:
-On self-managed GitLab, by default, this feature is not available. To make it available, ask an administrator to [enable the feature flag](../administration/feature_flags.md) named `hash_oauth_secrets`.
+On self-managed GitLab, by default this feature is available. To hide the feature, ask an administrator to [disable the feature flag](../administration/feature_flags.md) named `hash_oauth_secrets`.
On GitLab.com, this feature is available.
-By default, OAuth application secrets are stored as plain text in the database. When enabled, OAuth application secrets are stored in the database in hashed format and are only available to users immediately after creating OAuth applications.
+By default, GitLab stores OAuth application secrets in the database in hashed format. These secrets are only available to users immediately after creating OAuth applications. In
+earlier versions of GitLab, application secrets are stored as plain text in the database.
## Other ways to use OAuth 2 in GitLab
diff --git a/doc/raketasks/backup_gitlab.md b/doc/raketasks/backup_gitlab.md
index 771120df1c3..ffa67c6b4a9 100644
--- a/doc/raketasks/backup_gitlab.md
+++ b/doc/raketasks/backup_gitlab.md
@@ -416,6 +416,9 @@ GitLab also [imports cloud drivers](https://gitlab.com/gitlab-org/gitlab/-/blob/
for AWS, Google, OpenStack Swift, Rackspace, and Aliyun. A local driver is
[also available](#upload-to-locally-mounted-shares).
+NOTE:
+Support for Openstack Swift and Rackspace APIs will be removed in GitLab 15.10. See [issue #387976](https://gitlab.com/gitlab-org/gitlab/-/issues/387976) for more information.
+
[Read more about using object storage with GitLab](../administration/object_storage.md).
#### Using Amazon S3
diff --git a/doc/update/deprecations.md b/doc/update/deprecations.md
index ee6d241ae93..3dc6a1e252c 100644
--- a/doc/update/deprecations.md
+++ b/doc/update/deprecations.md
@@ -99,6 +99,24 @@ Because Cloud Native Buildpacks do not support automatic testing, the Auto Test
</div>
+<div class="deprecation removal-1510 breaking-change">
+
+### Automatic backup upload using Openstack Swift and Rackspace APIs
+
+End of Support: GitLab <span class="removal-milestone">15.10</span> <span class="support-end-date"></span><br />
+Planned removal: GitLab <span class="removal-milestone">15.10</span> <span class="removal-date"></span>
+
+WARNING:
+This is a [breaking change](https://docs.gitlab.com/ee/development/deprecation_guidelines/).
+Review the details carefully before upgrading.
+
+We are deprecating support for [uploading backups to remote storage](https://docs.gitlab.com/ee/raketasks/backup_gitlab.html#upload-backups-to-a-remote-cloud-storage) using Openstack Swift and Rackspace APIs. The support for these APIs depends on third-party libraries that are no longer actively maintained and have not been updated for Ruby 3. GitLab is switching over to Ruby 3 prior to EOL of Ruby 2 in order to stay up to date on security patches.
+
+- If you're using OpenStack, you need to change you configuration to use the S3 API instead of Swift.
+- If you're using Rackspace storage, you need to switch to a different provider or manually upload the backup file after the backup task is complete.
+
+</div>
+
<div class="deprecation removal-160 breaking-change">
### Azure Storage Driver defaults to the correct root prefix
diff --git a/doc/update/index.md b/doc/update/index.md
index 6b0e6a16b7a..0b7d62225a2 100644
--- a/doc/update/index.md
+++ b/doc/update/index.md
@@ -237,6 +237,8 @@ Edition, follow the guides below based on the installation method:
GitLab Community Edition to the Enterprise Edition.
- [Docker CE to EE](../install/docker.md#convert-community-edition-to-enterprise-edition) -
Follow this guide to update your GitLab Community Edition container to an Enterprise Edition container.
+- [Helm chart (Kubernetes) CE to EE](https://docs.gitlab.com/charts/installation/deployment.html#convert-community-edition-to-enterprise-edition) -
+ Follow this guide to update your GitLab Community Edition Helm deployment to Enterprise Edition.
### Enterprise to Community Edition
diff --git a/qa/qa/fixtures/package_managers/helm/helm_install_package.yaml.erb b/qa/qa/fixtures/package_managers/helm/helm_install_package.yaml.erb
index 590120ce7b2..f4efbebe264 100644
--- a/qa/qa/fixtures/package_managers/helm/helm_install_package.yaml.erb
+++ b/qa/qa/fixtures/package_managers/helm/helm_install_package.yaml.erb
@@ -1,6 +1,7 @@
pull:
- image: dtzar/helm-kubectl:latest
+ image: alpine:latest
script:
+ - apk add helm --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing
- helm repo add --username <%= username %> --password <%= access_token %> gitlab_qa ${CI_API_V4_URL}/projects/<%= package_project.id %>/packages/helm/stable
- helm repo update
- helm pull gitlab_qa/<%= package_name %>
diff --git a/qa/qa/fixtures/package_managers/helm/helm_upload_package.yaml.erb b/qa/qa/fixtures/package_managers/helm/helm_upload_package.yaml.erb
index b1c275cd96a..cd218fcc4a2 100644
--- a/qa/qa/fixtures/package_managers/helm/helm_upload_package.yaml.erb
+++ b/qa/qa/fixtures/package_managers/helm/helm_upload_package.yaml.erb
@@ -1,6 +1,7 @@
deploy:
- image: dtzar/helm-kubectl:latest
+ image: alpine:latest
script:
+ - apk add helm --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing
- apk add curl
- helm create <%= package_name %>
- cp ./Chart.yaml <%= package_name %>
diff --git a/spec/frontend/add_context_commits_modal/store/actions_spec.js b/spec/frontend/add_context_commits_modal/store/actions_spec.js
index 4b58a69c2b8..77666e922ff 100644
--- a/spec/frontend/add_context_commits_modal/store/actions_spec.js
+++ b/spec/frontend/add_context_commits_modal/store/actions_spec.js
@@ -16,6 +16,7 @@ import {
} from '~/add_context_commits_modal/store/actions';
import * as types from '~/add_context_commits_modal/store/mutation_types';
import axios from '~/lib/utils/axios_utils';
+import { HTTP_STATUS_NO_CONTENT } from '~/lib/utils/http_status';
describe('AddContextCommitsModalStoreActions', () => {
const contextCommitEndpoint =
@@ -156,7 +157,7 @@ describe('AddContextCommitsModalStoreActions', () => {
beforeEach(() => {
mock
.onDelete('/api/v4/projects/gitlab-org%2Fgitlab/merge_requests/1/context_commits')
- .reply(204);
+ .reply(HTTP_STATUS_NO_CONTENT);
});
it('calls API to remove context commits', () => {
return testAction(
diff --git a/spec/frontend/api/alert_management_alerts_api_spec.js b/spec/frontend/api/alert_management_alerts_api_spec.js
index aac14e64286..c8da867e573 100644
--- a/spec/frontend/api/alert_management_alerts_api_spec.js
+++ b/spec/frontend/api/alert_management_alerts_api_spec.js
@@ -1,6 +1,7 @@
import MockAdapter from 'axios-mock-adapter';
import * as alertManagementAlertsApi from '~/api/alert_management_alerts_api';
import axios from '~/lib/utils/axios_utils';
+import { HTTP_STATUS_CREATED, HTTP_STATUS_NO_CONTENT } from '~/lib/utils/http_status';
describe('~/api/alert_management_alerts_api.js', () => {
let mock;
@@ -60,7 +61,7 @@ describe('~/api/alert_management_alerts_api.js', () => {
expectedFormData.append('url', url);
expectedFormData.append('url_text', urlText);
- mock.onPost(expectedUrl).reply(201, { data: expectedData });
+ mock.onPost(expectedUrl).reply(HTTP_STATUS_CREATED, { data: expectedData });
return alertManagementAlertsApi
.uploadAlertMetricImage({
@@ -123,7 +124,7 @@ describe('~/api/alert_management_alerts_api.js', () => {
const expectedUrl = `/api/v4/projects/${projectId}/alert_management_alerts/${alertIid}/metric_images/${imageIid}`;
const expectedData = [imageData];
- mock.onDelete(expectedUrl).reply(204, { data: expectedData });
+ mock.onDelete(expectedUrl).reply(HTTP_STATUS_NO_CONTENT, { data: expectedData });
return alertManagementAlertsApi
.deleteAlertMetricImage({
diff --git a/spec/frontend/api_spec.js b/spec/frontend/api_spec.js
index 39fbe02480d..f382a407c67 100644
--- a/spec/frontend/api_spec.js
+++ b/spec/frontend/api_spec.js
@@ -1004,7 +1004,7 @@ describe('Api', () => {
jest.spyOn(axios, 'delete');
- mock.onDelete(expectedUrl).replyOnce(204);
+ mock.onDelete(expectedUrl).replyOnce(HTTP_STATUS_NO_CONTENT);
return Api.removeContextCommits(projectPath, mergeRequestId, expectedData).then(() => {
expect(axios.delete).toHaveBeenCalledWith(expectedUrl, { data: expectedData });
diff --git a/spec/frontend/ci/reports/codequality_report/store/actions_spec.js b/spec/frontend/ci/reports/codequality_report/store/actions_spec.js
index 88628210793..5d55cddb559 100644
--- a/spec/frontend/ci/reports/codequality_report/store/actions_spec.js
+++ b/spec/frontend/ci/reports/codequality_report/store/actions_spec.js
@@ -2,6 +2,11 @@ import MockAdapter from 'axios-mock-adapter';
import testAction from 'helpers/vuex_action_helper';
import { TEST_HOST } from 'spec/test_constants';
import axios from '~/lib/utils/axios_utils';
+import {
+ HTTP_STATUS_INTERNAL_SERVER_ERROR,
+ HTTP_STATUS_NO_CONTENT,
+ HTTP_STATUS_OK,
+} from '~/lib/utils/http_status';
import createStore from '~/ci/reports/codequality_report/store';
import * as actions from '~/ci/reports/codequality_report/store/actions';
import * as types from '~/ci/reports/codequality_report/store/mutation_types';
@@ -105,9 +110,9 @@ describe('Codequality Reports actions', () => {
it('continues polling until it receives data', () => {
mock
.onGet(endpoint)
- .replyOnce(204, undefined, pollIntervalHeader)
+ .replyOnce(HTTP_STATUS_NO_CONTENT, undefined, pollIntervalHeader)
.onGet(endpoint)
- .reply(200, reportIssues);
+ .reply(HTTP_STATUS_OK, reportIssues);
return Promise.all([
testAction(
@@ -134,9 +139,9 @@ describe('Codequality Reports actions', () => {
it('continues polling until it receives an error', () => {
mock
.onGet(endpoint)
- .replyOnce(204, undefined, pollIntervalHeader)
+ .replyOnce(HTTP_STATUS_NO_CONTENT, undefined, pollIntervalHeader)
.onGet(endpoint)
- .reply(500);
+ .reply(HTTP_STATUS_INTERNAL_SERVER_ERROR);
return Promise.all([
testAction(
diff --git a/spec/frontend/error_tracking/store/details/actions_spec.js b/spec/frontend/error_tracking/store/details/actions_spec.js
index 1893d226270..6248bef9dcd 100644
--- a/spec/frontend/error_tracking/store/details/actions_spec.js
+++ b/spec/frontend/error_tracking/store/details/actions_spec.js
@@ -4,6 +4,7 @@ import * as actions from '~/error_tracking/store/details/actions';
import * as types from '~/error_tracking/store/details/mutation_types';
import { createAlert } from '~/flash';
import axios from '~/lib/utils/axios_utils';
+import { HTTP_STATUS_NO_CONTENT } from '~/lib/utils/http_status';
import Poll from '~/lib/utils/poll';
let mockedAdapter;
@@ -58,7 +59,7 @@ describe('Sentry error details store actions', () => {
it('should not restart polling when receiving an empty 204 response', async () => {
mockedRestart = jest.spyOn(Poll.prototype, 'restart');
- mockedAdapter.onGet().reply(204);
+ mockedAdapter.onGet().reply(HTTP_STATUS_NO_CONTENT);
await testAction(actions.startPollingStacktrace, { endpoint }, {}, [], []);
mockedRestart = jest.spyOn(Poll.prototype, 'restart');
diff --git a/spec/frontend/import_entities/import_projects/store/actions_spec.js b/spec/frontend/import_entities/import_projects/store/actions_spec.js
index 5607eee9f43..53de714c9e2 100644
--- a/spec/frontend/import_entities/import_projects/store/actions_spec.js
+++ b/spec/frontend/import_entities/import_projects/store/actions_spec.js
@@ -21,7 +21,7 @@ import {
import state from '~/import_entities/import_projects/store/state';
import axios from '~/lib/utils/axios_utils';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
-import { HTTP_STATUS_OK } from '~/lib/utils/http_status';
+import { HTTP_STATUS_OK, HTTP_STATUS_TOO_MANY_REQUESTS } from '~/lib/utils/http_status';
jest.mock('~/flash');
@@ -216,7 +216,7 @@ describe('import_projects store actions', () => {
describe('when rate limited', () => {
it('commits RECEIVE_REPOS_ERROR and shows rate limited error message', async () => {
- mock.onGet(`${TEST_HOST}/endpoint.json?filter=filter`).reply(429);
+ mock.onGet(`${TEST_HOST}/endpoint.json?filter=filter`).reply(HTTP_STATUS_TOO_MANY_REQUESTS);
await testAction(
fetchRepos,
diff --git a/spec/frontend/issuable/related_issues/components/related_issues_root_spec.js b/spec/frontend/issuable/related_issues/components/related_issues_root_spec.js
index bedf8bcaf34..313bc464f11 100644
--- a/spec/frontend/issuable/related_issues/components/related_issues_root_spec.js
+++ b/spec/frontend/issuable/related_issues/components/related_issues_root_spec.js
@@ -9,6 +9,7 @@ import {
} from 'jest/issuable/components/related_issuable_mock_data';
import { createAlert } from '~/flash';
import axios from '~/lib/utils/axios_utils';
+import { HTTP_STATUS_CONFLICT, HTTP_STATUS_UNPROCESSABLE_ENTITY } from '~/lib/utils/http_status';
import { linkedIssueTypesMap } from '~/related_issues/constants';
import RelatedIssuesBlock from '~/related_issues/components/related_issues_block.vue';
import RelatedIssuesRoot from '~/related_issues/components/related_issues_root.vue';
@@ -68,7 +69,7 @@ describe('RelatedIssuesRoot', () => {
});
it('does not remove related issue on API error', async () => {
- mock.onDelete(issuable1.referencePath).reply(422, {});
+ mock.onDelete(issuable1.referencePath).reply(HTTP_STATUS_UNPROCESSABLE_ENTITY, {});
findRelatedIssuesBlock().vm.$emit('relatedIssueRemoveRequest', issuable1.id);
await axios.waitForAll();
@@ -204,7 +205,7 @@ describe('RelatedIssuesRoot', () => {
it('passes an error message from the backend upon error', async () => {
const input = '#123';
const message = 'error';
- mock.onPost(defaultProps.endpoint).reply(409, { message });
+ mock.onPost(defaultProps.endpoint).reply(HTTP_STATUS_CONFLICT, { message });
wrapper.vm.store.setPendingReferences([issuable1.reference, issuable2.reference]);
expect(findRelatedIssuesBlock().props('hasError')).toBe(false);
diff --git a/spec/frontend/merge_request_spec.js b/spec/frontend/merge_request_spec.js
index 16e3e49a297..7333ce345eb 100644
--- a/spec/frontend/merge_request_spec.js
+++ b/spec/frontend/merge_request_spec.js
@@ -5,6 +5,7 @@ import { TEST_HOST } from 'spec/test_constants';
import waitForPromises from 'helpers/wait_for_promises';
import { createAlert } from '~/flash';
import axios from '~/lib/utils/axios_utils';
+import { HTTP_STATUS_CONFLICT } from '~/lib/utils/http_status';
import MergeRequest from '~/merge_request';
jest.mock('~/flash');
@@ -89,7 +90,7 @@ describe('MergeRequest', () => {
it('shows an error notification when tasklist update failed', async () => {
mock
.onPatch(`${TEST_HOST}/frontend-fixtures/merge-requests-project/-/merge_requests/1.json`)
- .reply(409, {});
+ .reply(HTTP_STATUS_CONFLICT, {});
$('.js-task-list-field').trigger({
type: 'tasklist:changed',
diff --git a/spec/frontend/notes/components/comment_form_spec.js b/spec/frontend/notes/components/comment_form_spec.js
index e13985ef469..dfb05c85fc8 100644
--- a/spec/frontend/notes/components/comment_form_spec.js
+++ b/spec/frontend/notes/components/comment_form_spec.js
@@ -10,6 +10,7 @@ import batchComments from '~/batch_comments/stores/modules/batch_comments';
import { refreshUserMergeRequestCounts } from '~/commons/nav/user_merge_requests';
import { createAlert } from '~/flash';
import axios from '~/lib/utils/axios_utils';
+import { HTTP_STATUS_UNPROCESSABLE_ENTITY } from '~/lib/utils/http_status';
import CommentForm from '~/notes/components/comment_form.vue';
import CommentTypeDropdown from '~/notes/components/comment_type_dropdown.vue';
import * as constants from '~/notes/constants';
@@ -162,11 +163,11 @@ describe('issue_comment_form component', () => {
});
it.each`
- httpStatus | errors
- ${400} | ${[COMMENT_FORM.GENERIC_UNSUBMITTABLE_NETWORK]}
- ${422} | ${['error 1']}
- ${422} | ${['error 1', 'error 2']}
- ${422} | ${['error 1', 'error 2', 'error 3']}
+ httpStatus | errors
+ ${400} | ${[COMMENT_FORM.GENERIC_UNSUBMITTABLE_NETWORK]}
+ ${HTTP_STATUS_UNPROCESSABLE_ENTITY} | ${['error 1']}
+ ${HTTP_STATUS_UNPROCESSABLE_ENTITY} | ${['error 1', 'error 2']}
+ ${HTTP_STATUS_UNPROCESSABLE_ENTITY} | ${['error 1', 'error 2', 'error 3']}
`(
'displays the correct errors ($errors) for a $httpStatus network response',
async ({ errors, httpStatus }) => {
@@ -198,7 +199,10 @@ describe('issue_comment_form component', () => {
store = createStore({
actions: {
saveNote: jest.fn().mockRejectedValue({
- response: { status: 422, data: { errors: { commands_only: [...commandErrors] } } },
+ response: {
+ status: HTTP_STATUS_UNPROCESSABLE_ENTITY,
+ data: { errors: { commands_only: [...commandErrors] } },
+ },
}),
},
});
diff --git a/spec/frontend/notes/stores/actions_spec.js b/spec/frontend/notes/stores/actions_spec.js
index 0b2623f3d77..425facd1406 100644
--- a/spec/frontend/notes/stores/actions_spec.js
+++ b/spec/frontend/notes/stores/actions_spec.js
@@ -7,6 +7,7 @@ import { createAlert } from '~/flash';
import toast from '~/vue_shared/plugins/global_toast';
import { EVENT_ISSUABLE_VUE_APP_CHANGE } from '~/issuable/constants';
import axios from '~/lib/utils/axios_utils';
+import { HTTP_STATUS_SERVICE_UNAVAILABLE } from '~/lib/utils/http_status';
import * as notesConstants from '~/notes/constants';
import createStore from '~/notes/stores';
import * as actions from '~/notes/stores/actions';
@@ -1208,7 +1209,7 @@ describe('Actions Notes Store', () => {
describe('if response contains errors', () => {
const errorMessage = 'Request failed with status code 503';
it('dispatches receiveDeleteDescriptionVersionError and throws an error', async () => {
- axiosMock.onDelete(endpoint).replyOnce(503);
+ axiosMock.onDelete(endpoint).replyOnce(HTTP_STATUS_SERVICE_UNAVAILABLE);
await expect(
testAction(
actions.softDeleteDescriptionVersion,
diff --git a/spec/frontend/packages_and_registries/dependency_proxy/app_spec.js b/spec/frontend/packages_and_registries/dependency_proxy/app_spec.js
index 329cc15df97..601f8abd34d 100644
--- a/spec/frontend/packages_and_registries/dependency_proxy/app_spec.js
+++ b/spec/frontend/packages_and_registries/dependency_proxy/app_spec.js
@@ -17,6 +17,7 @@ import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import waitForPromises from 'helpers/wait_for_promises';
import { GRAPHQL_PAGE_SIZE } from '~/packages_and_registries/dependency_proxy/constants';
import axios from '~/lib/utils/axios_utils';
+import { HTTP_STATUS_ACCEPTED } from '~/lib/utils/http_status';
import DependencyProxyApp from '~/packages_and_registries/dependency_proxy/app.vue';
import TitleArea from '~/vue_shared/components/registry/title_area.vue';
@@ -92,7 +93,7 @@ describe('DependencyProxyApp', () => {
window.gon = { ...dummyGon };
mock = new MockAdapter(axios);
- mock.onDelete(expectedUrl).reply(202, {});
+ mock.onDelete(expectedUrl).reply(HTTP_STATUS_ACCEPTED, {});
});
afterEach(() => {
diff --git a/spec/frontend/projects/settings/components/shared_runners_toggle_spec.js b/spec/frontend/projects/settings/components/shared_runners_toggle_spec.js
index dfaa1944cbe..f82ad80135e 100644
--- a/spec/frontend/projects/settings/components/shared_runners_toggle_spec.js
+++ b/spec/frontend/projects/settings/components/shared_runners_toggle_spec.js
@@ -4,7 +4,7 @@ import MockAxiosAdapter from 'axios-mock-adapter';
import { nextTick } from 'vue';
import waitForPromises from 'helpers/wait_for_promises';
import axios from '~/lib/utils/axios_utils';
-import { HTTP_STATUS_OK } from '~/lib/utils/http_status';
+import { HTTP_STATUS_OK, HTTP_STATUS_UNAUTHORIZED } from '~/lib/utils/http_status';
import SharedRunnersToggleComponent from '~/projects/settings/components/shared_runners_toggle.vue';
const TEST_UPDATE_PATH = '/test/update_shared_runners';
@@ -133,7 +133,9 @@ describe('projects/settings/components/shared_runners', () => {
describe('when request encounters an error', () => {
it('should show custom error message from API if it exists', async () => {
- mockAxios.onPost(TEST_UPDATE_PATH).reply(401, { error: 'Custom API Error message' });
+ mockAxios
+ .onPost(TEST_UPDATE_PATH)
+ .reply(HTTP_STATUS_UNAUTHORIZED, { error: 'Custom API Error message' });
createComponent();
expect(getToggleValue()).toBe(false);
@@ -145,7 +147,7 @@ describe('projects/settings/components/shared_runners', () => {
});
it('should show default error message if API does not return a custom error message', async () => {
- mockAxios.onPost(TEST_UPDATE_PATH).reply(401);
+ mockAxios.onPost(TEST_UPDATE_PATH).reply(HTTP_STATUS_UNAUTHORIZED);
createComponent();
expect(getToggleValue()).toBe(false);
diff --git a/spec/frontend/vue_merge_request_widget/mr_widget_options_spec.js b/spec/frontend/vue_merge_request_widget/mr_widget_options_spec.js
index a2d7f373c66..824d0d012fb 100644
--- a/spec/frontend/vue_merge_request_widget/mr_widget_options_spec.js
+++ b/spec/frontend/vue_merge_request_widget/mr_widget_options_spec.js
@@ -11,7 +11,7 @@ import waitForPromises from 'helpers/wait_for_promises';
import { securityReportMergeRequestDownloadPathsQueryResponse } from 'jest/vue_shared/security_reports/mock_data';
import api from '~/api';
import axios from '~/lib/utils/axios_utils';
-import { HTTP_STATUS_OK } from '~/lib/utils/http_status';
+import { HTTP_STATUS_OK, HTTP_STATUS_NO_CONTENT } from '~/lib/utils/http_status';
import Poll from '~/lib/utils/poll';
import { setFaviconOverlay } from '~/lib/utils/favicon';
import notify from '~/lib/utils/notify';
@@ -1010,7 +1010,7 @@ describe('MrWidgetOptions', () => {
() =>
Promise.resolve({
headers: { 'poll-interval': 1 },
- status: 204,
+ status: HTTP_STATUS_NO_CONTENT,
}),
() =>
Promise.resolve({
diff --git a/spec/frontend/vue_merge_request_widget/stores/artifacts_list/actions_spec.js b/spec/frontend/vue_merge_request_widget/stores/artifacts_list/actions_spec.js
index 1a109aad911..c77c1a1347d 100644
--- a/spec/frontend/vue_merge_request_widget/stores/artifacts_list/actions_spec.js
+++ b/spec/frontend/vue_merge_request_widget/stores/artifacts_list/actions_spec.js
@@ -2,6 +2,7 @@ import MockAdapter from 'axios-mock-adapter';
import { TEST_HOST } from 'helpers/test_constants';
import testAction from 'helpers/vuex_action_helper';
import axios from '~/lib/utils/axios_utils';
+import { HTTP_STATUS_NO_CONTENT } from '~/lib/utils/http_status';
import {
setEndpoint,
requestArtifacts,
@@ -136,7 +137,7 @@ describe('Artifacts App Store Actions', () => {
it('should not commit RECEIVE_ARTIFACTS_SUCCESS mutation with 204', () => {
return testAction(
receiveArtifactsSuccess,
- { data: { summary: {} }, status: 204 },
+ { data: { summary: {} }, status: HTTP_STATUS_NO_CONTENT },
mockedState,
[],
[],