Skip to content

Better support for dnf5 in Fedora 41/42#67975

Open
gregoster wants to merge 13 commits into
saltstack:masterfrom
gregoster:dnf5groupfix
Open

Better support for dnf5 in Fedora 41/42#67975
gregoster wants to merge 13 commits into
saltstack:masterfrom
gregoster:dnf5groupfix

Conversation

@gregoster

@gregoster gregoster commented Apr 21, 2025

Copy link
Copy Markdown

'grouplist' and 'groupinfo' are each now two words. 'group' and 'group-id' have been replaced with 'name' and 'id', so check for those too.

What does this PR do?

Improve support for installing via groups with dnf5 on Fedora 41/42. Issue found when attempting to run salt 3007 on Fedora 42. Problem also exists in master/main, so starting there.

What issues does this PR fix or reference?

Fixes salt failing on a Fedora 41/42 install when (e.g.) installing KDE Fonts via a group:

Fonts:
  pkg.group_installed

The name of the group doesn't seem to matter -- all groups fail, as 'groupinfo' and 'grouplist' have been deprecated since dnf5 as shipped with Fedora 41.

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

No

@gregoster gregoster requested a review from a team as a code owner April 21, 2025 20:29
@welcome

welcome Bot commented Apr 21, 2025

Copy link
Copy Markdown

Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
Please be sure to review our Code of Conduct. Also, check out some of our community resources including:

There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar.
If you have additional questions, email us at saltproject.pdl@broadcom.com. We’re glad you’ve joined our community and look forward to doing awesome things with you!

@twangboy twangboy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please create a changelog and write a test for this.

@twangboy twangboy added needs-testcase PR needs test cases written, or the issue is about a bug/feature that needs test cases needs-changelog labels Jul 1, 2025
@twangboy twangboy added this to the Argon v3008.0 milestone Jul 1, 2025
@twangboy twangboy added the test:full Run the full test suite label Jul 1, 2025
@gregoster

Copy link
Copy Markdown
Author

Changelog entry added.

I looked to add a test to test/pytest/unit/modules/test_yumpkg.py, but on running (without any changes):

python -m nox -e "test-3(coverage=False)" -- tests/pytests/unit/modules/test_yumpkg.py
it blew up in various ways ("Building wheel for immutables (setup.py): finished with status 'error'", among others) and so I've punted. :(

I don't have a test environment setup for salt development, and don't intend to be doing further salt development, so my incentive to debug why this didn't Just Work is quite low :( Sorry.

@twangboy twangboy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you write a simple test here, or ensure that existing tests cover these changes

@gregoster

Copy link
Copy Markdown
Author

Please see my previous comment. I've tried to build a test, but I'm failing right now to even get a basic test environment setup.
Command python -m pip install --progress-bar=off -r requirements/static/ci/py3.13/linux.txt failed with exit code 1: ... <many lines of failure> ...
So while I could probably dig enough to figure out what to write for a test case, I have no way to test my test :(

twangboy
twangboy previously approved these changes Sep 25, 2025
twangboy

This comment was marked as resolved.

twangboy
twangboy previously approved these changes Jan 28, 2026
@dwoz

dwoz commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

@gregoster Sorry, there are more conflicts that need to be addressed.

Greg Oster and others added 13 commits June 8, 2026 21:56
'grouplist' and 'groupinfo' are each now two words.
'group' and 'group-id' have been replaced with 'name' and 'id',
so check for those too.
The dnf5 'group info' output differs from the dnf 'groupinfo' output.
In particular, a package name is now also listed on the first line of
each section.  Need to also strip leading spaces from lines.
dnf5 group_list-specific test was missing, but these tests
should only be run against dnf5, as yum/dnf provide different
output for 'grouplist' and 'groupinfo'.
dnf5 'group list' output needs to be handed differently
than yum/dnf 'grouplist' output.  Also condition on
_yum() so we don't break 'grouplist' and 'groupinfo' on
systems using yum/dnf.
the case of the package name when adding it to the list.
- test_67975_dnf5_group_info: add missing "type": "package group" key to
  the expected dict (the new elif "name" in g_info branch populates it).
- yumpkg group_list/group_info: replace `_yum() in ("dnf5")`,
  `pkg_id not in ("id")`, and `pkg_installed in ("yes")` with `==`/`!=`
  comparisons. These were substring-in-string checks (no trailing comma
  on a single-string tuple); they worked for exact equality but would
  have accepted any single character in those strings as a match.
- yumpkg group_info: drop stray space inside `re.match( r"..." )` so
  black is happy.

Co-authored-by: Greg Oster <oster@fween.ca>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants