diff --git a/.github/workflows/ci-service.yml b/.github/workflows/ci-service.yml index 21a6bc72fc..34a2bc8cd9 100644 --- a/.github/workflows/ci-service.yml +++ b/.github/workflows/ci-service.yml @@ -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 @@ -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 diff --git a/products.d/agama-products.changes b/products.d/agama-products.changes index 9899402546..a3f326fe8c 100644 --- a/products.d/agama-products.changes +++ b/products.d/agama-products.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Mar 27 12:35:32 UTC 2025 - Ladislav Slezák + +- 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 diff --git a/products.d/sles_160.yaml b/products.d/sles_160.yaml index 20f52bf78b..837d22aa82 100644 --- a/products.d/sles_160.yaml +++ b/products.d/sles_160.yaml @@ -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 diff --git a/service/lib/agama/software/manager.rb b/service/lib/agama/software/manager.rb index 37708c583a..e0e7a6705b 100644 --- a/service/lib/agama/software/manager.rb +++ b/service/lib/agama/software/manager.rb @@ -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 @@ -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] 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 diff --git a/service/package/rubygem-agama-yast.changes b/service/package/rubygem-agama-yast.changes index 6d185c3d6a..a1914592f8 100644 --- a/service/package/rubygem-agama-yast.changes +++ b/service/package/rubygem-agama-yast.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Mar 27 12:35:32 UTC 2025 - Ladislav Slezák + +- Always display the patterns from extensions (related to + jsc#AGM-100) + ------------------------------------------------------------------- Thu Mar 27 12:40:02 UTC 2025 - Imobach Gonzalez Sosa diff --git a/service/test/agama/software/manager_test.rb b/service/test/agama/software/manager_test.rb index 9fa94362ae..ac5c8bdd19 100644 --- a/service/test/agama/software/manager_test.rb +++ b/service/test/agama/software/manager_test.rb @@ -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(