diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-07-05 20:11:01 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-07-05 20:11:01 +0800 |
commit | 9f5ac179d1ca4819006c66ae385ba7153f6c7e4f (patch) | |
tree | 8dafab8a2f87092dd57c26fbbb70b131d98d9078 /app | |
parent | 9f7e5e45df9b7d99b97e40d1c08250925a408875 (diff) | |
download | gitlab-ce-9f5ac179d1ca4819006c66ae385ba7153f6c7e4f.tar.gz |
Rename ci_config_file to ci_config_path
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/projects/pipelines_settings_controller.rb | 2 | ||||
-rw-r--r-- | app/models/ci/pipeline.rb | 4 | ||||
-rw-r--r-- | app/models/project.rb | 6 | ||||
-rw-r--r-- | app/views/projects/pipelines_settings/_show.html.haml | 6 |
4 files changed, 9 insertions, 9 deletions
diff --git a/app/controllers/projects/pipelines_settings_controller.rb b/app/controllers/projects/pipelines_settings_controller.rb index c3c17afa025..bfc453215c8 100644 --- a/app/controllers/projects/pipelines_settings_controller.rb +++ b/app/controllers/projects/pipelines_settings_controller.rb @@ -23,7 +23,7 @@ class Projects::PipelinesSettingsController < Projects::ApplicationController def update_params params.require(:project).permit( :runners_token, :builds_enabled, :build_allow_git_fetch, :build_timeout_in_minutes, :build_coverage_regex, - :public_builds, :auto_cancel_pending_pipelines, :ci_config_file + :public_builds, :auto_cancel_pending_pipelines, :ci_config_path ) end end diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index 759fdb4bf4c..c5847dee7f7 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -327,10 +327,10 @@ module Ci end def ci_yaml_file_path - if project.ci_config_file.blank? + if project.ci_config_path.blank? '.gitlab-ci.yml' else - project.ci_config_file + project.ci_config_path end end diff --git a/app/models/project.rb b/app/models/project.rb index edc95980729..96400b07b18 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -186,7 +186,7 @@ class Project < ActiveRecord::Base # Validations validates :creator, presence: true, on: :create validates :description, length: { maximum: 2000 }, allow_blank: true - validates :ci_config_file, + validates :ci_config_path, format: { without: /\.{2}/, message: 'cannot include directory traversal.' }, length: { maximum: 255 }, @@ -526,7 +526,7 @@ class Project < ActiveRecord::Base import_data&.destroy end - def ci_config_file=(value) + def ci_config_path=(value) # Strip all leading slashes so that //foo -> foo super(value&.sub(%r{\A/+}, '')&.delete("\0")) end @@ -1025,7 +1025,7 @@ class Project < ActiveRecord::Base visibility_level: visibility_level, path_with_namespace: path_with_namespace, default_branch: default_branch, - ci_config_file: ci_config_file + ci_config_path: ci_config_path } # Backward compatibility diff --git a/app/views/projects/pipelines_settings/_show.html.haml b/app/views/projects/pipelines_settings/_show.html.haml index c9c8bd2610b..0d1c97df3ca 100644 --- a/app/views/projects/pipelines_settings/_show.html.haml +++ b/app/views/projects/pipelines_settings/_show.html.haml @@ -47,11 +47,11 @@ %hr .form-group - = f.label :ci_config_file, 'Custom CI config file', class: 'label-light' - = f.text_field :ci_config_file, class: 'form-control', placeholder: '.gitlab-ci.yml' + = f.label :ci_config_path, 'Custom CI config path', class: 'label-light' + = f.text_field :ci_config_path, class: 'form-control', placeholder: '.gitlab-ci.yml' %p.help-block The path to CI config file. Defaults to <code>.gitlab-ci.yml</code> - = link_to icon('question-circle'), help_page_path('user/project/pipelines/settings', anchor: 'custom-ci-config-file'), target: '_blank' + = link_to icon('question-circle'), help_page_path('user/project/pipelines/settings', anchor: 'custom-ci-config-path'), target: '_blank' %hr .form-group |