Commit 411e8901 authored by Vitaly Slobodin's avatar Vitaly Slobodin

Merge branch '297404-remove-suggestions-custom-commit-ff' into 'master'

Remove suggestions custom commit feature flag [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!55344
parents e31fe7dc 29cb7e50
......@@ -468,7 +468,7 @@ const Api = {
applySuggestion(id, message = '') {
const url = Api.buildUrl(Api.applySuggestionPath).replace(':id', encodeURIComponent(id));
const params = gon.features?.suggestionsCustomCommit ? { commit_message: message } : false;
const params = { commit_message: message };
return axios.put(url, params);
},
......
......@@ -62,9 +62,6 @@ export default {
canBeBatched() {
return Boolean(this.glFeatures.batchSuggestions);
},
canAddCustomCommitMessage() {
return this.glFeatures.suggestionsCustomCommit;
},
isApplying() {
return this.isApplyingSingle || this.isApplyingBatch;
},
......@@ -89,11 +86,7 @@ export default {
if (!this.canApply) return;
this.isApplyingSingle = true;
this.$emit(
'apply',
this.applySuggestionCallback,
gon.features?.suggestionsCustomCommit ? message : undefined,
);
this.$emit('apply', this.applySuggestionCallback, message);
},
applySuggestionCallback() {
this.isApplyingSingle = false;
......@@ -158,23 +151,12 @@ export default {
{{ __('Add suggestion to batch') }}
</gl-button>
<apply-suggestion
v-if="canAddCustomCommitMessage"
v-if="isLoggedIn"
:disabled="isDisableButton"
:default-commit-message="defaultCommitMessage"
class="gl-ml-3"
@apply="applySuggestion"
/>
<span v-else v-gl-tooltip.viewport="tooltipMessage" tabindex="0">
<gl-button
v-if="isLoggedIn"
class="btn-inverted js-apply-btn btn-grouped"
:disabled="isDisableButton"
variant="success"
@click="applySuggestion"
>
{{ __('Apply suggestion') }}
</gl-button>
</span>
</div>
</div>
</template>
......@@ -40,7 +40,6 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
push_frontend_feature_flag(:remove_resolve_note, @project, default_enabled: true)
push_frontend_feature_flag(:diffs_gradual_load, @project, default_enabled: true)
push_frontend_feature_flag(:codequality_backend_comparison, @project, default_enabled: :yaml)
push_frontend_feature_flag(:suggestions_custom_commit, @project, default_enabled: true)
push_frontend_feature_flag(:local_file_reviews, default_enabled: :yaml)
push_frontend_feature_flag(:paginated_notes, @project, default_enabled: :yaml)
......
---
title: Remove suggestions custom commit feature flag
merge_request: 55344
author:
type: changed
---
name: suggestions_custom_commit
introduced_by_url:
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/297404
milestone: '13.9'
type: development
group: group::code review
default_enabled: true
......@@ -395,11 +395,8 @@ from any device you're logged into.
## Suggest Changes
> - [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/18008) in GitLab 11.6.
> - Custom commit messages for suggestions was [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/25381) in GitLab 13.9.
> - Custom commit messages for suggestions was deployed behind a [feature flag](../feature_flags.md), disabled by default.
> - Custom commit messages for suggestions became enabled by default on GitLab 13.9.
> - Custom commit messages for suggestions is enabled on GitLab.com and is recommended for production use.
> - For GitLab self-managed instances, GitLab administrators can opt to [disabled it](#enable-or-disable-custom-commit-messages-for-suggestions). **(FREE SELF)**
> - Custom commit messages for suggestions was [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/25381) in GitLab 13.9 behind a [feature flag](../feature_flags.md), disabled by default.
> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/297404) in GitLab 13.10.
As a reviewer, you're able to suggest code changes with a simple
Markdown syntax in Merge Request Diff threads. Then, the
......@@ -426,8 +423,7 @@ the merge request authored by the user that applied them.
1. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/25381) in GitLab 13.9,
you can opt to add a custom commit message to describe your change. If you don't
specify it, the default commit message will be used. Note that [this feature may not be available to you](#enable-or-disable-custom-commit-messages-for-suggestions).
Also, it is not supported for [batch suggestions](#batch-suggestions).
specify it, the default commit message will be used. It is not supported for [batch suggestions](#batch-suggestions).
![Custom commit](img/custom_commit_v13_9.png)
......@@ -501,7 +497,7 @@ For example, to customize the commit message to output
`Addresses %{username}'s review`.
NOTE:
Custom commit messages for each applied Suggestion (and for batch Suggestions) will be
Custom commit messages for each applied Suggestion will be
introduced by [#25381](https://gitlab.com/gitlab-org/gitlab/-/issues/25381).
### Batch Suggestions
......@@ -583,25 +579,6 @@ To disable it:
Feature.disable(:confidential_notes)
```
## Enable or disable Custom commit messages for suggestions **(FREE SELF)**
Custom commit messages for suggestions is under development but ready for production use. It 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.
To disable custom commit messages for suggestions:
```ruby
Feature.disable(:suggestions_custom_commit)
```
To enable custom commit messages for suggestions:
```ruby
Feature.enable(:suggestions_custom_commit)
```
## Enable or disable Batch Suggestions **(FREE SELF)**
Batch Suggestions is
......
import { GlLoadingIcon } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import ApplySuggestion from '~/vue_shared/components/markdown/apply_suggestion.vue';
import SuggestionDiffHeader from '~/vue_shared/components/markdown/suggestion_diff_header.vue';
const DEFAULT_PROPS = {
......@@ -38,7 +39,7 @@ describe('Suggestion Diff component', () => {
wrapper.destroy();
});
const findApplyButton = () => wrapper.find('.js-apply-btn');
const findApplyButton = () => wrapper.find(ApplySuggestion);
const findApplyBatchButton = () => wrapper.find('.js-apply-batch-btn');
const findAddToBatchButton = () => wrapper.find('.js-add-to-batch-btn');
const findRemoveFromBatchButton = () => wrapper.find('.js-remove-from-batch-btn');
......@@ -88,7 +89,7 @@ describe('Suggestion Diff component', () => {
beforeEach(() => {
createComponent();
findApplyButton().vm.$emit('click');
findApplyButton().vm.$emit('apply');
});
it('emits apply', () => {
......
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