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>2022-09-29 00:07:58 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-09-29 00:07:58 +0300
commitfcfe959a5ddee652a27e6b1179a116fdbb70986b (patch)
tree4dbcf2a93aaaf4952507207168c582f5948efaa3
parent7f3f19582b13b4162212bcf0ae72eef63685ffbc (diff)
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--.rubocop_todo/layout/first_array_element_indentation.yml15
-rw-r--r--GITLAB_SHELL_VERSION2
-rw-r--r--app/assets/javascripts/pages/projects/pipeline_schedules/edit/index.js7
-rw-r--r--app/assets/javascripts/pages/projects/pipeline_schedules/index/index.js15
-rw-r--r--app/assets/javascripts/pages/projects/pipeline_schedules/new/index.js7
-rw-r--r--app/assets/javascripts/pipeline_schedules/components/pipeline_schedules.vue20
-rw-r--r--app/assets/javascripts/pipeline_schedules/components/pipeline_schedules_form.vue18
-rw-r--r--app/assets/javascripts/pipeline_schedules/components/table/pipeline_schedules_table.vue13
-rw-r--r--app/assets/javascripts/pipeline_schedules/mount_pipeline_schedules_app.js32
-rw-r--r--app/assets/javascripts/pipeline_schedules/mount_pipeline_schedules_form_app.js32
-rw-r--r--app/controllers/projects/pipeline_schedules_controller.rb5
-rw-r--r--app/helpers/selects_helper.rb5
-rw-r--r--app/mailers/emails/profile.rb12
-rw-r--r--app/services/notification_service.rb7
-rw-r--r--app/services/personal_access_tokens/revoke_service.rb3
-rw-r--r--app/views/notify/access_token_revoked_email.html.haml7
-rw-r--r--app/views/notify/access_token_revoked_email.text.erb5
-rw-r--r--app/views/projects/pipeline_schedules/edit.html.haml5
-rw-r--r--app/views/projects/pipeline_schedules/index.html.haml34
-rw-r--r--app/views/projects/pipeline_schedules/new.html.haml5
-rw-r--r--config/feature_flags/development/pipeline_schedules_vue.yml8
-rw-r--r--doc/administration/auth/oidc.md11
-rw-r--r--doc/development/database/batched_background_migrations.md40
-rw-r--r--lib/api/helpers.rb8
-rw-r--r--lib/gitlab/email/message/in_product_marketing/trial.rb10
-rw-r--r--locale/gitlab.pot15
-rw-r--r--qa/qa/specs/features/api/1_manage/import_large_github_repo_spec.rb9
-rw-r--r--qa/qa/specs/features/browser_ui/2_plan/issue/custom_issue_template_spec.rb13
-rw-r--r--spec/controllers/concerns/send_file_upload_spec.rb7
-rw-r--r--spec/features/projects/pipeline_schedules_spec.rb4
-rw-r--r--spec/features/projects/pipelines/legacy_pipeline_spec.rb2
-rw-r--r--spec/features/projects/pipelines/pipeline_spec.rb2
-rw-r--r--spec/frontend/pipeline_schedules/components/pipeline_schedules_form_spec.js25
-rw-r--r--spec/frontend/pipeline_schedules/components/pipeline_schedules_spec.js25
-rw-r--r--spec/frontend/pipeline_schedules/components/table/pipeline_schedules_table_spec.js25
-rw-r--r--spec/graphql/types/packages/tag_type_spec.rb2
-rw-r--r--spec/lib/gitlab/ci/config/external/mapper_spec.rb24
-rw-r--r--spec/lib/gitlab/ci/parsers/security/common_spec.rb20
-rw-r--r--spec/lib/gitlab/ci/reports/codequality_reports_comparer_spec.rb33
-rw-r--r--spec/lib/gitlab/ci/reports/codequality_reports_spec.rb32
-rw-r--r--spec/lib/gitlab/ci/variables/builder/group_spec.rb11
-rw-r--r--spec/lib/gitlab/ci/variables/builder/project_spec.rb11
-rw-r--r--spec/lib/gitlab/ci/variables/builder_spec.rb9
-rw-r--r--spec/lib/gitlab/ci/variables/collection/sort_spec.rb15
-rw-r--r--spec/lib/gitlab/ci/yaml_processor/result_spec.rb9
-rw-r--r--spec/lib/gitlab/ci/yaml_processor_spec.rb140
-rw-r--r--spec/lib/gitlab/conflict/file_spec.rb27
-rw-r--r--spec/mailers/emails/profile_spec.rb29
-rw-r--r--spec/services/notification_service_spec.rb21
49 files changed, 364 insertions, 472 deletions
diff --git a/.rubocop_todo/layout/first_array_element_indentation.yml b/.rubocop_todo/layout/first_array_element_indentation.yml
index 2861d5fa8df..a6d75b57b2f 100644
--- a/.rubocop_todo/layout/first_array_element_indentation.yml
+++ b/.rubocop_todo/layout/first_array_element_indentation.yml
@@ -3,21 +3,6 @@
Layout/FirstArrayElementIndentation:
Details: grace period
Exclude:
- - 'lib/gitlab/email/message/in_product_marketing/trial.rb'
- - 'qa/qa/specs/features/browser_ui/2_plan/issue/custom_issue_template_spec.rb'
- - 'spec/controllers/concerns/send_file_upload_spec.rb'
- - 'spec/graphql/types/packages/tag_type_spec.rb'
- - 'spec/lib/gitlab/ci/config/external/mapper_spec.rb'
- - 'spec/lib/gitlab/ci/parsers/security/common_spec.rb'
- - 'spec/lib/gitlab/ci/reports/codequality_reports_comparer_spec.rb'
- - 'spec/lib/gitlab/ci/reports/codequality_reports_spec.rb'
- - 'spec/lib/gitlab/ci/variables/builder/group_spec.rb'
- - 'spec/lib/gitlab/ci/variables/builder/project_spec.rb'
- - 'spec/lib/gitlab/ci/variables/builder_spec.rb'
- - 'spec/lib/gitlab/ci/variables/collection/sort_spec.rb'
- - 'spec/lib/gitlab/ci/yaml_processor/result_spec.rb'
- - 'spec/lib/gitlab/ci/yaml_processor_spec.rb'
- - 'spec/lib/gitlab/conflict/file_spec.rb'
- 'spec/lib/gitlab/database/each_database_spec.rb'
- 'spec/lib/gitlab/database/load_balancing/rack_middleware_spec.rb'
- 'spec/lib/gitlab/database/load_balancing/sticking_spec.rb'
diff --git a/GITLAB_SHELL_VERSION b/GITLAB_SHELL_VERSION
index 6242bb49da0..27fbdebd13c 100644
--- a/GITLAB_SHELL_VERSION
+++ b/GITLAB_SHELL_VERSION
@@ -1 +1 @@
-14.10.0
+14.12.0
diff --git a/app/assets/javascripts/pages/projects/pipeline_schedules/edit/index.js b/app/assets/javascripts/pages/projects/pipeline_schedules/edit/index.js
index 0edce2db0a3..6dd21380bec 100644
--- a/app/assets/javascripts/pages/projects/pipeline_schedules/edit/index.js
+++ b/app/assets/javascripts/pages/projects/pipeline_schedules/edit/index.js
@@ -1,8 +1,3 @@
-import initPipelineSchedulesFormApp from '~/pipeline_schedules/mount_pipeline_schedules_form_app';
import initForm from '../shared/init_form';
-if (gon.features?.pipelineSchedulesVue) {
- initPipelineSchedulesFormApp('#pipeline-schedules-form-edit');
-} else {
- initForm();
-}
+initForm();
diff --git a/app/assets/javascripts/pages/projects/pipeline_schedules/index/index.js b/app/assets/javascripts/pages/projects/pipeline_schedules/index/index.js
index 7d0930f6424..9513f42d9c9 100644
--- a/app/assets/javascripts/pages/projects/pipeline_schedules/index/index.js
+++ b/app/assets/javascripts/pages/projects/pipeline_schedules/index/index.js
@@ -1,10 +1,9 @@
import Vue from 'vue';
import { BV_SHOW_MODAL } from '~/lib/utils/constants';
-import initPipelineSchedulesApp from '~/pipeline_schedules/mount_pipeline_schedules_app';
import PipelineSchedulesTakeOwnershipModal from '~/pipeline_schedules/components/take_ownership_modal.vue';
import PipelineSchedulesCallout from '../shared/components/pipeline_schedules_callout.vue';
-function initPipelineSchedulesCallout() {
+function initPipelineSchedules() {
const el = document.getElementById('pipeline-schedules-callout');
if (!el) {
@@ -16,7 +15,6 @@ function initPipelineSchedulesCallout() {
// eslint-disable-next-line no-new
new Vue({
el,
- name: 'PipelineSchedulesCalloutRoot',
provide: {
docsUrl,
illustrationUrl,
@@ -27,8 +25,6 @@ function initPipelineSchedulesCallout() {
});
}
-// TODO: move take ownership feature into new Vue app
-// located in directory app/assets/javascripts/pipeline_schedules/components
function initTakeownershipModal() {
const modalId = 'pipeline-take-ownership-modal';
const buttonSelector = 'js-take-ownership-button';
@@ -67,10 +63,5 @@ function initTakeownershipModal() {
});
}
-initPipelineSchedulesCallout();
-
-if (gon.features?.pipelineSchedulesVue) {
- initPipelineSchedulesApp();
-} else {
- initTakeownershipModal();
-}
+initPipelineSchedules();
+initTakeownershipModal();
diff --git a/app/assets/javascripts/pages/projects/pipeline_schedules/new/index.js b/app/assets/javascripts/pages/projects/pipeline_schedules/new/index.js
index 06084fa729b..6dd21380bec 100644
--- a/app/assets/javascripts/pages/projects/pipeline_schedules/new/index.js
+++ b/app/assets/javascripts/pages/projects/pipeline_schedules/new/index.js
@@ -1,8 +1,3 @@
-import initPipelineSchedulesFormApp from '~/pipeline_schedules/mount_pipeline_schedules_form_app';
import initForm from '../shared/init_form';
-if (gon.features?.pipelineSchedulesVue) {
- initPipelineSchedulesFormApp('#pipeline-schedules-form-new');
-} else {
- initForm();
-}
+initForm();
diff --git a/app/assets/javascripts/pipeline_schedules/components/pipeline_schedules.vue b/app/assets/javascripts/pipeline_schedules/components/pipeline_schedules.vue
deleted file mode 100644
index 86460e62183..00000000000
--- a/app/assets/javascripts/pipeline_schedules/components/pipeline_schedules.vue
+++ /dev/null
@@ -1,20 +0,0 @@
-<script>
-import PipelineSchedulesTable from './table/pipeline_schedules_table.vue';
-
-export default {
- components: {
- PipelineSchedulesTable,
- },
- inject: {
- fullPath: {
- default: '',
- },
- },
-};
-</script>
-
-<template>
- <div>
- <pipeline-schedules-table />
- </div>
-</template>
diff --git a/app/assets/javascripts/pipeline_schedules/components/pipeline_schedules_form.vue b/app/assets/javascripts/pipeline_schedules/components/pipeline_schedules_form.vue
deleted file mode 100644
index 6e24ac6b8d4..00000000000
--- a/app/assets/javascripts/pipeline_schedules/components/pipeline_schedules_form.vue
+++ /dev/null
@@ -1,18 +0,0 @@
-<script>
-import { GlForm } from '@gitlab/ui';
-
-export default {
- components: {
- GlForm,
- },
- inject: {
- fullPath: {
- default: '',
- },
- },
-};
-</script>
-
-<template>
- <gl-form />
-</template>
diff --git a/app/assets/javascripts/pipeline_schedules/components/table/pipeline_schedules_table.vue b/app/assets/javascripts/pipeline_schedules/components/table/pipeline_schedules_table.vue
deleted file mode 100644
index 613da200105..00000000000
--- a/app/assets/javascripts/pipeline_schedules/components/table/pipeline_schedules_table.vue
+++ /dev/null
@@ -1,13 +0,0 @@
-<script>
-import { GlTableLite } from '@gitlab/ui';
-
-export default {
- components: {
- GlTableLite,
- },
-};
-</script>
-
-<template>
- <gl-table-lite />
-</template>
diff --git a/app/assets/javascripts/pipeline_schedules/mount_pipeline_schedules_app.js b/app/assets/javascripts/pipeline_schedules/mount_pipeline_schedules_app.js
deleted file mode 100644
index 8f77e06c19a..00000000000
--- a/app/assets/javascripts/pipeline_schedules/mount_pipeline_schedules_app.js
+++ /dev/null
@@ -1,32 +0,0 @@
-import Vue from 'vue';
-import VueApollo from 'vue-apollo';
-import createDefaultClient from '~/lib/graphql';
-import PipelineSchedules from './components/pipeline_schedules.vue';
-
-Vue.use(VueApollo);
-
-const apolloProvider = new VueApollo({
- defaultClient: createDefaultClient(),
-});
-
-export default () => {
- const containerEl = document.querySelector('#pipeline-schedules-app');
-
- if (!containerEl) {
- return false;
- }
-
- const { fullPath } = containerEl.dataset;
-
- return new Vue({
- el: containerEl,
- name: 'PipelineSchedulesRoot',
- apolloProvider,
- provide: {
- fullPath,
- },
- render(createElement) {
- return createElement(PipelineSchedules);
- },
- });
-};
diff --git a/app/assets/javascripts/pipeline_schedules/mount_pipeline_schedules_form_app.js b/app/assets/javascripts/pipeline_schedules/mount_pipeline_schedules_form_app.js
deleted file mode 100644
index d83417ab84a..00000000000
--- a/app/assets/javascripts/pipeline_schedules/mount_pipeline_schedules_form_app.js
+++ /dev/null
@@ -1,32 +0,0 @@
-import Vue from 'vue';
-import VueApollo from 'vue-apollo';
-import createDefaultClient from '~/lib/graphql';
-import PipelineSchedulesForm from './components/pipeline_schedules_form.vue';
-
-Vue.use(VueApollo);
-
-const apolloProvider = new VueApollo({
- defaultClient: createDefaultClient(),
-});
-
-export default (selector) => {
- const containerEl = document.querySelector(selector);
-
- if (!containerEl) {
- return false;
- }
-
- const { fullPath } = containerEl.dataset;
-
- return new Vue({
- el: containerEl,
- name: 'PipelineSchedulesFormRoot',
- apolloProvider,
- provide: {
- fullPath,
- },
- render(createElement) {
- return createElement(PipelineSchedulesForm);
- },
- });
-};
diff --git a/app/controllers/projects/pipeline_schedules_controller.rb b/app/controllers/projects/pipeline_schedules_controller.rb
index ca787785901..a23d7fb3e6b 100644
--- a/app/controllers/projects/pipeline_schedules_controller.rb
+++ b/app/controllers/projects/pipeline_schedules_controller.rb
@@ -10,7 +10,6 @@ class Projects::PipelineSchedulesController < Projects::ApplicationController
before_action :authorize_update_pipeline_schedule!, only: [:edit, :update]
before_action :authorize_take_ownership_pipeline_schedule!, only: [:take_ownership]
before_action :authorize_admin_pipeline_schedule!, only: [:destroy]
- before_action :push_schedule_feature_flag, only: [:index, :new, :edit]
feature_category :continuous_integration
urgency :low
@@ -116,8 +115,4 @@ class Projects::PipelineSchedulesController < Projects::ApplicationController
def authorize_admin_pipeline_schedule!
return access_denied! unless can?(current_user, :admin_pipeline_schedule, schedule)
end
-
- def push_schedule_feature_flag
- push_frontend_feature_flag(:pipeline_schedules_vue, @project)
- end
end
diff --git a/app/helpers/selects_helper.rb b/app/helpers/selects_helper.rb
index 88aff31af54..14ee6007a43 100644
--- a/app/helpers/selects_helper.rb
+++ b/app/helpers/selects_helper.rb
@@ -39,11 +39,6 @@ module SelectsHelper
select2_tag(id, opts)
end
- def namespace_select_tag(id, opts = {})
- opts[:class] = [*opts[:class], 'ajax-namespace-select'].join(' ')
- select2_tag(id, opts)
- end
-
def project_select_tag(id, opts = {})
opts[:class] = [*opts[:class], 'ajax-project-select'].join(' ')
diff --git a/app/mailers/emails/profile.rb b/app/mailers/emails/profile.rb
index c27e181ebd6..65ea90d0b5d 100644
--- a/app/mailers/emails/profile.rb
+++ b/app/mailers/emails/profile.rb
@@ -94,6 +94,18 @@ module Emails
end
end
+ def access_token_revoked_email(user, token_name)
+ return unless user&.active?
+
+ @user = user
+ @token_name = token_name
+ @target_url = profile_personal_access_tokens_url
+
+ Gitlab::I18n.with_locale(@user.preferred_language) do
+ mail_with_locale(to: @user.notification_email_or_default, subject: subject(_("A personal access token has been revoked")))
+ end
+ end
+
def ssh_key_expired_email(user, fingerprints)
return unless user&.active?
diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb
index d29bd15ac2e..1224cf80b76 100644
--- a/app/services/notification_service.rb
+++ b/app/services/notification_service.rb
@@ -87,6 +87,13 @@ class NotificationService
mailer.access_token_expired_email(user).deliver_later
end
+ # Notify the user when one of their personal access tokens is revoked
+ def access_token_revoked(user, token_name)
+ return unless user.can?(:receive_notifications)
+
+ mailer.access_token_revoked_email(user, token_name).deliver_later
+ end
+
# Notify the user when at least one of their ssh key has expired today
def ssh_key_expired(user, fingerprints)
return unless user.can?(:receive_notifications)
diff --git a/app/services/personal_access_tokens/revoke_service.rb b/app/services/personal_access_tokens/revoke_service.rb
index 0275d03bcc9..732da75da3a 100644
--- a/app/services/personal_access_tokens/revoke_service.rb
+++ b/app/services/personal_access_tokens/revoke_service.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
module PersonalAccessTokens
- class RevokeService
+ class RevokeService < BaseService
attr_reader :token, :current_user, :group
def initialize(current_user = nil, token: nil, group: nil )
@@ -15,6 +15,7 @@ module PersonalAccessTokens
if token.revoke!
log_event
+ notification_service.access_token_revoked(token.user, token.name)
ServiceResponse.success(message: success_message)
else
ServiceResponse.error(message: error_message)
diff --git a/app/views/notify/access_token_revoked_email.html.haml b/app/views/notify/access_token_revoked_email.html.haml
new file mode 100644
index 00000000000..4d9b9e14d14
--- /dev/null
+++ b/app/views/notify/access_token_revoked_email.html.haml
@@ -0,0 +1,7 @@
+%p
+ = _('Hi %{username}!') % { username: sanitize_name(@user.name) }
+%p
+ = html_escape(_('A personal access token, named %{code_start}%{token_name}%{code_end}, has been revoked.')) % { code_start: '<code>'.html_safe, token_name: @token_name, code_end: '</code>'.html_safe }
+%p
+ - pat_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: @target_url }
+ = html_escape(_('You can check your tokens or create a new one in your %{pat_link_start}personal access tokens settings%{pat_link_end}.')) % { pat_link_start: pat_link_start, pat_link_end: '</a>'.html_safe }
diff --git a/app/views/notify/access_token_revoked_email.text.erb b/app/views/notify/access_token_revoked_email.text.erb
new file mode 100644
index 00000000000..17dd628d76c
--- /dev/null
+++ b/app/views/notify/access_token_revoked_email.text.erb
@@ -0,0 +1,5 @@
+<%= _('Hi %{username}!') % { username: sanitize_name(@user.name) } %>
+
+<%= _('A personal access token, named %{token_name}, has been revoked.') % { token_name: @token_name } %>
+
+<%= _('You can check your tokens or create a new one in your personal access tokens settings %{pat_link}.') % { pat_link: @target_url } %>
diff --git a/app/views/projects/pipeline_schedules/edit.html.haml b/app/views/projects/pipeline_schedules/edit.html.haml
index 3f843ce6aec..642b458eea6 100644
--- a/app/views/projects/pipeline_schedules/edit.html.haml
+++ b/app/views/projects/pipeline_schedules/edit.html.haml
@@ -7,7 +7,4 @@
= _("Edit Pipeline Schedule")
%hr
-- if Feature.enabled?(:pipeline_schedules_vue, @project)
- #pipeline-schedules-form-edit{ data: { full_path: @project.full_path } }
-- else
- = render "form"
+= render "form"
diff --git a/app/views/projects/pipeline_schedules/index.html.haml b/app/views/projects/pipeline_schedules/index.html.haml
index 6c7b4b2f320..a0412650b3a 100644
--- a/app/views/projects/pipeline_schedules/index.html.haml
+++ b/app/views/projects/pipeline_schedules/index.html.haml
@@ -3,25 +3,21 @@
- add_page_specific_style 'page_bundles/pipeline_schedules'
#pipeline-schedules-callout{ data: { docs_url: help_page_path('ci/pipelines/schedules'), illustration_url: image_path('illustrations/pipeline_schedule_callout.svg') } }
+.top-area
+ - schedule_path_proc = ->(scope) { pipeline_schedules_path(@project, scope: scope) }
+ = render "tabs", schedule_path_proc: schedule_path_proc, all_schedules: @all_schedules, scope: @scope
-- if Feature.enabled?(:pipeline_schedules_vue, @project)
- #pipeline-schedules-app{ data: { full_path: @project.full_path } }
-- else
- .top-area
- - schedule_path_proc = ->(scope) { pipeline_schedules_path(@project, scope: scope) }
- = render "tabs", schedule_path_proc: schedule_path_proc, all_schedules: @all_schedules, scope: @scope
-
- - if can?(current_user, :create_pipeline_schedule, @project)
- .nav-controls
- = link_to new_project_pipeline_schedule_path(@project), class: 'btn gl-button btn-confirm' do
- %span= _('New schedule')
+ - if can?(current_user, :create_pipeline_schedule, @project)
+ .nav-controls
+ = link_to new_project_pipeline_schedule_path(@project), class: 'btn gl-button btn-confirm' do
+ %span= _('New schedule')
- - if @schedules.present?
- %ul.content-list
- = render partial: "table"
- - else
- = render Pajamas::CardComponent.new(card_options: { class: 'bg-light gl-mt-3 gl-text-center' }) do |c|
- - c.body do
- = _("No schedules")
+- if @schedules.present?
+ %ul.content-list
+ = render partial: "table"
+- else
+ = render Pajamas::CardComponent.new(card_options: { class: 'bg-light gl-mt-3 gl-text-center' }) do |c|
+ - c.body do
+ = _("No schedules")
- #pipeline-take-ownership-modal
+#pipeline-take-ownership-modal
diff --git a/app/views/projects/pipeline_schedules/new.html.haml b/app/views/projects/pipeline_schedules/new.html.haml
index d3757d0e339..3b4acf5b8c5 100644
--- a/app/views/projects/pipeline_schedules/new.html.haml
+++ b/app/views/projects/pipeline_schedules/new.html.haml
@@ -8,7 +8,4 @@
%h1.page-title.gl-font-size-h-display
= _("Schedule a new pipeline")
-- if Feature.enabled?(:pipeline_schedules_vue, @project)
- #pipeline-schedules-form-new{ data: { full_path: @project.full_path } }
-- else
- = render "form"
+= render "form"
diff --git a/config/feature_flags/development/pipeline_schedules_vue.yml b/config/feature_flags/development/pipeline_schedules_vue.yml
deleted file mode 100644
index e497d0f9c4e..00000000000
--- a/config/feature_flags/development/pipeline_schedules_vue.yml
+++ /dev/null
@@ -1,8 +0,0 @@
----
-name: pipeline_schedules_vue
-introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/98683
-rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/375139
-milestone: '15.5'
-type: development
-group: group::pipeline execution
-default_enabled: false
diff --git a/doc/administration/auth/oidc.md b/doc/administration/auth/oidc.md
index 94484c8e085..5a19f05c7b2 100644
--- a/doc/administration/auth/oidc.md
+++ b/doc/administration/auth/oidc.md
@@ -116,8 +116,7 @@ The OpenID Connect provides you with a client's details and secret for you to us
- `jwks_uri` is the URL to the endpoint where the Token signer publishes its keys.
1. Save the configuration file.
-1. [Reconfigure](../restart_gitlab.md#omnibus-gitlab-reconfigure) or [restart GitLab](../restart_gitlab.md#installations-from-source)
- for the changes to take effect if you installed GitLab via Omnibus or from source respectively.
+1. For changes to take effect, [reconfigure](../restart_gitlab.md#omnibus-gitlab-reconfigure) if you installed GitLab with Omnibus, or [restart GitLab](../restart_gitlab.md#installations-from-source) if you installed GitLab from the source.
On the sign in page, there should now be an OpenID Connect icon below the regular sign in form.
Select the icon to begin the authentication process. The OpenID Connect provider asks the user to
@@ -277,7 +276,7 @@ but `LocalAccounts` works for authenticating against local, Active Directory acc
https://<YOUR-DOMAIN>/tfp/<YOUR-TENANT-ID>/<YOUR-SIGN-IN-POLICY-NAME>/v2.0/
```
- The policy name is lowercased in the URL. For example, `B2C_1A_signup_signin`
+ The policy name is lowercase in the URL. For example, `B2C_1A_signup_signin`
policy appears as `b2c_1a_signup_sigin`.
The trailing forward slash is required.
@@ -416,7 +415,7 @@ To use symmetric key encryption:
1. Convert `value` to standard base64. As [discussed in the post](https://keycloak.discourse.group/t/invalid-signature-with-hs256-token/3228/9),
`value` is encoded in ["Base 64 Encoding with URL and Filename Safe Alphabet" in RFC 4648](https://datatracker.ietf.org/doc/html/rfc4648#section-5).
- This needs to be converted to [standard base64 as defined in RFC 2045](https://datatracker.ietf.org/doc/html/rfc2045).
+ This must be converted to [standard base64 as defined in RFC 2045](https://datatracker.ietf.org/doc/html/rfc2045).
The following Ruby script does this:
```ruby
@@ -538,5 +537,5 @@ If you're having trouble, here are some tips:
OAuth2 access token if `client_auth_method` is not defined or if set to `basic`.
If you are seeing 401 errors upon retrieving the `userinfo` endpoint, you may
want to check your OpenID Web server configuration. For example, for
- [`oauth2-server-php`](https://github.com/bshaffer/oauth2-server-php), you
- may need to [add a configuration parameter to Apache](https://github.com/bshaffer/oauth2-server-php/issues/926#issuecomment-387502778).
+ [`oauth2-server-php`](https://github.com/bshaffer/oauth2-server-php), you may need to
+ [add a configuration parameter to Apache](https://github.com/bshaffer/oauth2-server-php/issues/926#issuecomment-387502778).
diff --git a/doc/development/database/batched_background_migrations.md b/doc/development/database/batched_background_migrations.md
index ab603685574..ea1de91c26c 100644
--- a/doc/development/database/batched_background_migrations.md
+++ b/doc/development/database/batched_background_migrations.md
@@ -542,6 +542,16 @@ To list the batched background migrations in the system, run this command:
`/chatops run batched_background_migrations list`
+This command supports the following options:
+
+- Database selection:
+ - `--database DATABASE_NAME`: Connects to the given database.
+- Environment selection:
+ - `--dev`: Uses the `dev` environment.
+ - `--staging`: Uses the `staging` environment.
+ - `--staging_ref`: Uses the `staging_ref` environment.
+ - `--production` : Uses the `production` environment (default).
+
Output example:
![List command](img/list_v15_4.png)
@@ -555,6 +565,16 @@ To see the status and progress of a specific batched background migration, run t
`/chatops run batched_background_migrations status MIGRATION_ID`
+This command supports the following options:
+
+- Database selection:
+ - `--database DATABASE_NAME`: Connects to the given database.
+- Environment selection:
+ - `--dev`: Uses the `dev` environment.
+ - `--staging`: Uses the `staging` environment.
+ - `--staging_ref`: Uses the `staging_ref` environment.
+ - `--production` : Uses the `production` environment (default).
+
Output example:
![Status command](img/status_v15_4.png)
@@ -577,6 +597,16 @@ If you want to pause a batched background migration, you need to run the followi
`/chatops run batched_background_migrations pause MIGRATION_ID`
+This command supports the following options:
+
+- Database selection:
+ - `--database DATABASE_NAME`: Connects to the given database.
+- Environment selection:
+ - `--dev`: Uses the `dev` environment.
+ - `--staging`: Uses the `staging` environment.
+ - `--staging_ref`: Uses the `staging_ref` environment.
+ - `--production` : Uses the `production` environment (default).
+
Output example:
![Pause command](img/pause_v15_4.png)
@@ -590,6 +620,16 @@ If you want to resume a batched background migration, you need to run the follow
`/chatops run batched_background_migrations resume MIGRATION_ID`
+This command supports the following options:
+
+- Database selection:
+ - `--database DATABASE_NAME`: Connects to the given database.
+- Environment selection:
+ - `--dev`: Uses the `dev` environment.
+ - `--staging`: Uses the `staging` environment.
+ - `--staging_ref`: Uses the `staging_ref` environment.
+ - `--production` : Uses the `production` environment (default).
+
Output example:
![Resume command](img/resume_v15_4.png)
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index 4eedd107aa9..2abe893e16a 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -742,13 +742,7 @@ module API
end
def secret_token
- if Feature.enabled?(:gitlab_shell_jwt_token)
- strong_memoize(:secret_token) do
- File.read(Gitlab.config.gitlab_shell.secret_file)
- end
- else
- Gitlab::Shell.secret_token
- end
+ Gitlab::Shell.secret_token
end
def authenticate_non_public?
diff --git a/lib/gitlab/email/message/in_product_marketing/trial.rb b/lib/gitlab/email/message/in_product_marketing/trial.rb
index 11a799886ab..720262816b4 100644
--- a/lib/gitlab/email/message/in_product_marketing/trial.rb
+++ b/lib/gitlab/email/message/in_product_marketing/trial.rb
@@ -42,11 +42,11 @@ module Gitlab
[
s_("InProductMarketing|GitLab's premium tiers are designed to make you, your team and your application more efficient and more secure with features including but not limited to:"),
list([
- s_('InProductMarketing|%{strong_start}Company wide portfolio management%{strong_end} — including multi-level epics, scoped labels').html_safe % strong_options,
- s_('InProductMarketing|%{strong_start}Multiple approval roles%{strong_end} — including code owners and required merge approvals').html_safe % strong_options,
- s_('InProductMarketing|%{strong_start}Advanced application security%{strong_end} — including SAST, DAST scanning, FUZZ testing, dependency scanning, license compliance, secrete detection').html_safe % strong_options,
- s_('InProductMarketing|%{strong_start}Executive level insights%{strong_end} — including reporting on productivity, tasks by type, days to completion, value stream').html_safe % strong_options
- ])
+ s_('InProductMarketing|%{strong_start}Company wide portfolio management%{strong_end} — including multi-level epics, scoped labels').html_safe % strong_options,
+ s_('InProductMarketing|%{strong_start}Multiple approval roles%{strong_end} — including code owners and required merge approvals').html_safe % strong_options,
+ s_('InProductMarketing|%{strong_start}Advanced application security%{strong_end} — including SAST, DAST scanning, FUZZ testing, dependency scanning, license compliance, secrete detection').html_safe % strong_options,
+ s_('InProductMarketing|%{strong_start}Executive level insights%{strong_end} — including reporting on productivity, tasks by type, days to completion, value stream').html_safe % strong_options
+ ])
].join("\n"),
s_('InProductMarketing|GitLab provides static application security testing (SAST), dynamic application security testing (DAST), container scanning, and dependency scanning to help you deliver secure applications along with license compliance.'),
s_('InProductMarketing|By enabling code owners and required merge approvals the right person will review the right MR. This is a win-win: cleaner code and a more efficient review process.')
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index e69e89e62ea..a01e3642b30 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -1700,6 +1700,15 @@ msgstr ""
msgid "A page with that title already exists"
msgstr ""
+msgid "A personal access token has been revoked"
+msgstr ""
+
+msgid "A personal access token, named %{code_start}%{token_name}%{code_end}, has been revoked."
+msgstr ""
+
+msgid "A personal access token, named %{token_name}, has been revoked."
+msgstr ""
+
msgid "A plain HTML site that uses Netlify for CI/CD instead of GitLab, but still with all the other great GitLab features"
msgstr ""
@@ -45682,6 +45691,12 @@ msgstr ""
msgid "You can check it in your in your personal access tokens settings %{pat_link}."
msgstr ""
+msgid "You can check your tokens or create a new one in your %{pat_link_start}personal access tokens settings%{pat_link_end}."
+msgstr ""
+
+msgid "You can check your tokens or create a new one in your personal access tokens settings %{pat_link}."
+msgstr ""
+
msgid "You can create a new %{link}."
msgstr ""
diff --git a/qa/qa/specs/features/api/1_manage/import_large_github_repo_spec.rb b/qa/qa/specs/features/api/1_manage/import_large_github_repo_spec.rb
index 58820a7e477..b1c21ea87de 100644
--- a/qa/qa/specs/features/api/1_manage/import_large_github_repo_spec.rb
+++ b/qa/qa/specs/features/api/1_manage/import_large_github_repo_spec.rb
@@ -64,6 +64,7 @@ module QA
"subscribed",
"unsubscribed",
"transferred",
+ "locked",
# mentions are supported but they can be reported differently on gitlab's side
# for example mention of issue creation in pr will be reported in the issue on gitlab side
# or referenced in github will still create a 'mentioned in' comment in gitlab
@@ -251,12 +252,12 @@ module QA
) do
start = Time.now
- # fetch all objects right after import has started
- fetch_github_objects
-
# import the project and log gitlab path
logger.info("== Importing project '#{github_repo}' in to '#{imported_project.reload!.full_path}' ==")
+ # fetch all objects right after import has started
+ fetch_github_objects
+
import_status = lambda do
imported_project.project_import_status.yield_self do |status|
@stats = status.dig(:stats, :imported)
@@ -597,7 +598,7 @@ module QA
# @param [String] url
# @return [Integer]
def id_from_url(url)
- url.match(%r{(?<type>issues|pull)/(?<id>\d+)})&.named_captures&.fetch(:id, nil).to_i
+ url.match(%r{(?<type>issues|pull)/(?<id>\d+)})&.named_captures&.fetch("id", nil).to_i
end
end
end
diff --git a/qa/qa/specs/features/browser_ui/2_plan/issue/custom_issue_template_spec.rb b/qa/qa/specs/features/browser_ui/2_plan/issue/custom_issue_template_spec.rb
index 206e6b8a456..b2c612d38fe 100644
--- a/qa/qa/specs/features/browser_ui/2_plan/issue/custom_issue_template_spec.rb
+++ b/qa/qa/specs/features/browser_ui/2_plan/issue/custom_issue_template_spec.rb
@@ -19,12 +19,13 @@ module QA
Resource::Repository::Commit.fabricate_via_api! do |commit|
commit.project = template_project
commit.commit_message = 'Add custom issue template'
- commit.add_files([
- {
- file_path: ".gitlab/issue_templates/#{template_name}.md",
- content: template_content
- }
- ])
+ commit.add_files(
+ [
+ {
+ file_path: ".gitlab/issue_templates/#{template_name}.md",
+ content: template_content
+ }
+ ])
end
end
diff --git a/spec/controllers/concerns/send_file_upload_spec.rb b/spec/controllers/concerns/send_file_upload_spec.rb
index f9a6afb95ea..32304815bbb 100644
--- a/spec/controllers/concerns/send_file_upload_spec.rb
+++ b/spec/controllers/concerns/send_file_upload_spec.rb
@@ -96,9 +96,10 @@ RSpec.describe SendFileUpload do
expect(controller).to receive(:params).at_least(:once).and_return(width: '64')
expect(controller).to receive(:head).with(:ok)
- expect(Gitlab::Workhorse).to receive(:send_scaled_image).with(a_string_matching('^(/.+|https://.+)'), 64, 'image/png').and_return([
- Gitlab::Workhorse::SEND_DATA_HEADER, "send-scaled-img:faux"
- ])
+ expect(Gitlab::Workhorse).to receive(:send_scaled_image)
+ .with(a_string_matching('^(/.+|https://.+)'), 64, 'image/png')
+ .and_return([Gitlab::Workhorse::SEND_DATA_HEADER, "send-scaled-img:faux"])
+
expect(headers).to receive(:store).with(Gitlab::Workhorse::SEND_DATA_HEADER, "send-scaled-img:faux")
subject
diff --git a/spec/features/projects/pipeline_schedules_spec.rb b/spec/features/projects/pipeline_schedules_spec.rb
index 4ed0a11da38..dcc46f5d223 100644
--- a/spec/features/projects/pipeline_schedules_spec.rb
+++ b/spec/features/projects/pipeline_schedules_spec.rb
@@ -11,10 +11,6 @@ RSpec.describe 'Pipeline Schedules', :js do
let(:scope) { nil }
let!(:user) { create(:user) }
- before do
- stub_feature_flags(pipeline_schedules_vue: false)
- end
-
context 'logged in as the pipeline schedule owner' do
before do
project.add_developer(user)
diff --git a/spec/features/projects/pipelines/legacy_pipeline_spec.rb b/spec/features/projects/pipelines/legacy_pipeline_spec.rb
index d93c951791d..250a336469c 100644
--- a/spec/features/projects/pipelines/legacy_pipeline_spec.rb
+++ b/spec/features/projects/pipelines/legacy_pipeline_spec.rb
@@ -735,8 +735,6 @@ RSpec.describe 'Pipeline', :js do
end
it 'displays the PipelineSchedule in an inactive state' do
- stub_feature_flags(pipeline_schedules_vue: false)
-
visit project_pipeline_schedules_path(project)
page.click_link('Inactive')
diff --git a/spec/features/projects/pipelines/pipeline_spec.rb b/spec/features/projects/pipelines/pipeline_spec.rb
index 0b43e13996f..51a6fbc4d36 100644
--- a/spec/features/projects/pipelines/pipeline_spec.rb
+++ b/spec/features/projects/pipelines/pipeline_spec.rb
@@ -860,8 +860,6 @@ RSpec.describe 'Pipeline', :js do
end
it 'displays the PipelineSchedule in an inactive state' do
- stub_feature_flags(pipeline_schedules_vue: false)
-
visit project_pipeline_schedules_path(project)
page.click_link('Inactive')
diff --git a/spec/frontend/pipeline_schedules/components/pipeline_schedules_form_spec.js b/spec/frontend/pipeline_schedules/components/pipeline_schedules_form_spec.js
deleted file mode 100644
index 4b5a9611251..00000000000
--- a/spec/frontend/pipeline_schedules/components/pipeline_schedules_form_spec.js
+++ /dev/null
@@ -1,25 +0,0 @@
-import { shallowMount } from '@vue/test-utils';
-import { GlForm } from '@gitlab/ui';
-import PipelineSchedulesForm from '~/pipeline_schedules/components/pipeline_schedules_form.vue';
-
-describe('Pipeline schedules form', () => {
- let wrapper;
-
- const createComponent = () => {
- wrapper = shallowMount(PipelineSchedulesForm);
- };
-
- const findForm = () => wrapper.findComponent(GlForm);
-
- beforeEach(() => {
- createComponent();
- });
-
- afterEach(() => {
- wrapper.destroy();
- });
-
- it('displays form', () => {
- expect(findForm().exists()).toBe(true);
- });
-});
diff --git a/spec/frontend/pipeline_schedules/components/pipeline_schedules_spec.js b/spec/frontend/pipeline_schedules/components/pipeline_schedules_spec.js
deleted file mode 100644
index 98e53942d19..00000000000
--- a/spec/frontend/pipeline_schedules/components/pipeline_schedules_spec.js
+++ /dev/null
@@ -1,25 +0,0 @@
-import { shallowMount } from '@vue/test-utils';
-import PipelineSchedules from '~/pipeline_schedules/components/pipeline_schedules.vue';
-import PipelineSchedulesTable from '~/pipeline_schedules/components/table/pipeline_schedules_table.vue';
-
-describe('Pipeline schedules app', () => {
- let wrapper;
-
- const createComponent = () => {
- wrapper = shallowMount(PipelineSchedules);
- };
-
- const findTable = () => wrapper.findComponent(PipelineSchedulesTable);
-
- beforeEach(() => {
- createComponent();
- });
-
- afterEach(() => {
- wrapper.destroy();
- });
-
- it('displays table', () => {
- expect(findTable().exists()).toBe(true);
- });
-});
diff --git a/spec/frontend/pipeline_schedules/components/table/pipeline_schedules_table_spec.js b/spec/frontend/pipeline_schedules/components/table/pipeline_schedules_table_spec.js
deleted file mode 100644
index 950b5d64ffe..00000000000
--- a/spec/frontend/pipeline_schedules/components/table/pipeline_schedules_table_spec.js
+++ /dev/null
@@ -1,25 +0,0 @@
-import { shallowMount } from '@vue/test-utils';
-import { GlTableLite } from '@gitlab/ui';
-import PipelineSchedulesTable from '~/pipeline_schedules/components/table/pipeline_schedules_table.vue';
-
-describe('Pipeline schedules table', () => {
- let wrapper;
-
- const createComponent = () => {
- wrapper = shallowMount(PipelineSchedulesTable);
- };
-
- const findTable = () => wrapper.findComponent(GlTableLite);
-
- beforeEach(() => {
- createComponent();
- });
-
- afterEach(() => {
- wrapper.destroy();
- });
-
- it('displays table', () => {
- expect(findTable().exists()).toBe(true);
- });
-});
diff --git a/spec/graphql/types/packages/tag_type_spec.rb b/spec/graphql/types/packages/tag_type_spec.rb
index 83b705157d8..ea0801c7a0f 100644
--- a/spec/graphql/types/packages/tag_type_spec.rb
+++ b/spec/graphql/types/packages/tag_type_spec.rb
@@ -7,7 +7,7 @@ RSpec.describe GitlabSchema.types['PackageTag'] do
it 'includes all the package tag fields' do
expected_fields = %w[
- id name created_at updated_at
+ id name created_at updated_at
]
expect(described_class).to include_graphql_fields(*expected_fields)
diff --git a/spec/lib/gitlab/ci/config/external/mapper_spec.rb b/spec/lib/gitlab/ci/config/external/mapper_spec.rb
index c13e65084c1..e12f5dcee0a 100644
--- a/spec/lib/gitlab/ci/config/external/mapper_spec.rb
+++ b/spec/lib/gitlab/ci/config/external/mapper_spec.rb
@@ -207,9 +207,9 @@ RSpec.describe Gitlab::Ci::Config::External::Mapper do
context "when duplicate 'include's are defined" do
let(:values) do
{ include: [
- { 'local' => local_file },
- { 'local' => local_file }
- ],
+ { 'local' => local_file },
+ { 'local' => local_file }
+ ],
image: 'image:1.0' }
end
@@ -226,9 +226,9 @@ RSpec.describe Gitlab::Ci::Config::External::Mapper do
context 'when passing max number of files' do
let(:values) do
{ include: [
- { 'local' => local_file },
- { 'remote' => remote_url }
- ],
+ { 'local' => local_file },
+ { 'remote' => remote_url }
+ ],
image: 'image:1.0' }
end
@@ -242,9 +242,9 @@ RSpec.describe Gitlab::Ci::Config::External::Mapper do
context "when too many 'includes' are defined" do
let(:values) do
{ include: [
- { 'local' => local_file },
- { 'remote' => remote_url }
- ],
+ { 'local' => local_file },
+ { 'remote' => remote_url }
+ ],
image: 'image:1.0' }
end
@@ -425,9 +425,9 @@ RSpec.describe Gitlab::Ci::Config::External::Mapper do
let(:values) do
{ include: [
- { 'local' => 'hello/secret-file1.yml' },
- { 'local' => 'hello/secret-file2.yml' }
- ],
+ { 'local' => 'hello/secret-file1.yml' },
+ { 'local' => 'hello/secret-file2.yml' }
+ ],
image: 'ruby:2.7' }
end
diff --git a/spec/lib/gitlab/ci/parsers/security/common_spec.rb b/spec/lib/gitlab/ci/parsers/security/common_spec.rb
index 828c980dc9a..7dbad354e4c 100644
--- a/spec/lib/gitlab/ci/parsers/security/common_spec.rb
+++ b/spec/lib/gitlab/ci/parsers/security/common_spec.rb
@@ -404,11 +404,11 @@ RSpec.describe Gitlab::Ci::Parsers::Security::Common do
{
'type' => 'source',
'items' => [
- 'signatures' => [
- { 'algorithm' => 'hash', 'value' => 'hash_value' },
- { 'algorithm' => 'location', 'value' => 'location_value' },
- { 'algorithm' => 'scope_offset', 'value' => 'scope_offset_value' }
- ]
+ 'signatures' => [
+ { 'algorithm' => 'hash', 'value' => 'hash_value' },
+ { 'algorithm' => 'location', 'value' => 'location_value' },
+ { 'algorithm' => 'scope_offset', 'value' => 'scope_offset_value' }
+ ]
]
}
end
@@ -426,11 +426,11 @@ RSpec.describe Gitlab::Ci::Parsers::Security::Common do
{
'type' => 'source',
'items' => [
- 'signatures' => [
- { 'algorithm' => 'hash', 'value' => 'hash_value' },
- { 'algorithm' => 'location', 'value' => 'location_value' },
- { 'algorithm' => 'INVALID', 'value' => 'scope_offset_value' }
- ]
+ 'signatures' => [
+ { 'algorithm' => 'hash', 'value' => 'hash_value' },
+ { 'algorithm' => 'location', 'value' => 'location_value' },
+ { 'algorithm' => 'INVALID', 'value' => 'scope_offset_value' }
+ ]
]
}
end
diff --git a/spec/lib/gitlab/ci/reports/codequality_reports_comparer_spec.rb b/spec/lib/gitlab/ci/reports/codequality_reports_comparer_spec.rb
index e289e59b281..effa2c43418 100644
--- a/spec/lib/gitlab/ci/reports/codequality_reports_comparer_spec.rb
+++ b/spec/lib/gitlab/ci/reports/codequality_reports_comparer_spec.rb
@@ -191,11 +191,12 @@ RSpec.describe Gitlab::Ci::Reports::CodequalityReportsComparer do
end
it 'includes the base report errors sorted by severity' do
- expect(existing_errors).to eq([
- blocker_degradation,
- critical_degradation,
- major_degradation
- ])
+ expect(existing_errors).to eq(
+ [
+ blocker_degradation,
+ critical_degradation,
+ major_degradation
+ ])
end
end
@@ -242,11 +243,12 @@ RSpec.describe Gitlab::Ci::Reports::CodequalityReportsComparer do
end
it 'includes errors not found in the base report sorted by severity' do
- expect(new_errors).to eq([
- blocker_degradation,
- critical_degradation,
- minor_degradation
- ])
+ expect(new_errors).to eq(
+ [
+ blocker_degradation,
+ critical_degradation,
+ minor_degradation
+ ])
end
end
@@ -304,11 +306,12 @@ RSpec.describe Gitlab::Ci::Reports::CodequalityReportsComparer do
end
it 'returns the base report errors not found in the head report, sorted by severity' do
- expect(resolved_errors).to eq([
- blocker_degradation,
- critical_degradation,
- minor_degradation
- ])
+ expect(resolved_errors).to eq(
+ [
+ blocker_degradation,
+ critical_degradation,
+ minor_degradation
+ ])
end
end
diff --git a/spec/lib/gitlab/ci/reports/codequality_reports_spec.rb b/spec/lib/gitlab/ci/reports/codequality_reports_spec.rb
index f4b47893805..68e70525c55 100644
--- a/spec/lib/gitlab/ci/reports/codequality_reports_spec.rb
+++ b/spec/lib/gitlab/ci/reports/codequality_reports_spec.rb
@@ -103,15 +103,16 @@ RSpec.describe Gitlab::Ci::Reports::CodequalityReports do
end
it 'sorts degradations based on severity' do
- expect(codequality_report.degradations.values).to eq([
- blocker,
- critical,
- major,
- major_2,
- minor,
- info,
- unknown
- ])
+ expect(codequality_report.degradations.values).to eq(
+ [
+ blocker,
+ critical,
+ major,
+ major_2,
+ minor,
+ info,
+ unknown
+ ])
end
context 'with non-existence and uppercase severities' do
@@ -126,12 +127,13 @@ RSpec.describe Gitlab::Ci::Reports::CodequalityReports do
end
it 'sorts unknown last' do
- expect(other_report.degradations.values).to eq([
- blocker,
- uppercase_major,
- minor,
- non_existent
- ])
+ expect(other_report.degradations.values).to eq(
+ [
+ blocker,
+ uppercase_major,
+ minor,
+ non_existent
+ ])
end
end
end
diff --git a/spec/lib/gitlab/ci/variables/builder/group_spec.rb b/spec/lib/gitlab/ci/variables/builder/group_spec.rb
index 72487588cde..c3743ebd2d7 100644
--- a/spec/lib/gitlab/ci/variables/builder/group_spec.rb
+++ b/spec/lib/gitlab/ci/variables/builder/group_spec.rb
@@ -132,11 +132,12 @@ RSpec.describe Gitlab::Ci::Variables::Builder::Group do
end
it 'orders the variables from least to most matched' do
- variables_collection = Gitlab::Ci::Variables::Collection.new([
- variable,
- partially_matched_variable,
- perfectly_matched_variable
- ]).to_runner_variables
+ variables_collection = Gitlab::Ci::Variables::Collection.new(
+ [
+ variable,
+ partially_matched_variable,
+ perfectly_matched_variable
+ ]).to_runner_variables
expect(subject.to_runner_variables).to eq(variables_collection)
end
diff --git a/spec/lib/gitlab/ci/variables/builder/project_spec.rb b/spec/lib/gitlab/ci/variables/builder/project_spec.rb
index b64b6ea98e2..c1cefc425f5 100644
--- a/spec/lib/gitlab/ci/variables/builder/project_spec.rb
+++ b/spec/lib/gitlab/ci/variables/builder/project_spec.rb
@@ -132,11 +132,12 @@ RSpec.describe Gitlab::Ci::Variables::Builder::Project do
end
it 'puts variables matching environment scope more in the end' do
- variables_collection = Gitlab::Ci::Variables::Collection.new([
- variable,
- partially_matched_variable,
- perfectly_matched_variable
- ]).to_runner_variables
+ variables_collection = Gitlab::Ci::Variables::Collection.new(
+ [
+ variable,
+ partially_matched_variable,
+ perfectly_matched_variable
+ ]).to_runner_variables
expect(subject.to_runner_variables).to eq(variables_collection)
end
diff --git a/spec/lib/gitlab/ci/variables/builder_spec.rb b/spec/lib/gitlab/ci/variables/builder_spec.rb
index 00a41229844..7c361e3f03f 100644
--- a/spec/lib/gitlab/ci/variables/builder_spec.rb
+++ b/spec/lib/gitlab/ci/variables/builder_spec.rb
@@ -264,10 +264,11 @@ RSpec.describe Gitlab::Ci::Variables::Builder, :clean_gitlab_redis_cache do
end
it 'includes #deployment_variables and merges the KUBECONFIG values', :aggregate_failures do
- expect(builder).to receive(:deployment_variables).and_return([
- { key: 'KUBECONFIG', value: 'deployment-kubeconfig' },
- { key: 'OTHER', value: 'some value' }
- ])
+ expect(builder).to receive(:deployment_variables).and_return(
+ [
+ { key: 'KUBECONFIG', value: 'deployment-kubeconfig' },
+ { key: 'OTHER', value: 'some value' }
+ ])
expect(template).to receive(:merge_yaml).with('deployment-kubeconfig')
expect(subject['KUBECONFIG'].value).to eq('example-kubeconfig')
expect(subject['OTHER'].value).to eq('some value')
diff --git a/spec/lib/gitlab/ci/variables/collection/sort_spec.rb b/spec/lib/gitlab/ci/variables/collection/sort_spec.rb
index 57171e5be69..432225c53f0 100644
--- a/spec/lib/gitlab/ci/variables/collection/sort_spec.rb
+++ b/spec/lib/gitlab/ci/variables/collection/sort_spec.rb
@@ -192,13 +192,14 @@ RSpec.describe Gitlab::Ci::Variables::Collection::Sort do
end
it 'preserves relative order of overridden variables' do
- is_expected.to eq([
- { 'TOP_LEVEL_GROUP_NAME' => 'top-level-group' },
- { 'SUBGROUP_VAR' => '$TOP_LEVEL_GROUP_NAME' },
- { 'SUB_GROUP_NAME' => 'vars-in-vars-subgroup' },
- { 'SUBGROUP_VAR' => '$SUB_GROUP_NAME' },
- { 'PROJECT_VAR' => '$SUBGROUP_VAR' }
- ])
+ is_expected.to eq(
+ [
+ { 'TOP_LEVEL_GROUP_NAME' => 'top-level-group' },
+ { 'SUBGROUP_VAR' => '$TOP_LEVEL_GROUP_NAME' },
+ { 'SUB_GROUP_NAME' => 'vars-in-vars-subgroup' },
+ { 'SUBGROUP_VAR' => '$SUB_GROUP_NAME' },
+ { 'PROJECT_VAR' => '$SUBGROUP_VAR' }
+ ])
end
end
end
diff --git a/spec/lib/gitlab/ci/yaml_processor/result_spec.rb b/spec/lib/gitlab/ci/yaml_processor/result_spec.rb
index f7a0905d9da..7f203168706 100644
--- a/spec/lib/gitlab/ci/yaml_processor/result_spec.rb
+++ b/spec/lib/gitlab/ci/yaml_processor/result_spec.rb
@@ -71,10 +71,11 @@ module Gitlab
subject(:yaml_variables_for) { result.yaml_variables_for(job_name) }
it 'returns calculated variables with root and job variables' do
- is_expected.to match_array([
- { key: 'VAR1', value: 'value 11' },
- { key: 'VAR2', value: 'value 2' }
- ])
+ is_expected.to match_array(
+ [
+ { key: 'VAR1', value: 'value 11' },
+ { key: 'VAR2', value: 'value 2' }
+ ])
end
context 'when an absent job is sent' do
diff --git a/spec/lib/gitlab/ci/yaml_processor_spec.rb b/spec/lib/gitlab/ci/yaml_processor_spec.rb
index b710ee092ec..cbc83bcaee3 100644
--- a/spec/lib/gitlab/ci/yaml_processor_spec.rb
+++ b/spec/lib/gitlab/ci/yaml_processor_spec.rb
@@ -1524,13 +1524,14 @@ module Gitlab
config_processor = Gitlab::Ci::YamlProcessor.new(config).execute
expect(config_processor.stage_builds_attributes("test").size).to eq(1)
- expect(config_processor.stage_builds_attributes("test").first[:cache]).to eq([
- paths: ["logs/", "binaries/"],
- untracked: true,
- key: 'key',
- policy: 'pull-push',
- when: 'on_success'
- ])
+ expect(config_processor.stage_builds_attributes("test").first[:cache]).to eq(
+ [
+ paths: ["logs/", "binaries/"],
+ untracked: true,
+ key: 'key',
+ policy: 'pull-push',
+ when: 'on_success'
+ ])
end
it "returns cache when defined in default context" do
@@ -1547,25 +1548,27 @@ module Gitlab
config_processor = Gitlab::Ci::YamlProcessor.new(config).execute
expect(config_processor.stage_builds_attributes("test").size).to eq(1)
- expect(config_processor.stage_builds_attributes("test").first[:cache]).to eq([
- paths: ["logs/", "binaries/"],
- untracked: true,
- key: { files: ['file'] },
- policy: 'pull-push',
- when: 'on_success'
- ])
+ expect(config_processor.stage_builds_attributes("test").first[:cache]).to eq(
+ [
+ paths: ["logs/", "binaries/"],
+ untracked: true,
+ key: { files: ['file'] },
+ policy: 'pull-push',
+ when: 'on_success'
+ ])
end
it 'returns cache key/s when defined in a job' do
- config = YAML.dump({
- rspec: {
- cache: [
- { paths: ['binaries/'], untracked: true, key: 'keya' },
- { paths: ['logs/', 'binaries/'], untracked: true, key: 'key' }
- ],
- script: 'rspec'
- }
- })
+ config = YAML.dump(
+ {
+ rspec: {
+ cache: [
+ { paths: ['binaries/'], untracked: true, key: 'keya' },
+ { paths: ['logs/', 'binaries/'], untracked: true, key: 'key' }
+ ],
+ script: 'rspec'
+ }
+ })
config_processor = Gitlab::Ci::YamlProcessor.new(config).execute
@@ -1605,13 +1608,14 @@ module Gitlab
config_processor = Gitlab::Ci::YamlProcessor.new(config).execute
expect(config_processor.stage_builds_attributes('test').size).to eq(1)
- expect(config_processor.stage_builds_attributes('test').first[:cache]).to eq([
- paths: ['binaries/'],
- untracked: true,
- key: { files: ['file'] },
- policy: 'pull-push',
- when: 'on_success'
- ])
+ expect(config_processor.stage_builds_attributes('test').first[:cache]).to eq(
+ [
+ paths: ['binaries/'],
+ untracked: true,
+ key: { files: ['file'] },
+ policy: 'pull-push',
+ when: 'on_success'
+ ])
end
it 'returns cache files with prefix' do
@@ -1629,54 +1633,58 @@ module Gitlab
config_processor = Gitlab::Ci::YamlProcessor.new(config).execute
expect(config_processor.stage_builds_attributes('test').size).to eq(1)
- expect(config_processor.stage_builds_attributes('test').first[:cache]).to eq([
- paths: ['logs/', 'binaries/'],
- untracked: true,
- key: { files: ['file'], prefix: 'prefix' },
- policy: 'pull-push',
- when: 'on_success'
- ])
+ expect(config_processor.stage_builds_attributes('test').first[:cache]).to eq(
+ [
+ paths: ['logs/', 'binaries/'],
+ untracked: true,
+ key: { files: ['file'], prefix: 'prefix' },
+ policy: 'pull-push',
+ when: 'on_success'
+ ])
end
it "overwrite cache when defined for a job and globally" do
- config = YAML.dump({
- cache: { paths: ["logs/", "binaries/"], untracked: true, key: 'global' },
- rspec: {
- script: "rspec",
- cache: { paths: ["test/"], untracked: false, key: 'local' }
- }
- })
+ config = YAML.dump(
+ {
+ cache: { paths: ["logs/", "binaries/"], untracked: true, key: 'global' },
+ rspec: {
+ script: "rspec",
+ cache: { paths: ["test/"], untracked: false, key: 'local' }
+ }
+ })
config_processor = Gitlab::Ci::YamlProcessor.new(config).execute
expect(config_processor.stage_builds_attributes("test").size).to eq(1)
- expect(config_processor.stage_builds_attributes("test").first[:cache]).to eq([
- paths: ["test/"],
- untracked: false,
- key: 'local',
- policy: 'pull-push',
- when: 'on_success'
- ])
+ expect(config_processor.stage_builds_attributes("test").first[:cache]).to eq(
+ [
+ paths: ["test/"],
+ untracked: false,
+ key: 'local',
+ policy: 'pull-push',
+ when: 'on_success'
+ ])
end
end
describe "Artifacts" do
it "returns artifacts when defined" do
- config = YAML.dump({
- image: "image:1.0",
- services: ["mysql"],
- before_script: ["pwd"],
- rspec: {
- artifacts: {
- paths: ["logs/", "binaries/"],
- expose_as: "Exposed artifacts",
- untracked: true,
- name: "custom_name",
- expire_in: "7d"
- },
- script: "rspec"
- }
- })
+ config = YAML.dump(
+ {
+ image: "image:1.0",
+ services: ["mysql"],
+ before_script: ["pwd"],
+ rspec: {
+ artifacts: {
+ paths: ["logs/", "binaries/"],
+ expose_as: "Exposed artifacts",
+ untracked: true,
+ name: "custom_name",
+ expire_in: "7d"
+ },
+ script: "rspec"
+ }
+ })
config_processor = Gitlab::Ci::YamlProcessor.new(config).execute
diff --git a/spec/lib/gitlab/conflict/file_spec.rb b/spec/lib/gitlab/conflict/file_spec.rb
index aac4936b20e..1fa6eee9813 100644
--- a/spec/lib/gitlab/conflict/file_spec.rb
+++ b/spec/lib/gitlab/conflict/file_spec.rb
@@ -141,19 +141,20 @@ RSpec.describe Gitlab::Conflict::File do
let(:raw_conflict_content) { index.merge_file('files/ruby/popen.rb')[:data] }
it 'assign conflict types and adds match line to the end of the section' do
- expect(diff_line_types).to eq([
- 'match',
- nil, nil, nil,
- "conflict_marker_our",
- "conflict_our",
- "conflict_marker",
- "conflict_their",
- "conflict_their",
- "conflict_their",
- "conflict_marker_their",
- nil, nil, nil,
- "match"
- ])
+ expect(diff_line_types).to eq(
+ [
+ 'match',
+ nil, nil, nil,
+ "conflict_marker_our",
+ "conflict_our",
+ "conflict_marker",
+ "conflict_their",
+ "conflict_their",
+ "conflict_their",
+ "conflict_marker_their",
+ nil, nil, nil,
+ "match"
+ ])
end
end
end
diff --git a/spec/mailers/emails/profile_spec.rb b/spec/mailers/emails/profile_spec.rb
index f6f02f2ba39..073d8aee842 100644
--- a/spec/mailers/emails/profile_spec.rb
+++ b/spec/mailers/emails/profile_spec.rb
@@ -246,6 +246,35 @@ RSpec.describe Emails::Profile do
end
end
+ describe 'user personal access token has been revoked' do
+ let_it_be(:user) { create(:user) }
+ let_it_be(:token) { create(:personal_access_token, user: user) }
+
+ context 'when valid' do
+ subject { Notify.access_token_revoked_email(user, token.name) }
+
+ it_behaves_like 'an email sent from GitLab'
+ it_behaves_like 'it should not have Gmail Actions links'
+ it_behaves_like 'a user cannot unsubscribe through footer link'
+
+ it 'is sent to the user' do
+ is_expected.to deliver_to user.email
+ end
+
+ it 'has the correct subject' do
+ is_expected.to have_subject /^A personal access token has been revoked$/i
+ end
+
+ it 'provides the names of the token' do
+ is_expected.to have_body_text /#{token.name}/
+ end
+
+ it 'includes the email reason' do
+ is_expected.to have_body_text %r{You're receiving this email because of your account on <a .*>localhost<\/a>}
+ end
+ end
+ end
+
describe 'SSH key notification' do
let_it_be_with_reload(:user) { create(:user) }
let_it_be(:fingerprints) { ["aa:bb:cc:dd:ee:zz"] }
diff --git a/spec/services/notification_service_spec.rb b/spec/services/notification_service_spec.rb
index 935dcef1011..8fbf023cda0 100644
--- a/spec/services/notification_service_spec.rb
+++ b/spec/services/notification_service_spec.rb
@@ -337,6 +337,27 @@ RSpec.describe NotificationService, :mailer do
end
end
end
+
+ describe '#access_token_revoked' do
+ let_it_be(:user) { create(:user) }
+ let_it_be(:pat) { create(:personal_access_token, user: user) }
+
+ subject(:notification_service) { notification.access_token_revoked(user, pat.name) }
+
+ it 'sends email to the token owner' do
+ expect { notification_service }.to have_enqueued_email(user, pat.name, mail: "access_token_revoked_email")
+ end
+
+ context 'when user is not allowed to receive notifications' do
+ before do
+ user.block!
+ end
+
+ it 'does not send email to the token owner' do
+ expect { notification_service }.not_to have_enqueued_email(user, pat.name, mail: "access_token_revoked_email")
+ end
+ end
+ end
end
describe 'SSH Keys' do