Drive module_hotfixes workaround from a package pattern list - #222
Merged
Merged
Conversation
On EL8 libdnf applies modular filtering by Provides, not by package name, so a non-modular package that provides a name owned by a module stream is hidden even when it carries no modularity metadata of its own. That is why percona-server-shared (Provides: mysql-libs, owned by mysql:8.0) failed to install with "All matches were filtered out by modular filtering". Replace the hardcoded MariaDB check with module_hotfixes_pkg_patterns in the role defaults, so further affected packages are a one-line addition.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
An ALTS test task for
percona-server-shared-8.0.46-37.1.el8.tuxcare.els1.1789656571.5.1onalmalinux:8failed with:The package is not modular, has no
.module+el8dist tag, and lives in a-brbuild repo that ships no modular metadata.Root cause
libdnf's
setModuleExcludesfilters the sack withHY_PKG_PROVIDESagainst the set of module artifact names — not withHY_PKG_NAME. Any package that provides a name owned by a module stream is hidden unless it belongs to the active stream, or its repo is markedmodule_hotfixes=1.percona-server-sharedprovidesmysql-libs, an artifact of themysql:8.0module (default, active on AlmaLinux 8). That alone is enough to hide it.Reproduced in a container with the task's repo set — querying the sack directly:
Exactly 5 of the 9 packages in the build repo are excluded —
percona-server-client,-devel,-server,-shared,-test— because they providemysql,mysql-devel,mysql-server,mysql-libsandmysql-test. The 4 that install fine (percona-icu-data-files,percona-mysql-router,percona-server-rocksdb,percona-server-shared-compat) provide no module-owned name. No modular metadata in any enabled repo mentions percona at all.The role already had this workaround, but gated on
pkg_name.startswith('MariaDB'), so percona never matched.MariaDB-sharedwas caught for the same underlying reason — it also providesmysql-libs.Change
Replace the MariaDB-specific check with a
module_hotfixes_pkg_patternslist in the role defaults (^MariaDB,^percona-). Adding a future offender is a one-line change. Themodule_name is not definedguard is kept, so genuine module tests that rundnf module enableare unaffected —module_hotfixes=1would hide the repo's modular metadata fromdnf module enable.The
length > 0guard matters: with an empty list the alternation would collapse to(?:)and match every package.Testing
ansible-playbookwith real inputs:percona-server-shared-...andMariaDB-shared-10.6.21-1.el8match;alt-php74-common,lve-utils,cl-mysql-metado not.ansible-playbook --syntax-check resources/playbook.ymlpasses.module_hotfixes=1on the-brrepo turns the failure into a resolved transaction (percona-server-shared+percona-server-shared-compat,compat-openssl10,make).Known residual risk
The patterns are anchored on package names, but the real trigger is
Provides. A future package providing a module-owned name (mysql*,mariadb*,php*,nodejs*,perl*) will hit this again under an unpredictable name. The blunter alternative — always setmodule_hotfixes=1on-brrepos on EL8 when no module is under test — removes the guessing entirely, since build repos are never modular. Worth deciding separately.Jira: PF-3303
🤖 Generated with Claude Code