2018-12-05 23:21:45 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-05-09 12:01:36 +05:30
|
|
|
class Projects::Ci::LintsController < Projects::ApplicationController
|
|
|
|
before_action :authorize_create_pipeline!
|
2020-11-24 15:15:51 +05:30
|
|
|
before_action do
|
|
|
|
push_frontend_feature_flag(:ci_lint_vue, project)
|
|
|
|
end
|
2018-05-09 12:01:36 +05:30
|
|
|
|
2021-01-03 14:25:43 +05:30
|
|
|
feature_category :pipeline_authoring
|
|
|
|
|
2018-05-09 12:01:36 +05:30
|
|
|
def show
|
|
|
|
end
|
|
|
|
|
|
|
|
def create
|
|
|
|
@content = params[:content]
|
2020-10-24 23:57:45 +05:30
|
|
|
@dry_run = params[:dry_run]
|
|
|
|
|
2020-11-24 15:15:51 +05:30
|
|
|
@result = Gitlab::Ci::Lint
|
|
|
|
.new(project: @project, current_user: current_user)
|
|
|
|
.validate(@content, dry_run: @dry_run)
|
2020-10-24 23:57:45 +05:30
|
|
|
|
2020-11-24 15:15:51 +05:30
|
|
|
respond_to do |format|
|
|
|
|
format.html { render :show }
|
|
|
|
format.json do
|
|
|
|
render json: ::Ci::Lint::ResultSerializer.new.represent(@result)
|
2020-10-24 23:57:45 +05:30
|
|
|
end
|
2018-05-09 12:01:36 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|