summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-12-10 18:47:22 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2015-12-11 18:02:09 +0100
commit1e2a4895c803f4881ab63c1816141462fbfa6d2b (patch)
tree6b611a2715c76e39aba03295c71e41b37485bd37
parent3578153d3e838da92587fed88a608d9a5458c37c (diff)
downloadgitlab-ce-1e2a4895c803f4881ab63c1816141462fbfa6d2b.tar.gz
Finishing touches
-rw-r--r--app/helpers/yaml_helper.rb11
-rw-r--r--app/models/commit_status.rb4
-rw-r--r--app/services/ci/create_builds_service.rb2
-rw-r--r--app/views/ci/shared/_guide.html.haml6
-rw-r--r--app/views/projects/commit/_builds.html.haml1
5 files changed, 5 insertions, 19 deletions
diff --git a/app/helpers/yaml_helper.rb b/app/helpers/yaml_helper.rb
deleted file mode 100644
index 17990e1f475..00000000000
--- a/app/helpers/yaml_helper.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-module YamlHelper
- def yaml_web_editor_link(project)
- commits = project.ci_commits
-
- if commits.any? && commits.last.ci_yaml_file
- "#{project.gitlab_url}/edit/master/.gitlab-ci.yml"
- else
- "#{project.gitlab_url}/new/master"
- end
- end
-end
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb
index 579b638706d..77c3f776aab 100644
--- a/app/models/commit_status.rb
+++ b/app/models/commit_status.rb
@@ -50,7 +50,6 @@ class CommitStatus < ActiveRecord::Base
scope :latest, -> { where(id: unscope(:select).select('max(id)').group(:name, :ref)) }
scope :ordered, -> { order(:ref, :stage_idx, :name) }
scope :for_ref, ->(ref) { where(ref: ref) }
- scope :has_coverage?, -> { where.not(coverage: nil).any? }
state_machine :status, initial: :pending do
event :run do
@@ -88,8 +87,7 @@ class CommitStatus < ActiveRecord::Base
state :canceled, value: 'canceled'
end
- delegate :sha, :short_sha, :project,
- to: :commit, prefix: false
+ delegate :sha, :short_sha, to: :commit, prefix: false
# TODO: this should be removed with all references
def before_sha
diff --git a/app/services/ci/create_builds_service.rb b/app/services/ci/create_builds_service.rb
index ba7c4632f49..ad901f2da5d 100644
--- a/app/services/ci/create_builds_service.rb
+++ b/app/services/ci/create_builds_service.rb
@@ -30,7 +30,7 @@ module Ci
tag: tag,
trigger_request: trigger_request,
user: user,
- gl_project_id: commit.gl_project_id)
+ project: commit.project)
build = commit.builds.create!(build_attrs)
build.execute_hooks
diff --git a/app/views/ci/shared/_guide.html.haml b/app/views/ci/shared/_guide.html.haml
index ec768858669..09e7e653521 100644
--- a/app/views/ci/shared/_guide.html.haml
+++ b/app/views/ci/shared/_guide.html.haml
@@ -6,10 +6,8 @@
Add at least one runner to the project.
Go to #{link_to 'Runners page', runners_path(@project), target: :blank} for instructions.
%li
- Put the .gitlab-ci.yml in the root of your repository. Examples can be found in #{link_to "Configuring project (.gitlab-ci.yml)", "http://doc.gitlab.com/ci/yaml/README.html", target: :blank}.
+ Put the .gitlab-ci.yml in the root of your repository. Examples can be found in
+ #{link_to "Configuring project (.gitlab-ci.yml)", "http://doc.gitlab.com/ci/yaml/README.html", target: :blank}.
You can also test your .gitlab-ci.yml in the #{link_to "Lint", ci_lint_path}
%li
- Visit #{link_to 'GitLab project settings', @project.gitlab_url + "/services/gitlab_ci/edit", target: :blank}
- and press the "Test settings" button.
- %li
Return to this page and refresh it, it should show a new build.
diff --git a/app/views/projects/commit/_builds.html.haml b/app/views/projects/commit/_builds.html.haml
index 952f33184fc..c87b06d2f01 100644
--- a/app/views/projects/commit/_builds.html.haml
+++ b/app/views/projects/commit/_builds.html.haml
@@ -22,6 +22,7 @@
%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.project.builds_enabled? && !@ci_commit.ci_yaml_file
.bs-callout.bs-callout-warning