Skip to content

add whatprovides resolution to verify-install plugin#4804

Draft
vaibhavdaren wants to merge 1 commit intomainfrom
vaibhav-discover-only-providers-whatprovides
Draft

add whatprovides resolution to verify-install plugin#4804
vaibhavdaren wants to merge 1 commit intomainfrom
vaibhav-discover-only-providers-whatprovides

Conversation

@vaibhavdaren
Copy link
Copy Markdown
Contributor

Pull Request Checklist

  • implement the feature
  • write the documentation
  • extend the test coverage
  • update the specification
  • adjust plugin docstring
  • modify the json schema
  • mention the version
  • include a release note

@vaibhavdaren vaibhavdaren self-assigned this Apr 17, 2026
@vaibhavdaren vaibhavdaren moved this to implement in planning Apr 17, 2026
@vaibhavdaren vaibhavdaren added ci | full test Pull request is ready for the full test execution plugin | artifact Related to the `prepare/artifact` plugin. labels Apr 17, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request implements the resolution of virtual RPM provides to actual package names using 'rpm -q --whatprovides' during artifact preparation and installation verification. In 'verify_installation.py', replace the dictionary comprehension for 'verify_map' with a loop using 'setdefault' and 'tmt.utils.uniq' to prevent overwriting entries when multiple virtual provides resolve to the same package name.

Comment on lines +130 to +132
verify_map: dict[str, list[str]] = {
resolved.get(pkg, pkg): repos for pkg, repos in self.data.verify.items()
}
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.

high

The dictionary comprehension used to construct verify_map will overwrite entries if multiple virtual provides resolve to the same package name (e.g., /usr/bin/sh and sh both resolving to bash). This results in the loss of repository verification data for the overwritten entries. Use a loop with setdefault to merge the repository lists instead.

Suggested change
verify_map: dict[str, list[str]] = {
resolved.get(pkg, pkg): repos for pkg, repos in self.data.verify.items()
}
verify_map: dict[str, list[str]] = {}
for pkg, repos in self.data.verify.items():
verify_map.setdefault(resolved.get(pkg, pkg), []).extend(repos)
verify_map = {name: tmt.utils.uniq(repos) for name, repos in verify_map.items()}

@vaibhavdaren vaibhavdaren force-pushed the vaibhav-discover-only-providers-whatprovides branch from 725fbcf to 1d6cf0d Compare April 17, 2026 16:05
Base automatically changed from vaibhav-discover-only-providers to main April 17, 2026 16:32
@vaibhavdaren vaibhavdaren force-pushed the vaibhav-discover-only-providers-whatprovides branch from 1d6cf0d to 06f3660 Compare April 17, 2026 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci | full test Pull request is ready for the full test execution plugin | artifact Related to the `prepare/artifact` plugin.

Projects

Status: implement

Development

Successfully merging this pull request may close these issues.

1 participant