Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ jobs:

# send the code coverage for the Ruby part to the coveralls.io
- name: Coveralls GitHub Action
# ignore errors in this step
continue-on-error: true
uses: coverallsapp/github-action@v2
with:
base-path: ./service
Expand All @@ -106,6 +108,8 @@ jobs:
# Rust parts (it needs a separate step, the "carryforward" flag can be used
# only with the "parallel-finished: true" option)
- name: Coveralls Finished
# ignore errors in this step
continue-on-error: true
uses: coverallsapp/github-action@v2
with:
parallel-finished: true
Expand Down
7 changes: 7 additions & 0 deletions products.d/agama-products.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Thu Mar 27 12:35:32 UTC 2025 - Ladislav Slezák <lslezak@suse.com>

- Patterns from extensions are always displayed, the HA extension
pattern can be removed from the display list
(related to jsc#AGM-100)

-------------------------------------------------------------------
Tue Mar 25 11:42:36 UTC 2025 - Eugenio Paolantonio <eugenio.paolantonio@suse.com>

Expand Down
2 changes: 0 additions & 2 deletions products.d/sles_160.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ software:
- mail_server
- printing
- gnome
# displayed only after registering the HA extension
- ha_sles
mandatory_packages:
- NetworkManager
- sudo-policy-wheel-auth-self # explicit wheel group policy to conform new auth model
Expand Down
37 changes: 34 additions & 3 deletions service/lib/agama/software/manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,18 @@ def provision_selected?(tag)
def patterns(filtered)
# huge speed up, preload the used attributes to avoid querying libzypp again,
# see "ListPatterns" method in service/lib/agama/dbus/software/manager.rb
preload = [:category, :description, :icon, :summary, :order, :user_visible]
preload = [:category, :description, :icon, :summary, :order, :source, :user_visible]
patterns = Y2Packager::Resolvable.find({ kind: :pattern }, preload)
patterns = patterns.select(&:user_visible) if filtered

# only display the configured patterns
# only display the configured patterns from the base product, from addons display everything
if product.user_patterns && filtered
patterns.select! { |p| product.user_patterns.include?(p.name) }
base_repos = base_repositories

patterns.select! do |p|
# the pattern is not from a base repository or is included in the display list
!base_repos.include?(p.source) || product.user_patterns.include?(p.name)
end
end

patterns
Expand Down Expand Up @@ -719,6 +724,32 @@ def update_repositories(new_product)
def remove_local_repos
Agama::Software::Repository.all.select(&:local?).each(&:delete!)
end

# Return all enabled repositories belonging to the base product.
#
# @return [Array<Integer>] List of repository IDs, returns empty list if
# no repository is defined yet
def base_repositories
# process only the enabled repositories
only_enabled_repos = true
# the base product repo is the first added repository (the lowest number)
base_src_id = Yast::Pkg.SourceGetCurrent(only_enabled_repos).min
# a repository might not be defined yet
return [] unless base_src_id

# if the base repository comes from a service consider all repositories from that service
# (SCC uses Pool + Updates, use both of them just in case a pattern is updated)
service = Yast::Pkg.SourceGeneralData(base_src_id)["service"]

if service.empty?
[base_src_id]
else
logger.info "The base product is from a service"
Yast::Pkg.SourceGetCurrent(only_enabled_repos).select do |r|
Yast::Pkg.SourceGeneralData(r)["service"] == service
end
end
end
end
end
end
6 changes: 6 additions & 0 deletions service/package/rubygem-agama-yast.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Mar 27 12:35:32 UTC 2025 - Ladislav Slezák <lslezak@suse.com>

- Always display the patterns from extensions (related to
jsc#AGM-100)

-------------------------------------------------------------------
Thu Mar 27 12:40:02 UTC 2025 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

Expand Down
2 changes: 2 additions & 0 deletions service/test/agama/software/manager_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@

describe "#patterns" do
it "returns only the specified patterns" do
allow(Yast::Pkg).to receive(:SourceGetCurrent).and_return([0])
allow(Yast::Pkg).to receive(:SourceGeneralData).and_return({ "service" => "" })
expect(Y2Packager::Resolvable).to receive(:find).and_return(
[
double(
Expand Down
Loading