Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

platforms: rewrite mechanism which parses version into EVR #10038

Merged

Conversation

vojtapolasek
Copy link
Collaborator

Description:

  • remove usage of pkg_tools for purpose of version parsing
  • remove relevant tests
  • parse versions into evr by matching against a regex
  • add tests to prove it works as expected

Rationale:

Feature set of pkg_tools varied among RHEL 7 and later versions. It showed up to be too hard to maintain equal functionality for both versions, so it was decided to drop usage of this feature and replace it with regex.

Fixes: #10004

there is no clear method of list object in Python 2
previously we used methods of pkg_tools. But there were differences between various implementations and it posed too many problems.
Therefore, I decided to use simple regex to parse simple version to evr. It has currently limitations to numbers only, but this can be easily expanded.
@vojtapolasek vojtapolasek added bugfix Fixes to reported bugs. Infrastructure Our content build system CPE-AL CPE Applicability Language labels Jan 10, 2023
@vojtapolasek vojtapolasek added this to the 0.1.66 milestone Jan 10, 2023
@github-actions
Copy link

Start a new ephemeral environment with changes proposed in this pull request:

Fedora Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

@codeclimate
Copy link

codeclimate bot commented Jan 10, 2023

Code Climate has analyzed commit 38cd22a and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 49.7% (-0.1% change).

View more on Code Climate.

@jan-cerny jan-cerny self-assigned this Jan 12, 2023
Copy link
Collaborator

@jan-cerny jan-cerny left a comment

Choose a reason for hiding this comment

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

This PR looks good to me. I have checked that it's still able to generate a platform CPE with the version expression used in the rule.yml.

@jan-cerny jan-cerny merged commit d615dc9 into ComplianceAsCode:master Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Fixes to reported bugs. CPE-AL CPE Applicability Language Infrastructure Our content build system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CTest fails on RHEL7 - 42 - python-unit-ssg-module
2 participants