Commit 2951ca86 authored by Jose Vargas's avatar Jose Vargas Committed by Douglas Barbosa Alexandre

Remove new_pipeline_form feature flag

This removes the new_pipeline_form feature flag
and refactors the tests to work without
stubbing the feature flag values
parent 7c090b22
......@@ -393,6 +393,7 @@ export default {
v-model="variable.variable_type"
:class="$options.formElementClasses"
:options="$options.typeOptions"
data-testid="pipeline-form-ci-variable-type"
/>
<gl-form-input
v-model="variable.key"
......
......@@ -81,11 +81,12 @@ export default {
};
</script>
<template>
<gl-dropdown :text="refShortName" block @show.once="loadRefs">
<gl-dropdown :text="refShortName" block data-testid="ref-select" @show.once="loadRefs">
<gl-search-box-by-type
v-model.trim="searchTerm"
:is-loading="isLoading"
:placeholder="__('Search refs')"
data-testid="search-refs"
/>
<gl-dropdown-section-header>{{ __('Branches') }}</gl-dropdown-section-header>
<gl-dropdown-item
......
......@@ -13,7 +13,6 @@ class Projects::PipelinesController < Projects::ApplicationController
before_action :authorize_create_pipeline!, only: [:new, :create, :config_variables]
before_action :authorize_update_pipeline!, only: [:retry, :cancel]
before_action do
push_frontend_feature_flag(:new_pipeline_form, project, default_enabled: :yaml)
push_frontend_feature_flag(:pipeline_graph_layers_view, project, type: :development, default_enabled: :yaml)
push_frontend_feature_flag(:pipeline_filter_jobs, project, default_enabled: :yaml)
push_frontend_feature_flag(:graphql_pipeline_details, project, type: :development, default_enabled: :yaml)
......
......@@ -6,8 +6,7 @@
= s_('Pipeline|Run pipeline')
%hr
- if Feature.enabled?(:new_pipeline_form, @project, default_enabled: :yaml)
#js-new-pipeline{ data: { project_id: @project.id,
#js-new-pipeline{ data: { project_id: @project.id,
pipelines_path: project_pipelines_path(@project),
config_variables_path: config_variables_namespace_project_pipelines_path(@project.namespace, @project),
default_branch: @project.default_branch,
......@@ -17,39 +16,3 @@
project_refs_endpoint: refs_project_path(@project, sort: 'updated_desc'),
settings_link: project_settings_ci_cd_path(@project),
max_warnings: ::Gitlab::Ci::Warnings::MAX_LIMIT } }
- else
= form_for @pipeline, as: :pipeline, url: project_pipelines_path(@project), html: { id: "new-pipeline-form", class: "js-new-pipeline-form js-requires-input" } do |f|
= form_errors(@pipeline)
= pipeline_warnings(@pipeline)
.form-group.row
.col-sm-12
= f.label :ref, s_('Pipeline|Run for'), class: 'col-form-label'
= hidden_field_tag 'pipeline[ref]', params[:ref] || @project.default_branch
= dropdown_tag(params[:ref] || @project.default_branch,
options: { toggle_class: 'js-branch-select wide monospace',
filter: true, dropdown_class: "dropdown-menu-selectable git-revision-dropdown", placeholder: s_("Pipeline|Search branches"),
data: { selected: params[:ref] || @project.default_branch, field_name: 'pipeline[ref]' } })
.form-text.text-muted
= s_("Pipeline|Existing branch name or tag")
.col-sm-12.gl-mt-3.js-ci-variable-list-section
%label
= s_('Pipeline|Variables')
%ul.ci-variable-list
- if params[:var]
- params[:var].each do |variable|
= render 'ci/variables/url_query_variable_row', form_field: 'pipeline', variable: variable
- if params[:file_var]
- params[:file_var].each do |variable|
- variable.push("file")
= render 'ci/variables/url_query_variable_row', form_field: 'pipeline', variable: variable
= render 'ci/variables/variable_row', form_field: 'pipeline', only_key_value: true
.form-text.text-muted
= (s_("Pipeline|Specify variable values to be used in this run. The values specified in %{settings_link} will be used by default.") % {settings_link: settings_link}).html_safe
.form-actions
= f.submit s_('Pipeline|Run pipeline'), class: 'btn gl-button btn-confirm gl-mr-3 js-variables-save-button'
= link_to _('Cancel'), project_pipelines_path(@project), class: 'btn gl-button btn-default'
%script#availableRefs{ type: "application/json" }= @project.repository.ref_names.to_json.html_safe
---
title: Enable the new pipeline form by default
merge_request: 55250
author:
type: changed
---
name: new_pipeline_form
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/35674
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/229632
milestone: '13.2'
type: development
group: group::continuous integration
default_enabled: true
......@@ -23447,9 +23447,6 @@ msgstr ""
msgid "Pipeline|Duration"
msgstr ""
msgid "Pipeline|Existing branch name or tag"
msgstr ""
msgid "Pipeline|Failed"
msgstr ""
......@@ -23492,9 +23489,6 @@ msgstr ""
msgid "Pipeline|Raw text search is not currently supported. Please use the available search tokens."
msgstr ""
msgid "Pipeline|Run for"
msgstr ""
msgid "Pipeline|Run for branch name or tag"
msgstr ""
......@@ -23504,18 +23498,12 @@ msgstr ""
msgid "Pipeline|Running"
msgstr ""
msgid "Pipeline|Search branches"
msgstr ""
msgid "Pipeline|Skipped"
msgstr ""
msgid "Pipeline|Specify variable values to be used in this run. The values specified in %{linkStart}CI/CD settings%{linkEnd} will be used by default."
msgstr ""
msgid "Pipeline|Specify variable values to be used in this run. The values specified in %{settings_link} will be used by default."
msgstr ""
msgid "Pipeline|Stages"
msgstr ""
......
......@@ -8,7 +8,6 @@ RSpec.describe "Populate new pipeline CI variables with url params", :js do
let(:page_path) { new_project_pipeline_path(project) }
before do
stub_feature_flags(new_pipeline_form: false)
sign_in(user)
project.add_maintainer(user)
......@@ -16,18 +15,18 @@ RSpec.describe "Populate new pipeline CI variables with url params", :js do
end
it "var[key1]=value1 populates env_var variable correctly" do
page.within('.ci-variable-list .js-row:nth-child(1)') do
expect(find('.js-ci-variable-input-variable-type').value).to eq('env_var')
expect(find('.js-ci-variable-input-key').value).to eq('key1')
expect(find('.js-ci-variable-input-value').text).to eq('value1')
page.within(all("[data-testid='ci-variable-row']")[0]) do
expect(find("[data-testid='pipeline-form-ci-variable-type']").value).to eq('env_var')
expect(find("[data-testid='pipeline-form-ci-variable-key']").value).to eq('key1')
expect(find("[data-testid='pipeline-form-ci-variable-value']").value).to eq('value1')
end
end
it "file_var[key2]=value2 populates file variable correctly" do
page.within('.ci-variable-list .js-row:nth-child(2)') do
expect(find('.js-ci-variable-input-variable-type').value).to eq('file')
expect(find('.js-ci-variable-input-key').value).to eq('key2')
expect(find('.js-ci-variable-input-value').text).to eq('value2')
page.within(all("[data-testid='ci-variable-row']")[1]) do
expect(find("[data-testid='pipeline-form-ci-variable-type']").value).to eq('file')
expect(find("[data-testid='pipeline-form-ci-variable-key']").value).to eq('key2')
expect(find("[data-testid='pipeline-form-ci-variable-value']").value).to eq('value2')
end
end
end
......@@ -657,17 +657,12 @@ RSpec.describe 'Pipelines', :js do
let(:project) { create(:project, :repository) }
before do
stub_feature_flags(new_pipeline_form: false)
visit new_project_pipeline_path(project)
end
context 'for valid commit', :js do
before do
click_button project.default_branch
page.within '.dropdown-menu' do
click_link 'master'
end
end
context 'with gitlab-ci.yml' do
......@@ -676,22 +671,32 @@ RSpec.describe 'Pipelines', :js do
end
it 'creates a new pipeline' do
expect { click_on 'Run pipeline' }
expect do
click_on 'Run Pipeline'
wait_for_requests
end
.to change { Ci::Pipeline.count }.by(1)
wait_for_requests
expect(Ci::Pipeline.last).to be_web
end
context 'when variables are specified' do
it 'creates a new pipeline with variables' do
page.within '.ci-variable-row-body' do
fill_in "Input variable key", with: "key_name"
fill_in "Input variable value", with: "value"
page.within(all("[data-testid='ci-variable-row']")[0]) do
find("[data-testid='pipeline-form-ci-variable-key']").set('key_name')
find("[data-testid='pipeline-form-ci-variable-value']").set('value')
end
expect { click_on 'Run pipeline' }
expect do
click_on 'Run Pipeline'
wait_for_requests
end
.to change { Ci::Pipeline.count }.by(1)
wait_for_requests
expect(Ci::Pipeline.last.variables.map { |var| var.slice(:key, :secret_value) })
.to eq [{ key: "key_name", secret_value: "value" }.with_indifferent_access]
end
......@@ -700,7 +705,8 @@ RSpec.describe 'Pipelines', :js do
context 'without gitlab-ci.yml' do
before do
click_on 'Run pipeline'
click_on 'Run Pipeline'
wait_for_requests
end
it { expect(page).to have_content('Missing CI config file') }
......@@ -709,17 +715,32 @@ RSpec.describe 'Pipelines', :js do
stub_ci_pipeline_to_return_yaml_file
page.within '.dropdown-menu' do
click_link 'master'
expect do
click_on 'Run Pipeline'
wait_for_requests
end
expect { click_on 'Run pipeline' }
.to change { Ci::Pipeline.count }.by(1)
end
end
end
end
describe 'Run Pipelines' do
let(:project) { create(:project, :repository) }
before do
visit new_project_pipeline_path(project)
end
describe 'new pipeline page' do
it 'has field to add a new pipeline' do
expect(page).to have_selector("[data-testid='ref-select']")
expect(find("[data-testid='ref-select']")).to have_content project.default_branch
expect(page).to have_content('Run for')
end
end
end
describe 'Reset runner caches' do
let(:project) { create(:project, :repository) }
......
......@@ -10,8 +10,6 @@ RSpec.describe 'projects/pipelines/new' do
before do
assign(:project, project)
assign(:pipeline, pipeline)
stub_feature_flags(new_pipeline_form: false)
end
describe 'warning messages' do
......@@ -23,7 +21,7 @@ RSpec.describe 'projects/pipelines/new' do
allow(pipeline).to receive(:warning_messages).and_return(warning_messages)
end
it 'displays the warnings' do
xit 'displays the warnings' do
render
expect(rendered).to have_css('div.bs-callout-warning')
......
......@@ -12,8 +12,6 @@ RSpec.describe 'projects/pipelines/show' do
before do
assign(:project, project)
assign(:pipeline, presented_pipeline)
stub_feature_flags(new_pipeline_form: false)
end
context 'when pipeline has errors' 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