summaryrefslogtreecommitdiff
path: root/app/views/projects
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2015-12-14 10:35:40 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2015-12-14 10:35:40 +0000
commitc81023435795766411c5954a4676ebb215af40a6 (patch)
tree4b71817f8c5d6986c28b70353459a544fe444519 /app/views/projects
parente81ae1e68c03de4442265e4699710421e2f2755c (diff)
parentbaa38f0dc1a0e1af84cd06a35450d772eee2d1c4 (diff)
downloadgitlab-ce-c81023435795766411c5954a4676ebb215af40a6.tar.gz
Merge branch 'ci-project-migrate' into 'master'
Ci Project migrate - This doesn't migrate: allow_git_fetch, coverage_regex, timeout. Since this are project configuration settings I would propose to migrate them to `.gitlab-ci.yml`. - This requires offline migrations. - It simplifies database models making all CI objects to be attached to: Project. - It removes Ci::Project, but makes /ci/projects working by adding method: Project.find_by_ci_id for backward compatibility (badges, triggers). - We should add default `timeout` to Application Settings. - It misses specs. - It is based on ci-services-migrate for now. - It removes CI events. - It removes administrator CI projects overview. - It removes CI application settings. In 8.4 or 8.5 we can remove redundant tables and columns. See merge request !1987
Diffstat (limited to 'app/views/projects')
-rw-r--r--app/views/projects/builds/index.html.haml4
-rw-r--r--app/views/projects/builds/show.html.haml4
-rw-r--r--app/views/projects/ci_settings/_form.html.haml120
-rw-r--r--app/views/projects/ci_settings/_no_runners.html.haml8
-rw-r--r--app/views/projects/ci_settings/edit.html.haml6
-rw-r--r--app/views/projects/commit/_builds.html.haml19
-rw-r--r--app/views/projects/commit_statuses/_commit_status.html.haml2
-rw-r--r--app/views/projects/edit.html.haml56
-rw-r--r--app/views/projects/graphs/ci/_overall.haml11
-rw-r--r--app/views/projects/runners/_runner.html.haml6
-rw-r--r--app/views/projects/runners/_shared_runners.html.haml6
-rw-r--r--app/views/projects/runners/_specific_runners.html.haml2
-rw-r--r--app/views/projects/triggers/index.html.haml8
-rw-r--r--app/views/projects/variables/show.html.haml6
14 files changed, 91 insertions, 167 deletions
diff --git a/app/views/projects/builds/index.html.haml b/app/views/projects/builds/index.html.haml
index fbf2c293db8..1a26908ab11 100644
--- a/app/views/projects/builds/index.html.haml
+++ b/app/views/projects/builds/index.html.haml
@@ -3,7 +3,7 @@
.project-issuable-filter
.controls
- - if @ci_project && can?(current_user, :manage_builds, @project)
+ - if can?(current_user, :manage_builds, @project)
.pull-left.hidden-xs
- if @all_builds.running_or_pending.any?
= link_to 'Cancel running', cancel_all_namespace_project_builds_path(@project.namespace, @project), data: { confirm: 'Are you sure?' }, class: 'btn btn-danger', method: :post
@@ -40,7 +40,7 @@
%thead
%tr
%th Status
- %th Build ID
+ %th Runner
%th Commit
%th Ref
%th Stage
diff --git a/app/views/projects/builds/show.html.haml b/app/views/projects/builds/show.html.haml
index d5e81f84b56..20a5b6a66e7 100644
--- a/app/views/projects/builds/show.html.haml
+++ b/app/views/projects/builds/show.html.haml
@@ -56,7 +56,7 @@
%br
Go to
- = link_to namespace_project_runners_path(@build.gl_project.namespace, @build.gl_project) do
+ = link_to namespace_project_runners_path(@build.project.namespace, @build.project) do
Runners page
.row.prepend-top-default
@@ -113,7 +113,7 @@
%p
%span.attr-name Runner:
- if @build.runner && current_user && current_user.admin
- = link_to "##{@build.runner.id}", ci_admin_runner_path(@build.runner.id)
+ = link_to "##{@build.runner.id}", admin_runner_path(@build.runner.id)
- elsif @build.runner
\##{@build.runner.id}
diff --git a/app/views/projects/ci_settings/_form.html.haml b/app/views/projects/ci_settings/_form.html.haml
deleted file mode 100644
index ee6b8885e2d..00000000000
--- a/app/views/projects/ci_settings/_form.html.haml
+++ /dev/null
@@ -1,120 +0,0 @@
-%h3.page-title
- CI settings
-%hr
-.bs-callout.help-callout
- %p
- If you want to test your .gitlab-ci.yml, you can use special tool - #{link_to "Lint", ci_lint_path}
- %p
- Edit your
- #{link_to ".gitlab-ci.yml using web-editor", yaml_web_editor_link(@ci_project)}
-
-- unless @project.empty_repo?
- %p
- Paste build status image for #{@repository.root_ref} with next link
- = link_to '#', class: 'badge-codes-toggle btn btn-default btn-xs' do
- Status Badge
- .badge-codes-block.bs-callout.bs-callout-info.hide
- %p
- Status badge for
- %span.label.label-info #{@ref}
- branch
- %div
- %label Markdown:
- = text_field_tag 'badge_md', markdown_badge_code(@ci_project, @repository.root_ref), readonly: true, class: 'form-control'
- %label Html:
- = text_field_tag 'badge_html', html_badge_code(@ci_project, @repository.root_ref), readonly: true, class: 'form-control'
-
-= nested_form_for @ci_project, url: namespace_project_ci_settings_path(@project.namespace, @project), html: { class: 'form-horizontal' } do |f|
- - if @ci_project.errors.any?
- #error_explanation
- %p.lead= "#{pluralize(@ci_project.errors.count, "error")} prohibited this project from being saved:"
- .alert.alert-error
- %ul
- - @ci_project.errors.full_messages.each do |msg|
- %li= msg
-
- %fieldset
- %legend Build settings
- .form-group
- = label_tag nil, class: 'control-label' do
- Get code
- .col-sm-10
- %p Get recent application code using the following command:
- .radio
- = label_tag do
- = f.radio_button :allow_git_fetch, 'false'
- %strong git clone
- .light Slower but makes sure you have a clean dir before every build
- .radio
- = label_tag do
- = f.radio_button :allow_git_fetch, 'true'
- %strong git fetch
- .light Faster
- .form-group
- = f.label :timeout_in_minutes, 'Timeout', class: 'control-label'
- .col-sm-10
- = f.number_field :timeout_in_minutes, class: 'form-control', min: '0'
- .light per build in minutes
-
-
- %fieldset
- %legend Build Schedule
- .form-group
- = f.label :always_build, 'Schedule build', class: 'control-label'
- .col-sm-10
- .checkbox
- = f.label :always_build do
- = f.check_box :always_build
- %span.light Repeat last build after X hours if no builds
- .form-group
- = f.label :polling_interval, "Build interval", class: 'control-label'
- .col-sm-10
- = f.number_field :polling_interval, placeholder: '5', min: '0', class: 'form-control'
- .light In hours
-
- %fieldset
- %legend Project settings
- .form-group
- = f.label :default_ref, "Make tabs for the following branches", class: 'control-label'
- .col-sm-10
- = f.text_field :default_ref, class: 'form-control', placeholder: 'master, stable'
- .light You will be able to filter builds by the following branches
- .form-group
- = f.label :public, 'Public mode', class: 'control-label'
- .col-sm-10
- .checkbox
- = f.label :public do
- = f.check_box :public
- %span.light Anyone can see project and builds
- .form-group
- = f.label :coverage_regex, "Test coverage parsing", class: 'control-label'
- .col-sm-10
- .input-group
- %span.input-group-addon /
- = f.text_field :coverage_regex, class: 'form-control', placeholder: '\(\d+.\d+\%\) covered'
- %span.input-group-addon /
- .light We will use this regular expression to find test coverage output in build trace. Leave blank if you want to disable this feature
- .bs-callout.bs-callout-info
- %p Below are examples of regex for existing tools:
- %ul
- %li
- Simplecov (Ruby) -
- %code \(\d+.\d+\%\) covered
- %li
- pytest-cov (Python) -
- %code \d+\%\s*$
- %li
- phpunit --coverage-text --colors=never (PHP) -
- %code ^\s*Lines:\s*\d+.\d+\%
-
- %fieldset
- %legend Advanced settings
- .form-group
- = f.label :token, "CI token", class: 'control-label'
- .col-sm-10
- = f.text_field :token, class: 'form-control', placeholder: 'xEeFCaDAB89'
-
- .form-actions
- = f.submit 'Save changes', class: 'btn btn-save'
- - unless @ci_project.new_record?
- = link_to 'Remove Project', ci_project_path(@ci_project), method: :delete, data: { confirm: 'Project will be removed. Are you sure?' }, class: 'btn btn-danger pull-right'
diff --git a/app/views/projects/ci_settings/_no_runners.html.haml b/app/views/projects/ci_settings/_no_runners.html.haml
deleted file mode 100644
index 1374e6680f9..00000000000
--- a/app/views/projects/ci_settings/_no_runners.html.haml
+++ /dev/null
@@ -1,8 +0,0 @@
-.alert.alert-danger
- %p
- There are NO runners to build this project.
- %br
- You can add Specific runner for this project on Runners page
-
- - if current_user.admin
- or add Shared runner for whole application in admin area.
diff --git a/app/views/projects/ci_settings/edit.html.haml b/app/views/projects/ci_settings/edit.html.haml
deleted file mode 100644
index acc912d4596..00000000000
--- a/app/views/projects/ci_settings/edit.html.haml
+++ /dev/null
@@ -1,6 +0,0 @@
-- page_title "CI Settings"
-
-- if no_runners_for_project?(@ci_project)
- = render 'no_runners'
-
-= render 'form'
diff --git a/app/views/projects/commit/_builds.html.haml b/app/views/projects/commit/_builds.html.haml
index e4d81182c1a..329aaa0bb8b 100644
--- a/app/views/projects/commit/_builds.html.haml
+++ b/app/views/projects/commit/_builds.html.haml
@@ -1,17 +1,17 @@
.gray-content-block.middle-block
.pull-right
- - if @ci_project && can?(current_user, :manage_builds, @ci_commit.gl_project)
+ - if can?(current_user, :manage_builds, @ci_commit.project)
- if @ci_commit.builds.latest.failed.any?(&:retryable?)
- = link_to "Retry failed", retry_builds_namespace_project_commit_path(@ci_commit.gl_project.namespace, @ci_commit.gl_project, @ci_commit.sha), class: 'btn btn-grouped btn-primary', method: :post
+ = link_to "Retry failed", retry_builds_namespace_project_commit_path(@ci_commit.project.namespace, @ci_commit.project, @ci_commit.sha), class: 'btn btn-grouped btn-primary', method: :post
- if @ci_commit.builds.running_or_pending.any?
- = link_to "Cancel running", cancel_builds_namespace_project_commit_path(@ci_commit.gl_project.namespace, @ci_commit.gl_project, @ci_commit.sha), data: { confirm: 'Are you sure?' }, class: 'btn btn-grouped btn-danger', method: :post
+ = link_to "Cancel running", cancel_builds_namespace_project_commit_path(@ci_commit.project.namespace, @ci_commit.project, @ci_commit.sha), data: { confirm: 'Are you sure?' }, class: 'btn btn-grouped btn-danger', method: :post
.oneline
= pluralize @statuses.count(:id), "build"
- if defined?(link_to_commit) && link_to_commit
for commit
- = link_to @ci_commit.short_sha, namespace_project_commit_path(@ci_commit.gl_project.namespace, @ci_commit.gl_project, @ci_commit.sha), class: "monospace"
+ = link_to @ci_commit.short_sha, namespace_project_commit_path(@ci_commit.project.namespace, @ci_commit.project, @ci_commit.sha), class: "monospace"
- if @ci_commit.duration > 0
in
= time_interval_in_words @ci_commit.duration
@@ -22,8 +22,9 @@
%ul
- @ci_commit.yaml_errors.split(",").each do |error|
%li= error
+ You can also test your .gitlab-ci.yml in the #{link_to "Lint", ci_lint_path}
-- if @ci_commit.gl_project.builds_enabled? && !@ci_commit.ci_yaml_file
+- if @ci_commit.project.builds_enabled? && !@ci_commit.ci_yaml_file
.bs-callout.bs-callout-warning
\.gitlab-ci.yml not found in this commit
@@ -38,12 +39,12 @@
%th Name
%th Duration
%th Finished at
- - if @ci_project && @ci_project.coverage_enabled?
+ - if @ci_commit.project.build_coverage_enabled?
%th Coverage
%th
- @ci_commit.refs.each do |ref|
= render partial: "projects/commit_statuses/commit_status", collection: @ci_commit.statuses.for_ref(ref).latest.ordered,
- locals: { coverage: @ci_project.try(:coverage_enabled?), stage: true, allow_retry: true }
+ locals: { coverage: @ci_commit.project.build_coverage_enabled?, stage: true, allow_retry: true }
- if @ci_commit.retried.any?
.gray-content-block.second-block
@@ -60,8 +61,8 @@
%th Name
%th Duration
%th Finished at
- - if @ci_project && @ci_project.coverage_enabled?
+ - if @ci_commit.project.build_coverage_enabled?
%th Coverage
%th
= render partial: "projects/commit_statuses/commit_status", collection: @ci_commit.retried,
- locals: { coverage: @ci_project.try(:coverage_enabled?), stage: true }
+ locals: { coverage: @ci_commit.project.build_coverage_enabled?, stage: true }
diff --git a/app/views/projects/commit_statuses/_commit_status.html.haml b/app/views/projects/commit_statuses/_commit_status.html.haml
index a527bb2f84a..45a00e4d259 100644
--- a/app/views/projects/commit_statuses/_commit_status.html.haml
+++ b/app/views/projects/commit_statuses/_commit_status.html.haml
@@ -69,7 +69,7 @@
- if current_user && can?(current_user, :download_build_artifacts, @project) && commit_status.download_url
= link_to commit_status.download_url, title: 'Download artifacts' do
%i.fa.fa-download
- - if current_user && can?(current_user, :manage_builds, commit_status.gl_project)
+ - if current_user && can?(current_user, :manage_builds, commit_status.project)
- if commit_status.active?
- if commit_status.cancel_url
= link_to commit_status.cancel_url, method: :post, title: 'Cancel' do
diff --git a/app/views/projects/edit.html.haml b/app/views/projects/edit.html.haml
index d865d299135..650629ef1b9 100644
--- a/app/views/projects/edit.html.haml
+++ b/app/views/projects/edit.html.haml
@@ -112,6 +112,62 @@
%hr
= link_to 'Remove avatar', namespace_project_avatar_path(@project.namespace, @project), data: { confirm: "Project avatar will be removed. Are you sure?"}, method: :delete, class: "btn btn-remove btn-sm remove-avatar"
+ %fieldset.features
+ %legend
+ Continuous Integration
+ .form-group
+ .col-sm-offset-2.col-sm-10
+ %p Get recent application code using the following command:
+ .radio
+ = f.label :build_allow_git_fetch do
+ = f.radio_button :build_allow_git_fetch, 'false'
+ %strong git clone
+ %br
+ %span.descr Slower but makes sure you have a clean dir before every build
+ .radio
+ = f.label :build_allow_git_fetch do
+ = f.radio_button :build_allow_git_fetch, 'true'
+ %strong git fetch
+ %br
+ %span.descr Faster
+ .form-group
+ = f.label :build_timeout_in_minutes, 'Timeout', class: 'control-label'
+ .col-sm-10
+ = f.number_field :build_timeout_in_minutes, class: 'form-control', min: '0'
+ %p.help-block per build in minutes
+ .form-group
+ = f.label :build_coverage_regex, "Test coverage parsing", class: 'control-label'
+ .col-sm-10
+ .input-group
+ %span.input-group-addon /
+ = f.text_field :build_coverage_regex, class: 'form-control', placeholder: '\(\d+.\d+\%\) covered'
+ %span.input-group-addon /
+ %p.help-block
+ We will use this regular expression to find test coverage output in build trace.
+ Leave blank if you want to disable this feature
+ .bs-callout.bs-callout-info
+ %p Below are examples of regex for existing tools:
+ %ul
+ %li
+ Simplecov (Ruby) -
+ %code \(\d+.\d+\%\) covered
+ %li
+ pytest-cov (Python) -
+ %code \d+\%\s*$
+ %li
+ phpunit --coverage-text --colors=never (PHP) -
+ %code ^\s*Lines:\s*\d+.\d+\%
+
+
+ %fieldset.features
+ %legend
+ Advanced settings
+ .form-group
+ = f.label :runners_token, "CI token", class: 'control-label'
+ .col-sm-10
+ = f.text_field :runners_token, class: "form-control", placeholder: 'xEeFCaDAB89'
+ %p.help-block The secure token used to checkout project.
+
.form-actions
= f.submit 'Save changes', class: "btn btn-save"
diff --git a/app/views/projects/graphs/ci/_overall.haml b/app/views/projects/graphs/ci/_overall.haml
index cf4285a2671..4b12e5f2da1 100644
--- a/app/views/projects/graphs/ci/_overall.haml
+++ b/app/views/projects/graphs/ci/_overall.haml
@@ -1,20 +1,19 @@
-- ci_project = @project.gitlab_ci_project
%h4 Overall stats
%ul
%li
Total:
- %strong= pluralize ci_project.builds.count(:all), 'build'
+ %strong= pluralize @project.builds.count(:all), 'build'
%li
Successful:
- %strong= pluralize ci_project.builds.success.count(:all), 'build'
+ %strong= pluralize @project.builds.success.count(:all), 'build'
%li
Failed:
- %strong= pluralize ci_project.builds.failed.count(:all), 'build'
+ %strong= pluralize @project.builds.failed.count(:all), 'build'
%li
Success ratio:
%strong
- #{success_ratio(ci_project.builds.success, ci_project.builds.failed)}%
+ #{success_ratio(@project.builds.success, @project.builds.failed)}%
%li
Commits covered:
%strong
- = ci_project.commits.count(:all)
+ = @project.ci_commits.count(:all)
diff --git a/app/views/projects/runners/_runner.html.haml b/app/views/projects/runners/_runner.html.haml
index e6b8a2e6fe7..4d95afc28bb 100644
--- a/app/views/projects/runners/_runner.html.haml
+++ b/app/views/projects/runners/_runner.html.haml
@@ -15,10 +15,10 @@
- if runner.belongs_to_one_project?
= link_to 'Remove runner', runner_path(runner), data: { confirm: "Are you sure?" }, method: :delete, class: 'btn btn-danger btn-sm'
- else
- - runner_project = @ci_project.runner_projects.find_by(runner_id: runner)
- = link_to 'Disable for this project', [:ci, @ci_project, runner_project], data: { confirm: "Are you sure?" }, method: :delete, class: 'btn btn-danger btn-sm'
+ - runner_project = @project.runner_projects.find_by(runner_id: runner)
+ = link_to 'Disable for this project', namespace_project_runner_project_path(@project.namespace, @project, runner_project), data: { confirm: "Are you sure?" }, method: :delete, class: 'btn btn-danger btn-sm'
- elsif runner.specific?
- = form_for [:ci, @ci_project, @ci_project.runner_projects.new] do |f|
+ = form_for [@project.namespace, @project, @project.runner_projects.new] do |f|
= f.hidden_field :runner_id, value: runner.id
= f.submit 'Enable for this project', class: 'btn btn-sm'
.pull-right
diff --git a/app/views/projects/runners/_shared_runners.html.haml b/app/views/projects/runners/_shared_runners.html.haml
index 8be3d379828..6a37f444bb7 100644
--- a/app/views/projects/runners/_shared_runners.html.haml
+++ b/app/views/projects/runners/_shared_runners.html.haml
@@ -3,11 +3,11 @@
.bs-callout.bs-callout-warning
GitLab Runners do not offer secure isolation between projects that they do builds for. You are TRUSTING all GitLab users who can push code to project A, B or C to run shell scripts on the machine hosting runner X.
%hr
- - if @ci_project.shared_runners_enabled
- = link_to toggle_shared_runners_ci_project_path(@ci_project), class: 'btn btn-warning', method: :post do
+ - if @project.shared_runners_enabled?
+ = link_to toggle_shared_runners_namespace_project_runners_path(@project.namespace, @project), class: 'btn btn-warning', method: :post do
Disable shared runners
- else
- = link_to toggle_shared_runners_ci_project_path(@ci_project), class: 'btn btn-success', method: :post do
+ = link_to toggle_shared_runners_namespace_project_runners_path(@project.namespace, @project), class: 'btn btn-success', method: :post do
Enable shared runners
&nbsp; for this project
diff --git a/app/views/projects/runners/_specific_runners.html.haml b/app/views/projects/runners/_specific_runners.html.haml
index c13625c7e49..30cd1263a12 100644
--- a/app/views/projects/runners/_specific_runners.html.haml
+++ b/app/views/projects/runners/_specific_runners.html.haml
@@ -12,7 +12,7 @@
%code #{ci_root_url(only_path: false)}
%li
Use the following registration token during setup:
- %code #{@ci_project.token}
+ %code #{@project.runners_token}
%li
Start runner!
diff --git a/app/views/projects/triggers/index.html.haml b/app/views/projects/triggers/index.html.haml
index b3ad79a200e..bd346c4b8e6 100644
--- a/app/views/projects/triggers/index.html.haml
+++ b/app/views/projects/triggers/index.html.haml
@@ -36,7 +36,8 @@
:plain
curl -X POST \
-F token=TOKEN \
- #{ci_build_trigger_url(@ci_project.id, 'REF_NAME')}
+ -F ref=REF_NAME \
+ #{builds_trigger_url(@project.id)}
%h3
Use .gitlab-ci.yml
@@ -51,7 +52,7 @@
trigger:
type: deploy
script:
- - "curl -X POST -F token=TOKEN #{ci_build_trigger_url(@ci_project.id, 'REF_NAME')}"
+ - "curl -X POST -F token=TOKEN -F ref=REF_NAME #{builds_trigger_url(@project.id)}"
%h3
Pass build variables
@@ -65,5 +66,6 @@
:plain
curl -X POST \
-F token=TOKEN \
+ -F "ref=REF_NAME" \
-F "variables[RUN_NIGHTLY_BUILD]=true" \
- #{ci_build_trigger_url(@ci_project.id, 'REF_NAME')}
+ #{builds_trigger_url(@project.id)}
diff --git a/app/views/projects/variables/show.html.haml b/app/views/projects/variables/show.html.haml
index e052da1ac43..e80dffc1ced 100644
--- a/app/views/projects/variables/show.html.haml
+++ b/app/views/projects/variables/show.html.haml
@@ -10,13 +10,13 @@
%hr
-= nested_form_for @ci_project, url: url_for(controller: 'projects/variables', action: 'update'), html: { class: 'form-horizontal' } do |f|
+= nested_form_for @project, url: url_for(controller: 'projects/variables', action: 'update'), html: { class: 'form-horizontal' } do |f|
- if @project.errors.any?
#error_explanation
- %p.lead= "#{pluralize(@ci_project.errors.count, "error")} prohibited this project from being saved:"
+ %p.lead= "#{pluralize(@project.errors.count, "error")} prohibited this project from being saved:"
.alert.alert-error
%ul
- - @ci_project.errors.full_messages.each do |msg|
+ - @project.errors.full_messages.each do |msg|
%li= msg
= f.fields_for :variables do |variable_form|