Skip to content

Commit

Permalink
List build problems in staging project page
Browse files Browse the repository at this point in the history
List the build problems in the following format:

PACKAGE_NAME: STATUS1(ARCH1, ARCH2,...) STATUS2(ARCH3,..) ...

openQA problems are not included.

Co-authored-by: Ana María Martínez Gómez <ammartinez@suse.de>
  • Loading branch information
krauselukas and Ana06 committed Nov 15, 2018
1 parent 3177dbb commit f0c46fe
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/api/app/assets/stylesheets/webui2/staging-workflow.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@
}
}

ul .table-list-group-item {
padding: 0.5rem 0.75rem;
background-color: transparent;
}
14 changes: 14 additions & 0 deletions src/api/app/models/staging/staging_project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,22 @@ def overall_state
@overall_state ||= state
end

def problems
@problems ||= cache_problems
end

private

def cache_problems
problems = {}
broken_packages.each do |package|
problems[package[:package]] ||= {}
problems[package[:package]][package[:state]] ||= []
problems[package[:package]][package[:state]] << { repository: package[:repository], arch: package[:arch] }
end
problems.sort
end

def state
return :empty unless staged_requests.exists?
return :unacceptable if untracked_requests.present? || staged_requests.obsolete.present?
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,22 @@
Placeholder for the content
- if project.problems.empty?
.text-center
%i.fas.fa-check-circle.fa-2x.text-success
- else
%ul.list-group.list-group-flush
- project.problems.each do |name, states|
%li.list-group-item.table-list-group-item
= link_to("#{name}:", package_show_path(package: name, project: project))
- states.each do |state, values|
= state
= surround '(', ')' do
- values.each do |value|
- coma = ', ' unless values.last == value
= succeed coma do
- if state == 'unresolvable'
= value[:arch]
- else
= link_to(value[:arch], package_live_build_log_path(package: name,
repository: value[:repository],
project: project,
arch: value[:arch]))

0 comments on commit f0c46fe

Please sign in to comment.