Commit 87ab5433 authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab master

parents 048cc0c1 73cbbb91
......@@ -182,8 +182,6 @@ Rails/SaveBang:
- 'spec/controllers/groups/runners_controller_spec.rb'
- 'spec/controllers/groups/uploads_controller_spec.rb'
- 'spec/controllers/groups_controller_spec.rb'
- 'spec/controllers/oauth/authorizations_controller_spec.rb'
- 'spec/controllers/omniauth_callbacks_controller_spec.rb'
- 'spec/controllers/profiles/emails_controller_spec.rb'
- 'spec/controllers/profiles/notifications_controller_spec.rb'
- 'spec/controllers/projects_controller_spec.rb'
......
<script>
import { GlButton, GlLoadingIcon, GlTooltipDirective, GlIcon } from '@gitlab/ui';
import { __ } from '~/locale';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import ApplySuggestion from './apply_suggestion.vue';
export default {
components: { GlIcon, GlButton, GlLoadingIcon, ApplySuggestion },
directives: { 'gl-tooltip': GlTooltipDirective },
mixins: [glFeatureFlagsMixin()],
props: {
batchSuggestionsCount: {
type: Number,
......@@ -59,9 +57,6 @@ export default {
};
},
computed: {
canBeBatched() {
return Boolean(this.glFeatures.batchSuggestions);
},
isApplying() {
return this.isApplyingSingle || this.isApplyingBatch;
},
......@@ -118,7 +113,7 @@ export default {
<gl-loading-icon class="d-flex-center mr-2" />
<span>{{ applyingSuggestionsMessage }}</span>
</div>
<div v-else-if="canApply && canBeBatched && isBatched" class="d-flex align-items-center">
<div v-else-if="canApply && isBatched" class="d-flex align-items-center">
<gl-button
class="btn-inverted js-remove-from-batch-btn btn-grouped"
:disabled="isApplying"
......@@ -142,7 +137,7 @@ export default {
</div>
<div v-else class="d-flex align-items-center">
<gl-button
v-if="suggestionsCount > 1 && canBeBatched && !isDisableButton"
v-if="suggestionsCount > 1 && !isDisableButton"
class="btn-inverted js-add-to-batch-btn btn-grouped"
data-qa-selector="add_suggestion_batch_button"
:disabled="isDisableButton"
......
......@@ -30,7 +30,6 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
before_action :check_user_can_push_to_source_branch!, only: [:rebase]
before_action only: [:show] do
push_frontend_feature_flag(:file_identifier_hash)
push_frontend_feature_flag(:batch_suggestions, @project, default_enabled: true)
push_frontend_feature_flag(:approvals_commented_by, @project, default_enabled: true)
push_frontend_feature_flag(:merge_request_widget_graphql, @project, default_enabled: :yaml)
push_frontend_feature_flag(:drag_comment_selection, @project, default_enabled: true)
......
......@@ -29,7 +29,6 @@ class JenkinsService < CiService
end
def execute(data)
return if project.disabled_services.include?(to_param)
return unless supported_events.include?(data[:object_kind])
service_hook.execute(data, "#{data[:object_kind]}_hook")
......
---
title: Remove batch_suggestions feature flag
merge_request: 57745
author:
type: other
---
title: Fix Rails/SaveBang rubocop offenses in auth controllers
merge_request: 57886
author: Abdul Wadood @abdulwd
type: fixed
---
name: batch_suggestions
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/34782
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/320755
milestone: '13.1'
type: development
group: group::code review
default_enabled: true
......@@ -10124,6 +10124,54 @@ Status: `implemented`
Tiers: `premium`, `ultimate`
### `redis_hll_counters.epics_usage.g_project_management_users_updating_fixed_epic_due_date_monthly`
Counts of MAU manually updating fixed due date
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_28d/20210329043548_g_project_management_users_updating_fixed_epic_due_date_monthly.yml)
Group: `group::product planning`
Status: `implemented`
Tiers: `premium`, `ultimate`
### `redis_hll_counters.epics_usage.g_project_management_users_updating_fixed_epic_due_date_weekly`
Counts of WAU manually updating fixed due date
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210329042536_g_project_management_users_updating_fixed_epic_due_date_weekly.yml)
Group: `group::product planning`
Status: `implemented`
Tiers: `premium`, `ultimate`
### `redis_hll_counters.epics_usage.g_project_management_users_updating_fixed_epic_start_date_monthly`
Counts of MAU manually updating fixed start date
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_28d/20210329043509_g_project_management_users_updating_fixed_epic_start_date_monthly.yml)
Group: `group::product planning`
Status: `implemented`
Tiers: `premium`, `ultimate`
### `redis_hll_counters.epics_usage.g_project_management_users_updating_fixed_epic_start_date_weekly`
Counts of WAU manually updating fixed start date
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210329043402_g_project_management_users_updating_fixed_epic_start_date_weekly.yml)
Group: `group::product planning`
Status: `implemented`
Tiers: `premium`, `ultimate`
### `redis_hll_counters.ide_edit.g_edit_by_sfe_monthly`
Missing description
......
......@@ -486,11 +486,9 @@ introduced by [#25381](https://gitlab.com/gitlab-org/gitlab/-/issues/25381).
### Batch Suggestions
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/25486) in GitLab 13.1 as an [alpha feature](https://about.gitlab.com/handbook/product/gitlab-the-product/#alpha).
> - Deployed behind a feature flag, disabled by default.
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/25486) in GitLab 13.1 as an [alpha feature](https://about.gitlab.com/handbook/product/gitlab-the-product/#alpha) behind a feature flag, disabled by default.
> - [Enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/227799) in GitLab 13.2.
> - Enabled on GitLab.com.
> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#enable-or-disable-batch-suggestions).
> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/320755) in GitLab 13.11.
You can apply multiple suggestions at once to reduce the number of commits added
to your branch to address your reviewers' requests.
......@@ -540,7 +538,7 @@ You can assign an issue to a user who made a comment.
In the comment, click the **More Actions** menu and click **Assign to commenting user**.
Click the button again to unassign the commenter.
Click the button again to unassign the commenter.
![Assign to commenting user](img/quickly_assign_commenter_v13_1.png)
......@@ -562,24 +560,3 @@ To disable it:
```ruby
Feature.disable(:confidential_notes)
```
## Enable or disable Batch Suggestions **(FREE SELF)**
Batch Suggestions is
deployed behind a feature flag that is **enabled by default**.
[GitLab administrators with access to the GitLab Rails console](../../administration/feature_flags.md)
can opt to disable it for your instance.
To enable it:
```ruby
# Instance-wide
Feature.enable(:batch_suggestions)
```
To disable it:
```ruby
# Instance-wide
Feature.disable(:batch_suggestions)
```
......@@ -18,38 +18,39 @@ and is automatically configured on [GitHub import](../../../integration/github.m
## Configuration
### Complete these steps on GitHub
This integration requires a [GitHub API token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token)
with `repo:status` access granted:
with `repo:status` access granted.
Complete these steps on GitHub:
1. Go to your "Personal access tokens" page at <https://github.com/settings/tokens>
1. Click "Generate New Token"
1. Ensure that `repo:status` is checked and click "Generate token"
1. Copy the generated token to use on GitLab
1. Go to your **Personal access tokens** page at <https://github.com/settings/tokens>.
1. Select **Generate new token**.
1. Under **Note**, enter a name for the new token.
1. Ensure that `repo:status` is checked and select **Generate token**.
1. Copy the generated token to use in GitLab.
### Complete these steps on GitLab
Complete these steps in GitLab:
1. Navigate to the project you want to configure.
1. Navigate to the [Integrations page](overview.md#accessing-integrations)
1. Click "GitHub".
1. Go to the project you want to configure.
1. Go to the [Integrations page](overview.md#accessing-integrations)
1. Select **GitHub**.
1. Ensure that the **Active** toggle is enabled.
1. Paste the token you've generated on GitHub
1. Enter the path to your project on GitHub, such as `https://github.com/username/repository`
1. Optionally uncheck **Static status check names** checkbox to disable static status check names.
1. Save or optionally click "Test Settings".
1. Paste the token you generated on GitHub.
1. Enter the path to your project on GitHub, such as `https://github.com/username/repository`.
1. (Optional) To disable static status check names, clear the **Static status check names** checkbox.
1. Select **Save changes** or optionally select **Test settings**.
Once the integration is configured, see [Pipelines for external pull requests](../../../ci/ci_cd_for_external_repos/#pipelines-for-external-pull-requests)
After configuring the integration, see [Pipelines for external pull requests](../../../ci/ci_cd_for_external_repos/#pipelines-for-external-pull-requests)
to configure pipelines to run for open pull requests.
#### Static / dynamic status check names
### Static / dynamic status check names
> - Introduced in GitLab 11.5: using static status check names as opt-in option.
> - [In GitLab 12.4](https://gitlab.com/gitlab-org/gitlab/-/issues/9931), static status check names is default behavior for new projects.
This makes it possible to mark these status checks as _Required_ on GitHub.
With **Static status check names** enabled on the integration page, your
GitLab instance host name is appended to a status check name,
whereas in case of dynamic status check names, a branch name is appended.
This makes it possible to mark these status checks as **Required** on GitHub.
When **Static status check names** is enabled on the integration page, your
GitLab instance host name is appended to a status check name.
![Configure GitHub Project Integration](img/github_configuration.png)
When disabled, it uses dynamic status check names and appends the branch name.
......@@ -23,14 +23,14 @@ class GithubService < Service
end
def description
"See pipeline statuses on GitHub for your commits and pull requests"
s_("GithubIntegration|Obtain statuses for commits and pull requests.")
end
def help
return unless project
docs_link = link_to _('Learn more'), help_page_url('user/project/repository/repository_mirroring')
s_("Integrations|This requires mirroring your GitHub repository to this project. %{docs_link}" % { docs_link: docs_link }).html_safe
docs_link = link_to _('What is repository mirroring?'), help_page_url('user/project/repository/repository_mirroring')
s_("GithubIntegration|This requires mirroring your GitHub repository to this project. %{docs_link}" % { docs_link: docs_link }).html_safe
end
def self.to_param
......@@ -38,21 +38,28 @@ class GithubService < Service
end
def fields
learn_more_link_url = help_page_path('user/project/integrations/github', anchor: 'static--dynamic-status-check-name')
learn_more_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: learn_more_link_url }
static_context_field_help = s_('GithubIntegration|Select this if you want GitHub to mark status checks as "Required". %{learn_more_link_start}Learn more%{learn_more_link_end}.').html_safe % { learn_more_link_start: learn_more_link_start, learn_more_link_end: '</a>'.html_safe }
token_url = 'https://github.com/settings/tokens'
token_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: token_url }
token_field_help = s_('GithubIntegration|Create a %{token_link_start}personal access token%{token_link_end} with %{status_html} access granted and paste it here.').html_safe % { token_link_start: token_link_start, token_link_end: '</a>'.html_safe, status_html: '<code>repo:status</code>'.html_safe }
[
{ type: 'password',
name: "token",
required: true,
placeholder: "e.g. 8d3f016698e...",
help: 'Create a <a href="https://github.com/settings/tokens">personal access token</a> with <code>repo:status</code> access granted and paste it here.'.html_safe },
placeholder: "8d3f016698e...",
help: token_field_help },
{ type: 'text',
name: "repository_url",
title: 'Repository URL',
title: s_('GithubIntegration|Repository URL'),
required: true,
placeholder: 'e.g. https://github.com/owner/repository' },
placeholder: 'https://github.com/owner/repository' },
{ type: 'checkbox',
name: "static_context",
title: 'Static status check names',
help: 'GitHub status checks need static name in order to be marked as "required".' }
title: s_('GithubIntegration|Static status check names (optional)'),
help: static_context_field_help }
]
end
......
......@@ -23,6 +23,7 @@ module Epics
track_start_date_fixed_events(epic)
track_due_date_fixed_events(epic)
track_fixed_dates_updated_events(epic)
epic.reset
end
......@@ -59,8 +60,22 @@ module Epics
private
def track_fixed_dates_updated_events(epic)
fixed_start_date_updated = epic.saved_change_to_attribute?(:start_date_fixed)
fixed_due_date_updated = epic.saved_change_to_attribute?(:due_date_fixed)
return unless fixed_start_date_updated || fixed_due_date_updated
if fixed_start_date_updated
::Gitlab::UsageDataCounters::EpicActivityUniqueCounter.track_epic_fixed_start_date_updated_action(author: current_user)
end
if fixed_due_date_updated
::Gitlab::UsageDataCounters::EpicActivityUniqueCounter.track_epic_fixed_due_date_updated_action(author: current_user)
end
end
def track_start_date_fixed_events(epic)
return unless epic.saved_changes.key?('start_date_is_fixed')
return unless epic.saved_change_to_attribute?(:start_date_is_fixed)
if epic.start_date_is_fixed?
::Gitlab::UsageDataCounters::EpicActivityUniqueCounter.track_epic_start_date_set_as_fixed_action(author: current_user)
......@@ -70,7 +85,7 @@ module Epics
end
def track_due_date_fixed_events(epic)
return unless epic.saved_changes.key?('due_date_is_fixed')
return unless epic.saved_change_to_attribute?(:due_date_is_fixed)
if epic.due_date_is_fixed?
::Gitlab::UsageDataCounters::EpicActivityUniqueCounter.track_epic_due_date_set_as_fixed_action(author: current_user)
......@@ -105,11 +120,11 @@ module Epics
end
def track_changes(epic)
if epic.saved_changes.key?('title')
if epic.saved_change_to_attribute?(:title)
::Gitlab::UsageDataCounters::EpicActivityUniqueCounter.track_epic_title_changed_action(author: current_user)
end
if epic.saved_changes.key?('description')
if epic.saved_change_to_attribute?(:description)
::Gitlab::UsageDataCounters::EpicActivityUniqueCounter.track_epic_description_changed_action(author: current_user)
end
end
......
---
title: Track epic change to fixed start/due dates via usage ping
merge_request: 57672
author:
type: other
---
title: Review and revise Integrations/GitHub UI text
merge_request: 57389
author:
type: other
---
# Name of this metric contains g_project_management prefix
# because we are using the same slot from issue_tracking to
# allow data aggregation.
key_path: redis_hll_counters.epics_usage.g_project_management_users_updating_fixed_epic_start_date_monthly
description: Counts of MAU manually updating fixed start date
product_section: dev
product_stage: plan
product_group: group::product planning
product_category: epics_usage
value_type: number
status: implemented
milestone: "13.11"
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/57672
time_frame: 28d
data_source: redis_hll
distribution:
- ee
tier:
- premium
- ultimate
---
# Name of this metric contains g_project_management prefix
# because we are using the same slot from issue_tracking to
# allow data aggregation.
key_path: redis_hll_counters.epics_usage.g_project_management_users_updating_fixed_epic_due_date_monthly
description: Counts of MAU manually updating fixed due date
product_section: dev
product_stage: plan
product_group: group::product planning
product_category: epics_usage
value_type: number
status: implemented
milestone: "13.11"
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/57672
time_frame: 28d
data_source: redis_hll
distribution:
- ee
tier:
- premium
- ultimate
---
# Name of this metric contains g_project_management prefix
# because we are using the same slot from issue_tracking to
# allow data aggregation.
key_path: redis_hll_counters.epics_usage.g_project_management_users_updating_fixed_epic_due_date_weekly
description: Counts of WAU manually updating fixed due date
product_section: dev
product_stage: plan
product_group: group::product planning
product_category: epics_usage
value_type: number
status: implemented
milestone: "13.11"
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/57672
time_frame: 7d
data_source: redis_hll
distribution:
- ee
tier:
- premium
- ultimate
---
# Name of this metric contains g_project_management prefix
# because we are using the same slot from issue_tracking to
# allow data aggregation.
key_path: redis_hll_counters.epics_usage.g_project_management_users_updating_fixed_epic_start_date_weekly
description: Counts of WAU manually updating fixed start date
product_section: dev
product_stage: plan
product_group: group::product planning
product_category: epics_usage
value_type: number
status: implemented
milestone: "13.11"
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/57672
time_frame: 7d
data_source: redis_hll
distribution:
- ee
tier:
- premium
- ultimate
......@@ -17,6 +17,8 @@ module Gitlab
EPIC_START_DATE_SET_AS_INHERITED = 'g_project_management_users_setting_epic_start_date_as_inherited'
EPIC_DUE_DATE_SET_AS_FIXED = 'g_project_management_users_setting_epic_due_date_as_fixed'
EPIC_DUE_DATE_SET_AS_INHERITED = 'g_project_management_users_setting_epic_due_date_as_inherited'
EPIC_FIXED_START_DATE_UPDATED = 'g_project_management_users_updating_fixed_epic_start_date'
EPIC_FIXED_DUE_DATE_UPDATED = 'g_project_management_users_updating_fixed_epic_due_date'
EPIC_ISSUE_ADDED = 'g_project_management_epic_issue_added'
EPIC_CLOSED = 'g_project_management_epic_closed'
EPIC_REOPENED = 'g_project_management_epic_reopened'
......@@ -62,6 +64,14 @@ module Gitlab
track_unique_action(EPIC_DUE_DATE_SET_AS_INHERITED, author)
end
def track_epic_fixed_start_date_updated_action(author:)
track_unique_action(EPIC_FIXED_START_DATE_UPDATED, author)
end
def track_epic_fixed_due_date_updated_action(author:)
track_unique_action(EPIC_FIXED_DUE_DATE_UPDATED, author)
end
def track_epic_issue_added(author:)
track_unique_action(EPIC_ISSUE_ADDED, author)
end
......
......@@ -112,6 +112,18 @@ RSpec.describe Gitlab::UsageDataCounters::EpicActivityUniqueCounter, :clean_gitl
it_behaves_like 'does not track when feature flag is disabled', :track_epics_activity
end
context 'setting as fixed start date event' do
def track_action(params)
described_class.track_epic_fixed_start_date_updated_action(**params)
end
it_behaves_like 'a daily tracked issuable event' do
let(:action) { described_class::EPIC_FIXED_START_DATE_UPDATED }
end
it_behaves_like 'does not track when feature flag is disabled', :track_epics_activity
end
context 'setting as inherited event' do
def track_action(params)
described_class.track_epic_start_date_set_as_inherited_action(**params)
......@@ -138,6 +150,18 @@ RSpec.describe Gitlab::UsageDataCounters::EpicActivityUniqueCounter, :clean_gitl
it_behaves_like 'does not track when feature flag is disabled', :track_epics_activity
end
context 'setting as fixed due date event' do
def track_action(params)
described_class.track_epic_fixed_due_date_updated_action(**params)
end
it_behaves_like 'a daily tracked issuable event' do
let(:action) { described_class::EPIC_FIXED_DUE_DATE_UPDATED }
end
it_behaves_like 'does not track when feature flag is disabled', :track_epics_activity
end
context 'setting as inherited event' do
def track_action(params)
described_class.track_epic_due_date_set_as_inherited_action(**params)
......
......@@ -348,6 +348,7 @@ RSpec.describe Epics::UpdateService do
context 'epic start date fixed or inherited' do
it 'tracks the user action to set as fixed' do
expect(::Gitlab::UsageDataCounters::EpicActivityUniqueCounter).to receive(:track_epic_start_date_set_as_fixed_action)
expect(::Gitlab::UsageDataCounters::EpicActivityUniqueCounter).to receive(:track_epic_fixed_start_date_updated_action)
update_epic(start_date_is_fixed: true, start_date_fixed: Date.today)
end
......@@ -362,6 +363,7 @@ RSpec.describe Epics::UpdateService do
context 'epic due date fixed or inherited' do
it 'tracks the user action to set as fixed' do
expect(::Gitlab::UsageDataCounters::EpicActivityUniqueCounter).to receive(:track_epic_due_date_set_as_fixed_action)
expect(::Gitlab::UsageDataCounters::EpicActivityUniqueCounter).to receive(:track_epic_fixed_due_date_updated_action)
update_epic(due_date_is_fixed: true, due_date_fixed: Date.today)
end
......
......@@ -21,6 +21,8 @@
aggregation: daily
feature_flag: track_epics_activity
# epic notes
- name: g_project_management_users_creating_epic_notes
category: epics_usage
redis_slot: project_management
......@@ -39,24 +41,40 @@
aggregation: daily
feature_flag: track_epics_activity
# start date events
- name: g_project_management_users_setting_epic_start_date_as_fixed
category: epics_usage
redis_slot: project_management
aggregation: daily
feature_flag: track_epics_activity
- name: g_project_management_users_updating_fixed_epic_start_date
category: epics_usage
redis_slot: project_management
aggregation: daily
feature_flag: track_epics_activity
- name: g_project_management_users_setting_epic_start_date_as_inherited
category: epics_usage
redis_slot: project_management
aggregation: daily
feature_flag: track_epics_activity
# due date events
- name: g_project_management_users_setting_epic_due_date_as_fixed
category: epics_usage
redis_slot: project_management
aggregation: daily
feature_flag: track_epics_activity
- name: g_project_management_users_updating_fixed_epic_due_date
category: epics_usage
redis_slot: project_management
aggregation: daily
feature_flag: track_epics_activity
- name: g_project_management_users_setting_epic_due_date_as_inherited
category: epics_usage
redis_slot: project_management
......
......@@ -14450,6 +14450,24 @@ msgstr ""
msgid "Gitea Import"
msgstr ""
msgid "GithubIntegration|Create a %{token_link_start}personal access token%{token_link_end} with %{status_html} access granted and paste it here."
msgstr ""
msgid "GithubIntegration|Obtain statuses for commits and pull requests."
msgstr ""
msgid "GithubIntegration|Repository URL"
msgstr ""
msgid "GithubIntegration|Select this if you want GitHub to mark status checks as \"Required\". %{learn_more_link_start}Learn more%{learn_more_link_end}."
msgstr ""
msgid "GithubIntegration|Static status check names (optional)"
msgstr ""
msgid "GithubIntegration|This requires mirroring your GitHub repository to this project. %{docs_link}"
msgstr ""
msgid "Gitlab Pages"
msgstr ""
......@@ -16709,9 +16727,6 @@ msgstr ""
msgid "Integrations|This integration, and inheriting projects were reset."
msgstr ""
msgid "Integrations|This requires mirroring your GitHub repository to this project. %{docs_link}"
msgstr ""
msgid "Integrations|To keep this project going, create a new issue."
msgstr ""
......@@ -34339,6 +34354,9 @@ msgstr ""
msgid "What does this command do?"
msgstr ""
msgid "What is repository mirroring?"
msgstr ""
msgid "What is squashing?"
msgstr ""
......
......@@ -54,7 +54,7 @@ RSpec.describe Oauth::AuthorizationsController do
shared_examples "Implicit grant can't be used in confidential application" do
context 'when application is confidential' do
before do
application.update(confidential: true)
application.update!(confidential: true)
params[:response_type] = 'token'
end
......@@ -96,7 +96,7 @@ RSpec.describe Oauth::AuthorizationsController do
end
it 'deletes session.user_return_to and redirects when skip authorization' do
application.update(trusted: true)
application.update!(trusted: true)
request.session['user_return_to'] = 'http://example.com'
subject
......
......@@ -60,7 +60,7 @@ RSpec.describe OmniauthCallbacksController, type: :controller do
let(:extern_uid) { 'my-uid' }
before do
user.update(failed_attempts: User.maximum_attempts.pred)
user.update!(failed_attempts: User.maximum_attempts.pred)
subject.response = ActionDispatch::Response.new
end
......@@ -233,7 +233,7 @@ RSpec.describe OmniauthCallbacksController, type: :controller do
before do
stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')
settings = Gitlab::CurrentSettings.current_application_settings
settings.update(disabled_oauth_sign_in_sources: [provider.to_s])
settings.update!(disabled_oauth_sign_in_sources: [provider.to_s])
end
it 'prevents login via POST' do
......@@ -299,7 +299,7 @@ RSpec.describe OmniauthCallbacksController, type: :controller do
before do
stub_omniauth_setting(enabled: true, auto_link_user: true, allow_single_sign_on: ['atlassian_oauth2'])
user.destroy
user.destroy!
end
it 'denies sign-in if sign-up is enabled, but block_auto_created_users is set' do
......@@ -381,7 +381,7 @@ RSpec.describe OmniauthCallbacksController, type: :controller do
context 'sign up' do
before do
user.destroy
user.destroy!
end
it 'denies login if sign up is enabled, but block_auto_created_users is set' do
......
......@@ -16,18 +16,12 @@ const DEFAULT_PROPS = {
describe('Suggestion Diff component', () => {
let wrapper;
const createComponent = (props, glFeatures = {}) => {
const createComponent = (props) => {
wrapper = shallowMount(SuggestionDiffHeader, {
propsData: {
...DEFAULT_PROPS,
...props,
},
provide: {
glFeatures: {
batchSuggestions: true,
...glFeatures,
},
},
});
};
......@@ -211,18 +205,6 @@ describe('Suggestion Diff component', () => {
});
});
describe('batchSuggestions feature flag is set to false', () => {
beforeEach(() => {
createComponent({}, { batchSuggestions: false });
});
it('disables add to batch buttons but keeps apply suggestion enabled', () => {
expect(findApplyButton().exists()).toBe(true);
expect(findAddToBatchButton().exists()).toBe(false);
expect(findApplyButton().attributes('disabled')).not.toBe('true');
});
});
describe('canApply is set to false', () => {
beforeEach(() => {
createComponent({ canApply: false });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment