BigW Consortium Gitlab

Commit 433ca739 by Kamil Trzcinski

Make some logic less twistable

parent 1c5b172a
...@@ -52,6 +52,7 @@ v 8.7.0 (unreleased) ...@@ -52,6 +52,7 @@ v 8.7.0 (unreleased)
- Hide `Create a group` help block when creating a new project in a group - Hide `Create a group` help block when creating a new project in a group
- Implement 'TODOs View' as an option for dashboard preferences !3379 (Elias W.) - Implement 'TODOs View' as an option for dashboard preferences !3379 (Elias W.)
- Allow issues and merge requests to be assigned to the author !2765 - Allow issues and merge requests to be assigned to the author !2765
- Make Ci::Commit to group only similar builds and make it stateful (ref, tag) (Kamil Trzciński)
- Gracefully handle notes on deleted commits in merge requests (Stan Hu) - Gracefully handle notes on deleted commits in merge requests (Stan Hu)
- Decouple membership and notifications - Decouple membership and notifications
- Fix creation of merge requests for orphaned branches (Stan Hu) - Fix creation of merge requests for orphaned branches (Stan Hu)
......
...@@ -7,7 +7,7 @@ module Statuseable ...@@ -7,7 +7,7 @@ module Statuseable
def status_sql def status_sql
builds = all.select('count(*)').to_sql builds = all.select('count(*)').to_sql
success = all.success.select('count(*)').to_sql success = all.success.select('count(*)').to_sql
ignored = all.ignored.select('count(*)').to_sql if all.try(:ignored) ignored = all.ignored.select('count(*)').to_sql if all.respond_to?(:ignored)
ignored ||= '0' ignored ||= '0'
pending = all.pending.select('count(*)').to_sql pending = all.pending.select('count(*)').to_sql
running = all.running.select('count(*)').to_sql running = all.running.select('count(*)').to_sql
......
...@@ -58,6 +58,6 @@ ...@@ -58,6 +58,6 @@
%th Coverage %th Coverage
%th %th
= render @builds, commit_sha: true, stage: true, allow_retry: true, coverage: @project.build_coverage_enabled? = render @builds, commit_sha: true, ref: true, stage: true, allow_retry: true, coverage: @project.build_coverage_enabled?
= paginate @builds, theme: 'gitlab' = paginate @builds, theme: 'gitlab'
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
%td %td
= link_to build.short_sha, namespace_project_commit_path(build.project.namespace, build.project, build.sha), class: "monospace" = link_to build.short_sha, namespace_project_commit_path(build.project.namespace, build.project, build.sha), class: "monospace"
- if !defined?(ref) || ref - if defined?(ref) && ref
%td %td
- if build.ref - if build.ref
= link_to build.ref, namespace_project_commits_path(build.project.namespace, build.project, build.ref) = link_to build.ref, namespace_project_commits_path(build.project.namespace, build.project, build.ref)
......
...@@ -15,12 +15,13 @@ ...@@ -15,12 +15,13 @@
- if defined?(commit_sha) && commit_sha - if defined?(commit_sha) && commit_sha
%td %td
= link_to generic_commit_status.short_sha, namespace_project_commit_path(generic_commit_status.project.namespace, generic_commit_status.project, generic_commit_status.sha), class: "monospace" = link_to generic_commit_status.short_sha, namespace_project_commit_path(generic_commit_status.project.namespace, generic_commit_status.project, generic_commit_status.sha), class: "monospace"
%td - if defined?(ref) && ref
- if generic_commit_status.ref %td
= link_to generic_commit_status.ref, namespace_project_commits_path(generic_commit_status.project.namespace, generic_commit_status.project, generic_commit_status.ref) - if generic_commit_status.ref
- else = link_to generic_commit_status.ref, namespace_project_commits_path(generic_commit_status.project.namespace, generic_commit_status.project, generic_commit_status.ref)
.light none - else
.light none
- if defined?(runner) && runner - if defined?(runner) && runner
%td %td
......
...@@ -48,7 +48,7 @@ describe API::API, api: true do ...@@ -48,7 +48,7 @@ describe API::API, api: true do
expect(response.status).to eq(404) expect(response.status).to eq(404)
end end
it "should return not_found for CI status" do it "should return nil for commit without CI" do
get api("/projects/#{project.id}/repository/commits/#{project.repository.commit.id}", user) get api("/projects/#{project.id}/repository/commits/#{project.repository.commit.id}", user)
expect(response.status).to eq(200) expect(response.status).to eq(200)
expect(json_response['status']).to be_nil expect(json_response['status']).to be_nil
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment