From 1786c920fd87e1e3eec25ee7a9d006d5671af0a7 Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 17:55:50 +0000 Subject: [PATCH 01/11] Update gettext to version 3.5.0 --- Gemfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 588c0a6f5..259b828ac 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -115,7 +115,7 @@ GEM fuubar (2.5.1) rspec-core (~> 3.0) ruby-progressbar (~> 1.4) - gettext (3.4.9) + gettext (3.5.0) erubi locale (>= 2.0.5) prime @@ -149,7 +149,7 @@ GEM listen (3.6.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - locale (2.1.3) + locale (2.1.4) loofah (2.23.1) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -172,7 +172,7 @@ GEM parallel (1.22.1) parser (3.1.2.1) ast (~> 2.4.1) - prime (0.1.2) + prime (0.1.3) forwardable singleton prometheus-client (4.2.3) @@ -290,7 +290,7 @@ GEM json (>= 1.8, < 3) simplecov-html (~> 0.10.0) simplecov-html (0.10.2) - singleton (0.1.1) + singleton (0.3.0) spring (2.1.1) spring-commands-rspec (1.0.4) spring (>= 0.9.1) From d8ac561879401ebc1f8b24beac2f73870849eb79 Mon Sep 17 00:00:00 2001 From: Luis Caparroz Date: Mon, 23 Dec 2024 14:39:59 +0100 Subject: [PATCH 02/11] feat: configure SUMA product tree base URL Allow user to configure the SUMA product tree base URL in RMT's config file `mirroring.suma_product_tree_base_url` attribute. The configured value takes precedence over the default (https://scc.suse.com/suma/). --- lib/rmt/mirror/suma_product_tree.rb | 4 +- spec/lib/rmt/mirror/suma_product_tree_spec.rb | 38 ++++++++++++++++--- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/lib/rmt/mirror/suma_product_tree.rb b/lib/rmt/mirror/suma_product_tree.rb index cc0f45a9f..924e2b10c 100644 --- a/lib/rmt/mirror/suma_product_tree.rb +++ b/lib/rmt/mirror/suma_product_tree.rb @@ -3,9 +3,9 @@ class RMT::Mirror::SumaProductTree attr_reader :mirroring_base_dir, :url, :logger - def initialize(logger:, mirroring_base_dir:, url: FILE_URL) + def initialize(logger:, mirroring_base_dir:, url: nil) @mirroring_base_dir = mirroring_base_dir - @url = url + @url = url || Settings.try(:mirroring).try(:suma_product_tree_base_url) || FILE_URL @logger = logger end diff --git a/spec/lib/rmt/mirror/suma_product_tree_spec.rb b/spec/lib/rmt/mirror/suma_product_tree_spec.rb index e010c441d..ca16b5e2a 100644 --- a/spec/lib/rmt/mirror/suma_product_tree_spec.rb +++ b/spec/lib/rmt/mirror/suma_product_tree_spec.rb @@ -12,7 +12,7 @@ let(:ref_configuration) do { relative_path: 'product_tree.json', - base_url: described_class::FILE_URL, + base_url: base_url, cache_dir: nil, base_dir: File.join(base_dir, '/suma/') } @@ -21,11 +21,7 @@ let(:base_dir) { '/tmp' } let(:downloader) { instance_double RMT::Downloader } - describe '#mirror' do - before do - allow(RMT::Downloader).to receive(:new).and_return downloader - end - + shared_examples 'mirror SUMA product tree' do it 'mirrors the product_tree file' do expect(RMT::Mirror::FileReference).to receive(:new).with(**ref_configuration) expect(downloader).to receive(:download_multi) @@ -48,4 +44,34 @@ end end end + + describe '#mirror' do + before do + allow(RMT::Downloader).to receive(:new).and_return downloader + end + + context 'with default SUMA product tree URL' do + before do + allow(Settings).to receive(:try).with(:mirroring).and_return(nil) + end + + it_behaves_like 'mirror SUMA product tree' do + let(:base_url) { 'https://scc.suse.com/suma/' } + end + end + + context 'with custom SUMA product tree URL' do + before do + allow(Settings).to receive(:try).with(:mirroring).and_return(mirroring_configuration) + allow(mirroring_configuration).to receive(:try) + .with(:suma_product_tree_base_url).and_return(base_url) + end + + let(:mirroring_configuration) { instance_double(Config::Options) } + + it_behaves_like 'mirror SUMA product tree' do + let(:base_url) { 'http://localhost:3000/suma/' } + end + end + end end From db348c07297ee23c2689482e9fd28314fec9dcc1 Mon Sep 17 00:00:00 2001 From: Luis Caparroz Date: Mon, 23 Dec 2024 15:11:39 +0100 Subject: [PATCH 03/11] build: Bump version to 2.21 --- lib/rmt.rb | 2 +- package/obs/rmt-server.changes | 6 ++++++ package/obs/rmt-server.spec | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/rmt.rb b/lib/rmt.rb index a68d53a1a..e043c2ad9 100644 --- a/lib/rmt.rb +++ b/lib/rmt.rb @@ -1,5 +1,5 @@ module RMT - VERSION ||= '2.20'.freeze + VERSION ||= '2.21'.freeze DEFAULT_USER = '_rmt'.freeze DEFAULT_GROUP = 'nginx'.freeze diff --git a/package/obs/rmt-server.changes b/package/obs/rmt-server.changes index c86808f99..b4db0c4a7 100644 --- a/package/obs/rmt-server.changes +++ b/package/obs/rmt-server.changes @@ -1,3 +1,9 @@ +Mon Dec 23 14:07:00 UTC 2024 - Luís Caparroz + +- Version 2.21 +- Allow users to configure the SUMA product tree base URL to download + 'product_tree.json' from host other than 'scc.suse.com'. + ------------------------------------------------------------------- Mon Dec 23 08:03:56 UTC 2024 - Parag Jain diff --git a/package/obs/rmt-server.spec b/package/obs/rmt-server.spec index 9803c0228..4652e8be5 100644 --- a/package/obs/rmt-server.spec +++ b/package/obs/rmt-server.spec @@ -34,7 +34,7 @@ %undefine _find_debuginfo_dwz_opts Name: rmt-server -Version: 2.20 +Version: 2.21 Release: 0 Summary: Repository mirroring tool and registration proxy for SCC License: GPL-2.0-or-later From fb82b243073ac81194ce51d9045ab37719f9ec6c Mon Sep 17 00:00:00 2001 From: Adnilson Delgado Date: Thu, 26 Dec 2024 21:15:26 +0000 Subject: [PATCH 04/11] Add bug number to server changes --- package/obs/rmt-server.changes | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/obs/rmt-server.changes b/package/obs/rmt-server.changes index b4db0c4a7..a89738a3c 100644 --- a/package/obs/rmt-server.changes +++ b/package/obs/rmt-server.changes @@ -1,8 +1,8 @@ Mon Dec 23 14:07:00 UTC 2024 - Luís Caparroz - Version 2.21 -- Allow users to configure the SUMA product tree base URL to download - 'product_tree.json' from host other than 'scc.suse.com'. +* Allow users to configure the SUMA product tree base URL to download + 'product_tree.json' from host other than 'scc.suse.com'. (bsc#1234844) ------------------------------------------------------------------- Mon Dec 23 08:03:56 UTC 2024 - Parag Jain From 7c41d2c8481c10ec0c1b3b29b7b37114f2a6297f Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Fri, 27 Dec 2024 22:15:34 +0000 Subject: [PATCH 05/11] Update jwt to version 2.10.1 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 588c0a6f5..4195c05d3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -144,7 +144,7 @@ GEM concurrent-ruby (~> 1.0) json (2.3.1) jsonapi-renderer (0.2.2) - jwt (2.9.3) + jwt (2.10.1) base64 listen (3.6.0) rb-fsevent (~> 0.10, >= 0.10.3) From 285de21b4063121d1be01f326f6e5e200cf875f5 Mon Sep 17 00:00:00 2001 From: Jesus Bermudez Velazquez Date: Mon, 30 Dec 2024 09:35:15 +0000 Subject: [PATCH 06/11] Check for Micro for 6.0 and 6.1 As Micro 6.0 and 6.1 have 'SL-Micro' as identifier adjust the check to Micro to keep it working for SUMA and for bsc#1230419 --- app/controllers/api/connect/v3/systems/products_controller.rb | 2 +- .../strict_authentication/authentication_controller.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/api/connect/v3/systems/products_controller.rb b/app/controllers/api/connect/v3/systems/products_controller.rb index 648443ecd..38a1659b4 100644 --- a/app/controllers/api/connect/v3/systems/products_controller.rb +++ b/app/controllers/api/connect/v3/systems/products_controller.rb @@ -16,7 +16,7 @@ def show if @product.identifier.casecmp?('sles') # if system has SLE Micro # it should access to SLES products - sle_micro = @system.products.any? { |p| p.identifier.downcase.include?('sle-micro') } + sle_micro = @system.products.any? { |p| p.identifier.downcase.include?('micro') } sle_micro_same_arch = @system.products.pluck(:arch).include?(@product.arch) if sle_micro end if @system.products.include?(@product) || sle_micro_same_arch diff --git a/engines/strict_authentication/app/controllers/strict_authentication/authentication_controller.rb b/engines/strict_authentication/app/controllers/strict_authentication/authentication_controller.rb index b3fabfab6..2822c8402 100644 --- a/engines/strict_authentication/app/controllers/strict_authentication/authentication_controller.rb +++ b/engines/strict_authentication/app/controllers/strict_authentication/authentication_controller.rb @@ -40,7 +40,7 @@ def all_allowed_paths(headers) all_product_versions = @system.products.map { |p| Product.where(identifier: p.identifier, arch: p.arch) }.flatten allowed_paths = all_product_versions.map { |prod| prod.repositories.pluck(:local_path) }.flatten # Allow SLE Micro to access all free SLES repositories - sle_micro = @system.products.any? { |p| p.identifier.downcase.include?('sle-micro') } + sle_micro = @system.products.any? { |p| p.identifier.downcase.include?('micro') } if sle_micro system_products_archs = @system.products.pluck(:arch) product_free_sles_modules_only = Product.where( @@ -59,7 +59,7 @@ def all_allowed_paths(headers) manager_prod = @system.products.any? do |p| manager = p.identifier.downcase.include?('manager-server') # SUMA 5.0 must have access to SUMA 4.3, 4.2 and so on - micro = p.identifier.downcase.include?('sle-micro') + micro = p.identifier.downcase.include?('micro') instance_id_header = headers.fetch('X-Instance-Identifier', '').casecmp('suse-manager-server').zero? instance_version_header = headers.fetch('X-Instance-Version', '0').split('.')[0] >= '5' manager || (micro && instance_id_header && instance_version_header) From 594a95db8b7efce0ea104130dd1d595eb49d5f6e Mon Sep 17 00:00:00 2001 From: Adnilson Delgado Date: Mon, 30 Dec 2024 14:15:06 +0000 Subject: [PATCH 07/11] Add env variable to suma_product_tree_base_url --- config/rmt.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/config/rmt.yml b/config/rmt.yml index 6a2df5b5c..e3c849bf2 100644 --- a/config/rmt.yml +++ b/config/rmt.yml @@ -31,6 +31,7 @@ scc: mirroring: mirror_src: false dedup_method: hardlink + suma_product_tree_base_url: <%= ENV['SUMA_PRODUCT_TREE_BASE_URL'] %> http_client: verbose: false From 1809d86dfb5f7c55273ee813c523e67833b7954f Mon Sep 17 00:00:00 2001 From: Jesus Bermudez Velazquez Date: Mon, 30 Dec 2024 16:57:22 +0000 Subject: [PATCH 08/11] Update changelog --- package/obs/rmt-server.changes | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/package/obs/rmt-server.changes b/package/obs/rmt-server.changes index c86808f99..2370cea01 100644 --- a/package/obs/rmt-server.changes +++ b/package/obs/rmt-server.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Dec 30 16:55:41 UTC 2024 - Jesús Bermúdez Velázquez + +- Version 2.21 + * Update Micro check due to Micro 6.0 and 6.1 identifier to keep bsc#1230419 in place + ------------------------------------------------------------------- Mon Dec 23 08:03:56 UTC 2024 - Parag Jain From 63f6994cce382963dc38c77638daf4c0fd1ce7b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Berm=C3=BAdez=20Vel=C3=A1zquez?= Date: Mon, 30 Dec 2024 17:31:55 +0000 Subject: [PATCH 09/11] Update rmt-server.changes merge changelog for the same version --- package/obs/rmt-server.changes | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/package/obs/rmt-server.changes b/package/obs/rmt-server.changes index fde78bf47..7821999d0 100644 --- a/package/obs/rmt-server.changes +++ b/package/obs/rmt-server.changes @@ -1,13 +1,8 @@ Mon Dec 23 14:07:00 UTC 2024 - Luís Caparroz - Version 2.21 -* Allow users to configure the SUMA product tree base URL to download - 'product_tree.json' from host other than 'scc.suse.com'. (bsc#1234844) - -------------------------------------------------------------------- -Mon Dec 30 16:55:41 UTC 2024 - Jesús Bermúdez Velázquez - -- Version 2.21 + * Allow users to configure the SUMA product tree base URL to download + 'product_tree.json' from host other than 'scc.suse.com'. (bsc#1234844) * Update Micro check due to Micro 6.0 and 6.1 identifier to keep bsc#1230419 in place ------------------------------------------------------------------- From 33bd77e957574d57da9fba2f0a66d1c7738e6b6f Mon Sep 17 00:00:00 2001 From: Luis Caparroz Date: Thu, 2 Jan 2025 09:52:46 +0100 Subject: [PATCH 10/11] Revert "Configure SUMA product tree base URL" --- config/rmt.yml | 1 - lib/rmt.rb | 2 +- lib/rmt/mirror/suma_product_tree.rb | 4 +- package/obs/rmt-server.changes | 6 --- package/obs/rmt-server.spec | 2 +- spec/lib/rmt/mirror/suma_product_tree_spec.rb | 38 +++---------------- 6 files changed, 10 insertions(+), 43 deletions(-) diff --git a/config/rmt.yml b/config/rmt.yml index e3c849bf2..6a2df5b5c 100644 --- a/config/rmt.yml +++ b/config/rmt.yml @@ -31,7 +31,6 @@ scc: mirroring: mirror_src: false dedup_method: hardlink - suma_product_tree_base_url: <%= ENV['SUMA_PRODUCT_TREE_BASE_URL'] %> http_client: verbose: false diff --git a/lib/rmt.rb b/lib/rmt.rb index e043c2ad9..a68d53a1a 100644 --- a/lib/rmt.rb +++ b/lib/rmt.rb @@ -1,5 +1,5 @@ module RMT - VERSION ||= '2.21'.freeze + VERSION ||= '2.20'.freeze DEFAULT_USER = '_rmt'.freeze DEFAULT_GROUP = 'nginx'.freeze diff --git a/lib/rmt/mirror/suma_product_tree.rb b/lib/rmt/mirror/suma_product_tree.rb index 924e2b10c..cc0f45a9f 100644 --- a/lib/rmt/mirror/suma_product_tree.rb +++ b/lib/rmt/mirror/suma_product_tree.rb @@ -3,9 +3,9 @@ class RMT::Mirror::SumaProductTree attr_reader :mirroring_base_dir, :url, :logger - def initialize(logger:, mirroring_base_dir:, url: nil) + def initialize(logger:, mirroring_base_dir:, url: FILE_URL) @mirroring_base_dir = mirroring_base_dir - @url = url || Settings.try(:mirroring).try(:suma_product_tree_base_url) || FILE_URL + @url = url @logger = logger end diff --git a/package/obs/rmt-server.changes b/package/obs/rmt-server.changes index a89738a3c..c86808f99 100644 --- a/package/obs/rmt-server.changes +++ b/package/obs/rmt-server.changes @@ -1,9 +1,3 @@ -Mon Dec 23 14:07:00 UTC 2024 - Luís Caparroz - -- Version 2.21 -* Allow users to configure the SUMA product tree base URL to download - 'product_tree.json' from host other than 'scc.suse.com'. (bsc#1234844) - ------------------------------------------------------------------- Mon Dec 23 08:03:56 UTC 2024 - Parag Jain diff --git a/package/obs/rmt-server.spec b/package/obs/rmt-server.spec index 4652e8be5..9803c0228 100644 --- a/package/obs/rmt-server.spec +++ b/package/obs/rmt-server.spec @@ -34,7 +34,7 @@ %undefine _find_debuginfo_dwz_opts Name: rmt-server -Version: 2.21 +Version: 2.20 Release: 0 Summary: Repository mirroring tool and registration proxy for SCC License: GPL-2.0-or-later diff --git a/spec/lib/rmt/mirror/suma_product_tree_spec.rb b/spec/lib/rmt/mirror/suma_product_tree_spec.rb index ca16b5e2a..e010c441d 100644 --- a/spec/lib/rmt/mirror/suma_product_tree_spec.rb +++ b/spec/lib/rmt/mirror/suma_product_tree_spec.rb @@ -12,7 +12,7 @@ let(:ref_configuration) do { relative_path: 'product_tree.json', - base_url: base_url, + base_url: described_class::FILE_URL, cache_dir: nil, base_dir: File.join(base_dir, '/suma/') } @@ -21,7 +21,11 @@ let(:base_dir) { '/tmp' } let(:downloader) { instance_double RMT::Downloader } - shared_examples 'mirror SUMA product tree' do + describe '#mirror' do + before do + allow(RMT::Downloader).to receive(:new).and_return downloader + end + it 'mirrors the product_tree file' do expect(RMT::Mirror::FileReference).to receive(:new).with(**ref_configuration) expect(downloader).to receive(:download_multi) @@ -44,34 +48,4 @@ end end end - - describe '#mirror' do - before do - allow(RMT::Downloader).to receive(:new).and_return downloader - end - - context 'with default SUMA product tree URL' do - before do - allow(Settings).to receive(:try).with(:mirroring).and_return(nil) - end - - it_behaves_like 'mirror SUMA product tree' do - let(:base_url) { 'https://scc.suse.com/suma/' } - end - end - - context 'with custom SUMA product tree URL' do - before do - allow(Settings).to receive(:try).with(:mirroring).and_return(mirroring_configuration) - allow(mirroring_configuration).to receive(:try) - .with(:suma_product_tree_base_url).and_return(base_url) - end - - let(:mirroring_configuration) { instance_double(Config::Options) } - - it_behaves_like 'mirror SUMA product tree' do - let(:base_url) { 'http://localhost:3000/suma/' } - end - end - end end From 77ae477736f1dbf4c39b552a7d02b53176560eac Mon Sep 17 00:00:00 2001 From: Thomas Schmidt Date: Thu, 9 Jan 2025 17:55:05 +0100 Subject: [PATCH 11/11] install libsqlite3-dev --- .github/workflows/lint-unit.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint-unit.yml b/.github/workflows/lint-unit.yml index e97009ec4..670167ca5 100644 --- a/.github/workflows/lint-unit.yml +++ b/.github/workflows/lint-unit.yml @@ -52,6 +52,8 @@ jobs: --health-retries=3 steps: + - name: Install dependencies + run: sudo apt-get install -y libsqlite3-dev - uses: actions/checkout@v4 # Run bundle install and cache the installed gems @@ -96,4 +98,4 @@ jobs: run: | echo "::group::Version verification checks" ruby ci/check-version-matches.rb - echo "::endgroup::" \ No newline at end of file + echo "::endgroup::"