Skip to content

Code

Advisory module handling #39

Merged

nazunalika merged 4 commits into resf:main

from rockythorn:advisory-module-handling

Apr 9, 2025

+68 −44

Conversation 1 Commits 4 Checks 0 Files changed 2

Conversation

](https://github.com/rockythorn)

Contributor

###

rockythorn commented Apr 5, 2025

Changes

The level changes introduced in this PR are to properly add all matching module streams to the cloned Rocky advisories. Previously the “cleaned” versions of package nvrs would remove the module stream information which led to the cloned advisories not containing all appropriate module streams.

repomd.py

  • Return both the “cleaned” and “raw” versions of a package name from the clean_nvra_pkg1 and clean_vra` functions.

rh_matcher_activities.py

  • clone_advisory(): Add some code comments
  • process_repomd():
    • add the raw package versions to the raw_package_map dictionary with the key being the “cleaned” nvr and the value being a list of all matching “raw” nvrs.
    • Use the “raw” package name as the value for the nvra_alias dictionary.

Testing

In my local setup for Apollo I compared the advisories generated with main and the advisories generated with these changes in place. There were no Rocky advisories removed and advisories with modules generally saw an increase in the number of linked packages. Having spot checked a number of them I saw that we now included multiple module streams which led to the increased number of associated packages.

(.venv) [mrthorn@rocky-mobile distro-tools]$ python3 -m pytest apollo/tests --ignore node_modules --ignore .venv --ignore-glob "bazel-*" -v
/home/mrthorn/resf/distro-tools/.venv/lib64/python3.9/site-packages/pytest_asyncio/plugin.py:217: PytestDeprecationWarning: The configuration option "asyncio_default_fixture_loop_scope" is unset.
The event loop scope for asynchronous fixtures will default to the fixture caching scope. Future versions of pytest-asyncio will default the loop scope for asynchronous fixtures to function scope. Set the default fixture loop scope explicitly in order to avoid unexpected behavior in the future. Valid fixture loop scopes are: "function", "class", "module", "package", "session"

  warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET))
======================================================= test session starts ========================================================
platform linux -- Python 3.9.21, pytest-8.3.5, pluggy-1.5.0 -- /home/mrthorn/resf/distro-tools/.venv/bin/python3
cachedir: .pytest_cache
rootdir: /home/mrthorn/resf/distro-tools
plugins: mock-3.14.0, asyncio-0.26.0
asyncio: mode=strict, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function
collected 11 items

apollo/tests/publishing_tools/test_apollo_tree.py::test_scan_path_valid_structure PASSED                                     [  9%]
apollo/tests/publishing_tools/test_apollo_tree.py::test_scan_path_multiple_formats PASSED                                    [ 18%]
apollo/tests/publishing_tools/test_apollo_tree.py::test_scan_path_valid_structure_arch_first PASSED                          [ 27%]
apollo/tests/publishing_tools/test_apollo_tree.py::test_fetch_updateinfo_from_apollo_live SKIPPED (Skipping test_fetch_u...) [ 36%]
apollo/tests/publishing_tools/test_apollo_tree.py::test_fetch_updateinfo_from_apollo_live_no_updateinfo SKIPPED (Skippin...) [ 45%]
apollo/tests/publishing_tools/test_apollo_tree.py::test_fetch_updateinfo_from_apollo_mock PASSED                             [ 54%]
apollo/tests/publishing_tools/test_apollo_tree.py::test_gzip_updateinfo PASSED                                               [ 63%]
apollo/tests/publishing_tools/test_apollo_tree.py::test_write_updateinfo_to_file PASSED                                      [ 72%]
apollo/tests/publishing_tools/test_apollo_tree.py::test_update_repomd_xml PASSED                                             [ 81%]
apollo/tests/publishing_tools/test_apollo_tree.py::test_run_apollo_tree PASSED                                               [ 90%]
apollo/tests/publishing_tools/test_apollo_tree.py::test_run_apollo_tree_arch_in_product PASSED                               [100%]

=================================================== 9 passed, 2 skipped in 0.08s ===================================================

Sam Thornton added 4 commits April 1, 2025 16:15

[Fix: include module all module stream builds for advisories](https://github.com/resf/distro-tools/pull/39/commits/6e842d38045972f4c5a15c4998ecdbb58ceb3719 "Fix: include module all module stream builds for advisories")

[6e842d3](https://github.com/resf/distro-tools/pull/39/commits/6e842d38045972f4c5a15c4998ecdbb58ceb3719)

[update to dist compare logic](https://github.com/resf/distro-tools/pull/39/commits/3be0a9758fdd9f274901d9ed66cd177aea760222 "update to dist compare logic")

[3be0a97](https://github.com/resf/distro-tools/pull/39/commits/3be0a9758fdd9f274901d9ed66cd177aea760222)

[remove dist comparison](https://github.com/resf/distro-tools/pull/39/commits/1f5bce942134fdea69de4de8518f914db998ba49 "remove dist comparison")

[1f5bce9](https://github.com/resf/distro-tools/pull/39/commits/1f5bce942134fdea69de4de8518f914db998ba49)

[Cleaning up prior to PR](https://github.com/resf/distro-tools/pull/39/commits/980d686f27ea14fa81be38f53a62b65e6c414181 "Cleaning up prior to PR")

[980d686](https://github.com/resf/distro-tools/pull/39/commits/980d686f27ea14fa81be38f53a62b65e6c414181)

](https://github.com/rockythorn)

Contributor Author

###

rockythorn commented Apr 5, 2025

The advisory that triggered this fix is: https://errata.build.resf.org/RLSA-2024:10219

The live advisory only contains reference to a single module stream:

perl-App-cpanminus-0:1.7044-6.module+el8.10.0+1886+1635aa55.src.rpm
perl-CPAN-DistnameInfo-0:0.12-13.module+el8.10.0+1616+0d20cc68.src.rpm
perl-CPAN-Meta-Check-0:0.014-6.module+el8.10.0+1890+1072d5cf.src.rpm
perl-File-pushd-0:1.014-6.module+el8.10.0+1890+1072d5cf.src.rpm
perl-Module-CPANfile-0:1.1002-7.module+el8.10.0+1890+1072d5cf.src.rpm
perl-Parse-PMFile-0:0.41-7.module+el8.10.0+1890+1072d5cf.src.rpm
perl-String-ShellQuote-0:1.04-24.module+el8.10.0+1890+1072d5cf.src.rpm

After the fix we get all of the module streams that should have this fix:

 perl-App-cpanminus-0:1.7044-6.module+el8.10.0+1886+1635aa55.src.rpm
 perl-App-cpanminus-0:1.7044-6.module+el8.10.0+1886+1e729698.src.rpm
 perl-App-cpanminus-0:1.7044-6.module+el8.10.0+1886+95a09097.src.rpm
 perl-App-cpanminus-0:1.7044-6.module+el8.10.0+1886+c31d99b8.src.rpm
 perl-CPAN-DistnameInfo-0:0.12-13.module+el8.10.0+1616+0d20cc68.src.rpm
 perl-CPAN-DistnameInfo-0:0.12-13.module+el8.10.0+1890+1072d5cf.src.rpm
 perl-CPAN-DistnameInfo-0:0.12-13.module+el8.10.0+1890+281b551b.src.rpm
 perl-CPAN-DistnameInfo-0:0.12-13.module+el8.10.0+1890+318cbfb5.src.rpm
 perl-CPAN-DistnameInfo-0:0.12-13.module+el8.6.0+878+f93dfff7.src.rpm
 perl-CPAN-DistnameInfo-0:0.12-13.module+el8.9.0+1491+219f8fe7.src.rpm
 perl-CPAN-DistnameInfo-0:0.12-13.module+el8.9.0+1491+3507a112.src.rpm
 perl-CPAN-DistnameInfo-0:0.12-13.module+el8.9.0+1491+a1bcd037.src.rpm
 perl-CPAN-Meta-Check-0:0.014-6.module+el8.10.0+1890+1072d5cf.src.rpm
 perl-CPAN-Meta-Check-0:0.014-6.module+el8.10.0+1890+281b551b.src.rpm
 perl-CPAN-Meta-Check-0:0.014-6.module+el8.10.0+1890+318cbfb5.src.rpm
 perl-CPAN-Meta-Check-0:0.014-6.module+el8.10.0+1890+372c0e22.src.rpm
 perl-CPAN-Meta-Check-0:0.014-6.module+el8.9.0+1491+19eb7ac4.src.rpm
 perl-CPAN-Meta-Check-0:0.014-6.module+el8.9.0+1491+219f8fe7.src.rpm
 perl-CPAN-Meta-Check-0:0.014-6.module+el8.9.0+1491+3507a112.src.rpm
 perl-CPAN-Meta-Check-0:0.014-6.module+el8.9.0+1491+a1bcd037.src.rpm
 perl-File-pushd-0:1.014-6.module+el8.10.0+1890+1072d5cf.src.rpm
 perl-File-pushd-0:1.014-6.module+el8.10.0+1890+281b551b.src.rpm
 perl-File-pushd-0:1.014-6.module+el8.10.0+1890+318cbfb5.src.rpm
 perl-File-pushd-0:1.014-6.module+el8.10.0+1890+372c0e22.src.rpm
 perl-File-pushd-0:1.014-6.module+el8.9.0+1491+19eb7ac4.src.rpm
 perl-File-pushd-0:1.014-6.module+el8.9.0+1491+219f8fe7.src.rpm
 perl-File-pushd-0:1.014-6.module+el8.9.0+1491+3507a112.src.rpm
 perl-File-pushd-0:1.014-6.module+el8.9.0+1491+a1bcd037.src.rpm
 perl-Module-CPANfile-0:1.1002-7.module+el8.10.0+1890+1072d5cf.src.rpm
 perl-Module-CPANfile-0:1.1002-7.module+el8.10.0+1890+281b551b.src.rpm
 perl-Module-CPANfile-0:1.1002-7.module+el8.10.0+1890+318cbfb5.src.rpm
 perl-Module-CPANfile-0:1.1002-7.module+el8.10.0+1890+372c0e22.src.rpm
 perl-Module-CPANfile-0:1.1002-7.module+el8.9.0+1491+19eb7ac4.src.rpm
 perl-Module-CPANfile-0:1.1002-7.module+el8.9.0+1491+219f8fe7.src.rpm
 perl-Module-CPANfile-0:1.1002-7.module+el8.9.0+1491+3507a112.src.rpm
 perl-Module-CPANfile-0:1.1002-7.module+el8.9.0+1491+a1bcd037.src.rpm
 perl-Parse-PMFile-0:0.41-7.module+el8.10.0+1890+1072d5cf.src.rpm
 perl-Parse-PMFile-0:0.41-7.module+el8.10.0+1890+281b551b.src.rpm
 perl-Parse-PMFile-0:0.41-7.module+el8.10.0+1890+318cbfb5.src.rpm
 perl-Parse-PMFile-0:0.41-7.module+el8.10.0+1890+372c0e22.src.rpm
 perl-Parse-PMFile-0:0.41-7.module+el8.9.0+1491+19eb7ac4.src.rpm
 perl-Parse-PMFile-0:0.41-7.module+el8.9.0+1491+219f8fe7.src.rpm
 perl-Parse-PMFile-0:0.41-7.module+el8.9.0+1491+3507a112.src.rpm
 perl-Parse-PMFile-0:0.41-7.module+el8.9.0+1491+a1bcd037.src.rpm
 perl-String-ShellQuote-0:1.04-24.module+el8.10.0+1890+1072d5cf.src.rpm
 perl-String-ShellQuote-0:1.04-24.module+el8.10.0+1890+281b551b.src.rpm
 perl-String-ShellQuote-0:1.04-24.module+el8.10.0+1890+318cbfb5.src.rpm
 perl-String-ShellQuote-0:1.04-24.module+el8.10.0+1890+372c0e22.src.rpm
 perl-String-ShellQuote-0:1.04-24.module+el8.9.0+1491+19eb7ac4.src.rpm
 perl-String-ShellQuote-0:1.04-24.module+el8.9.0+1491+219f8fe7.src.rpm
 perl-String-ShellQuote-0:1.04-24.module+el8.9.0+1491+3507a112.src.rpm
 perl-String-ShellQuote-0:1.04-24.module+el8.9.0+1491+a1bcd037.src.rpm

](https://github.com/jason-rodri)

jason-rodri approved these changes Apr 5, 2025

View reviewed changes

](https://github.com/NeilHanlon)NeilHanlon self-assigned this Apr 7, 2025

](https://github.com/nazunalika)

nazunalika approved these changes Apr 9, 2025

View reviewed changes

](https://github.com/nazunalika)nazunalika merged commit 07e21af into resf:main Apr 9, 2025

](https://github.com/rockythorn)rockythorn mentioned this pull request Apr 9, 2025

Apollo: Potential bug in module version parsing #8

Open

Merge info

Pull request successfully merged and closed

You’re all set — the branch has been merged.

](https://github.com/metalllinux)

Add a comment

Comment



Add your comment here…

Markdown is supported

Remember, contributions to this repository should follow our GitHub Community Guidelines.

ProTip! Add .patch or .diff to the end of URLs for Git’s plaintext views.

Reviewers

](https://github.com/nazunalika)nazunalika

](https://github.com/jason-rodri)jason-rodri

Assignees

](https://github.com/NeilHanlon)NeilHanlon

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

None yet

You’re not receiving notifications from this thread.

4 participants

](https://github.com/rockythorn)](https://github.com/nazunalika)](https://github.com/jason-rodri)](https://github.com/NeilHanlon)

© 2025 GitHub, Inc.

Updated: