Commit bf490f3d authored by Kushal Pandya's avatar Kushal Pandya

Merge branch '324154-remove-pick-into-project-ff' into 'master'

Remove :pick_into_project feature flag [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!62809
parents 9fe409eb 0ac685ba
......@@ -3,7 +3,6 @@ import { GlModal, GlForm, GlFormCheckbox, GlSprintf, GlFormGroup } from '@gitlab
import { mapActions, mapState } from 'vuex';
import { BV_SHOW_MODAL } from '~/lib/utils/constants';
import csrf from '~/lib/utils/csrf';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import eventHub from '../event_hub';
import BranchesDropdown from './branches_dropdown.vue';
import ProjectsDropdown from './projects_dropdown.vue';
......@@ -18,7 +17,6 @@ export default {
GlSprintf,
GlFormGroup,
},
mixins: [glFeatureFlagsMixin()],
inject: {
prependedText: {
default: '',
......@@ -116,7 +114,7 @@ export default {
<input type="hidden" name="authenticity_token" :value="$options.csrf.token" />
<gl-form-group
v-if="glFeatures.pickIntoProject && isCherryPick"
v-if="isCherryPick"
:label="i18n.projectLabel"
label-for="start_project"
data-testid="dropdown-group"
......
......@@ -18,7 +18,7 @@ module CreatesCommit
@start_branch ||= @ref || @branch_name
start_project = Feature.enabled?(:pick_into_project, @project, default_enabled: :yaml) ? @project_to_commit_into : @project
start_project = @project_to_commit_into
commit_params = @commit_params.merge(
start_project: start_project,
......
......@@ -19,9 +19,6 @@ class Projects::CommitController < Projects::ApplicationController
before_action :define_commit_box_vars, only: [:show, :pipelines]
before_action :define_note_vars, only: [:show, :diff_for_path, :diff_files]
before_action :authorize_edit_tree!, only: [:revert, :cherry_pick]
before_action do
push_frontend_feature_flag(:pick_into_project, @project, default_enabled: :yaml)
end
BRANCH_SEARCH_LIMIT = 1000
COMMIT_DIFFS_PER_PAGE = 20
......@@ -220,7 +217,6 @@ class Projects::CommitController < Projects::ApplicationController
def find_cherry_pick_target_project
return @project if params[:target_project_id].blank?
return @project unless Feature.enabled?(:pick_into_project, @project, default_enabled: :yaml)
MergeRequestTargetProjectFinder
.new(current_user: current_user, source_project: @project, project_feature: :repository)
......
......@@ -137,8 +137,6 @@ module CommitsHelper
end
def cherry_pick_projects_data(project)
return [] unless Feature.enabled?(:pick_into_project, project, default_enabled: :yaml)
[project, project.forked_from_project].compact.map do |project|
{
id: project.id.to_s,
......
---
name: pick_into_project
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/55970
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/324154
milestone: '13.10'
type: development
group: group::source code
default_enabled: true
......@@ -63,10 +63,7 @@ git cherry-pick -m 2 7a39eb0
### Cherry-pick into a project
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/21268) in GitLab 13.11.
> - It's [deployed behind a feature flag](../../feature_flags.md), disabled by default.
> - It's disabled on GitLab.com.
> - It's not recommended for production use.
> - To use it in GitLab self-managed instances, ask a GitLab administrator to [enable it](#enable-or-disable-cherry-picking-into-a-project). **(FREE SELF)**
> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/324154) in GitLab 14.0
WARNING:
This feature might not be available to you. Check the **version history** note above for details.
......@@ -81,25 +78,6 @@ merge request is from a fork:
1. (Optional) Select **Start a new merge request** if you're ready to create a merge request.
1. Click **Cherry-pick**.
### Enable or disable cherry-picking into a project **(FREE SELF)**
Cherry-picking into a project is under development and not ready for production use. It is
deployed behind a feature flag that is **disabled by default**.
[GitLab administrators with access to the GitLab Rails console](../../../administration/feature_flags.md)
can enable it.
To enable it:
```ruby
Feature.enable(:pick_into_project)
```
To disable it:
```ruby
Feature.disable(:pick_into_project)
```
## Related links
- The [Commits API](../../../api/commits.md) enables you to add custom messages
......
......@@ -380,18 +380,6 @@ RSpec.describe Projects::CommitController do
expect(response).to have_gitlab_http_status(:not_found)
end
end
context 'disable pick_into_project feature flag' do
before do
stub_feature_flags(pick_into_project: false)
end
it 'does not cherry pick a commit from fork to upstream' do
send_request
expect(project.commit('feature').message).not_to include(forked_project.commit.id)
end
end
end
end
......
......@@ -159,12 +159,7 @@ describe('CommitFormModal', () => {
});
it('Changes the target_project_id input value', async () => {
createComponent(
shallowMount,
{},
{ glFeatures: { pickIntoProject: true } },
{ isCherryPick: true },
);
createComponent(shallowMount, {}, {}, { isCherryPick: true });
findProjectsDropdown().vm.$emit('selectProject', '_changed_project_value_');
await wrapper.vm.$nextTick();
......
......@@ -205,16 +205,6 @@ RSpec.describe CommitsHelper do
{ id: forked_project.id.to_s, name: forked_project.full_path, refsUrl: refs_project_path(forked_project) }
])
end
context 'pick_into_project is disabled' do
before do
stub_feature_flags(pick_into_project: false)
end
it 'does not calculate target projects' do
expect(helper.cherry_pick_projects_data(project)).to eq([])
end
end
end
describe "#commit_options_dropdown_data" do
......
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