Skip to content

Commit

Permalink
Expand multibuild flavors by default
Browse files Browse the repository at this point in the history
We do this to be consistent with the behaviour showed when passing a
remote project.

Fixes openSUSE#16911
  • Loading branch information
danidoni committed Dec 16, 2024
1 parent 0c02677 commit d2cb7c7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/api/app/controllers/source_project_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ def render_project_issues
end

def render_project_packages
@packages = params.key?(:expand) ? @project.expand_all_packages : @project.packages.pluck(:name)
# TODO: Mirar expand_all_packages
@packages = params.key?(:expand) ? @project.expand_all_packages : @project.packages
render locals: { expand: params.key?(:expand) }, formats: [:xml]
end

Expand Down
13 changes: 10 additions & 3 deletions src/api/app/views/source_project/show.xml.builder
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
xml.directory(count: @packages.count) do
@packages.map do |name, project|
@packages.sort_by(&:name).map do |package, project|
if expand
xml.entry(name: name, originproject: project)
xml.entry(name: package.name, originproject: project)
else
xml.entry(name: name)
if package.multibuild?
xml.entry(name: package.name)
package.multibuild_flavors.each do |flavor|
xml.entry(name: "#{package.name}:#{flavor}", originpackage: package.name)
end
else
xml.entry(name: package.name)
end
end
end
end

0 comments on commit d2cb7c7

Please sign in to comment.