gitlab-org--gitlab-foss/app/controllers/ci/lints_controller.rb
Grzegorz Bizon d74b254d97 Make CI Lint form synchronous
This removes `remote: true` from CI Lint form, making it synchronous
form. This also removes some complexity related to displaying lint
messages.

View also has been updated, removed deprecated Bootstrap 2 tags.
Improved design.

Closes #4206
2015-12-22 09:40:32 +01:00

28 lines
696 B
Ruby

module Ci
class LintsController < ApplicationController
before_action :authenticate_user!
def show
end
def create
if params[:content].blank?
@status = false
@error = "Please provide content of .gitlab-ci.yml"
else
@config_processor = Ci::GitlabCiYamlProcessor.new params[:content]
@stages = @config_processor.stages
@builds = @config_processor.builds
@status = true
end
rescue Ci::GitlabCiYamlProcessor::ValidationError, Psych::SyntaxError => e
@error = e.message
@status = false
rescue
@error = 'Undefined error'
@status = false
ensure
render :show
end
end
end