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

Implementation of autodetecting modular platform ID #243

Merged
merged 4 commits into from
Feb 8, 2023

Conversation

jan-kolarik
Copy link
Member

Platform ID for modules is automatically detected based on the following values in given order sorted by priority:

  1. Use module_platform_id configuration option value, if it is explicitly set up.
  2. Parse Provides value from the latest available package in enabled repositories.
  3. Parse Provides value from the latest installed package on the local system.
  4. Parse PLATFORM_ID value from os-release files on the local system.

The logic is implemented based on the original PR from libdnf component.

@j-mracek j-mracek self-assigned this Jan 20, 2023
@jan-kolarik jan-kolarik marked this pull request as ready for review January 26, 2023 14:28
@jan-kolarik
Copy link
Member Author

Note: was not yet properly tested as modules enable, disable, etc. functionality is missing for now.

Copy link
Contributor

@j-mracek j-mracek left a comment

Choose a reason for hiding this comment

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

I think it looks fine, but there are few issues that I would like to see modified.

@jan-kolarik jan-kolarik force-pushed the jkolarik/module-platform_id-detection branch from 695bf88 to ba27fd3 Compare February 7, 2023 12:43
@jan-kolarik
Copy link
Member Author

Note: was not yet properly tested as modules enable, disable, etc. functionality is missing for now.

Functionality for now successfully tested using the original DNF command for enabling a specific module stream and then trying to do a repoquery and install with DNF5 and checking if seeing modular packages there.

Static method for creating a virtual platform solvable package was added to be used for automatic module platform id detection.
Implementation of automatic module platform id detection based on the logic from the original DNF code.
Setup regex format to allow only platform ids with non-empty name and stream while containing the colon character.
Add docstrings and adjust logging levels.
@jan-kolarik jan-kolarik force-pushed the jkolarik/module-platform_id-detection branch from ba8aecb to 7dd1f4d Compare February 8, 2023 09:03
Copy link
Contributor

@j-mracek j-mracek left a comment

Choose a reason for hiding this comment

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

LGTM

@j-mracek j-mracek merged commit b6623c9 into main Feb 8, 2023
@j-mracek j-mracek deleted the jkolarik/module-platform_id-detection branch February 8, 2023 12:21
@jan-kolarik jan-kolarik linked an issue Feb 10, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement detection of Platform Id for modules
2 participants