summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-01-11 19:09:09 +0000
committerRobert Speicher <robert@gitlab.com>2016-01-11 19:09:09 +0000
commit6fc1aba4a3153e8b0d1bf16be1075012c0cb8459 (patch)
tree70b7591e093004c0598793d3ee38b7bd599b6c88
parent5dad714df6a95413d04c954577a5627234647648 (diff)
parentcdd3a806825db480b9cc9dfd36f3cf58c84e0f61 (diff)
downloadgitlab-ce-6fc1aba4a3153e8b0d1bf16be1075012c0cb8459.tar.gz
Merge branch 'fix/ci-linter-sequence-validations' into 'master'
Allow subsequent validations in CI Linter Closes #5851 See merge request !2368
-rw-r--r--CHANGELOG1
-rw-r--r--app/controllers/ci/lints_controller.rb6
-rw-r--r--app/views/ci/lints/show.html.haml6
-rw-r--r--spec/features/ci_lint_spec.rb8
4 files changed, 16 insertions, 5 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 4d237154acc..d2668490a46 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -33,6 +33,7 @@ v 8.4.0 (unreleased)
- Add file finder feature in tree view (Kyungchul Shin)
- Ajax filter by message for commits page
- API: Add support for deleting a tag via the API (Robert Schilling)
+ - Allow subsequent validations in CI Linter
v 8.3.3 (unreleased)
- Preserve CE behavior with JIRA integration by only calling API if URL is set
diff --git a/app/controllers/ci/lints_controller.rb b/app/controllers/ci/lints_controller.rb
index e782a51e7eb..a7af3cb8345 100644
--- a/app/controllers/ci/lints_controller.rb
+++ b/app/controllers/ci/lints_controller.rb
@@ -6,11 +6,13 @@ module Ci
end
def create
- if params[:content].blank?
+ @content = params[:content]
+
+ if @content.blank?
@status = false
@error = "Please provide content of .gitlab-ci.yml"
else
- @config_processor = Ci::GitlabCiYamlProcessor.new params[:content]
+ @config_processor = Ci::GitlabCiYamlProcessor.new(@content)
@stages = @config_processor.stages
@builds = @config_processor.builds
@status = true
diff --git a/app/views/ci/lints/show.html.haml b/app/views/ci/lints/show.html.haml
index a144c43be47..0044d779c31 100644
--- a/app/views/ci/lints/show.html.haml
+++ b/app/views/ci/lints/show.html.haml
@@ -4,12 +4,12 @@
.row
= form_tag ci_lint_path, method: :post do
.form-group
- = label_tag :content, 'Content of .gitlab-ci.yml', class: 'control-label text-nowrap'
+ = label_tag(:content, 'Content of .gitlab-ci.yml', class: 'control-label text-nowrap')
.col-sm-12
- = text_area_tag :content, nil, class: 'form-control span1', rows: 7, require: true
+ = text_area_tag(:content, @content, class: 'form-control span1', rows: 7, require: true)
.col-sm-12
.pull-left.prepend-top-10
- = submit_tag 'Validate', class: 'btn btn-success submit-yml'
+ = submit_tag('Validate', class: 'btn btn-success submit-yml')
.row.prepend-top-20
.col-sm-12
diff --git a/spec/features/ci_lint_spec.rb b/spec/features/ci_lint_spec.rb
index e6e73e5e67c..30e29d9d552 100644
--- a/spec/features/ci_lint_spec.rb
+++ b/spec/features/ci_lint_spec.rb
@@ -35,5 +35,13 @@ describe 'CI Lint' do
expect(page).to have_content('Error: Please provide content of .gitlab-ci.yml')
end
end
+
+ describe 'YAML revalidate' do
+ let(:yaml_content) { 'my yaml content' }
+
+ it 'loads previous YAML content after validation' do
+ expect(page).to have_field('content', with: 'my yaml content', type: 'textarea')
+ end
+ end
end
end