-
Notifications
You must be signed in to change notification settings - Fork 146
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
Fix ModelViolationError while parsing repo files #1266
base: main
Are you sure you want to change the base?
Conversation
Thank you for contributing to the Leapp project!Please note that every PR needs to comply with the Leapp Guidelines and must pass all tests in order to be mergeable.
Packit will automatically schedule regression tests for this PR's build and latest upstream leapp build.
Note that first time contributors cannot run tests automatically - they need to be started by a reviewer. It is possible to schedule specific on-demand tests as well. Currently 2 test sets are supported,
See other labels for particular jobs defined in the Please open ticket in case you experience technical problem with the CI. (RH internal only) Note: In case there are problems with tests not being triggered automatically on new PR/commit or pending for a long time, please contact leapp-infra. |
3d49f24
to
b294a98
Compare
/packit retest-failed |
2 similar comments
/packit retest-failed |
/packit retest-failed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The overall approach is ok, but there are some problems.
repos/system_upgrade/common/actors/systemfacts/libraries/systemfacts.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/common/actors/systemfacts/libraries/systemfacts.py
Outdated
Show resolved
Hide resolved
2a0f448
to
3bd08f8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one small suggestion :) code-wise ok, I am going to test it now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR description is outdated, from my testing on RHEL 8 the output looks like this, which is good:
2024-08-02 12:17:22.052435 [ERROR] Actor: system_facts
Message: Invalid repository definition: copr:copr.fedorainfracloud.org:group_oamg:leapp in: /etc/yum.repos.d/leapp-copr.repo: The value of "name" field is None, but this is not allowed
Summary:
Hint: For more directions on how to resolve the issue, see: https://access.redhat.com/solutions/6969001.
2024-08-02 12:17:33.302747 [ERROR] Actor: repositories_blacklist
Message: Actor didn't receive required messages: RepositoriesFacts
After the PR desc is updated, squash the commits and briefly describe the changes in the final one, otherwise LGTM.
DO NOT MERGE YET - FOR NOW IT'S NOT TARGETED FOR THE UPCOMING RELEASE
3bd08f8
to
49708b5
Compare
49708b5
to
9ed7217
Compare
The latest push squashes commits. |
Could you please add a unit test? |
Agree, I don't know how I forgot that, sorry @tomasfratrik. |
9ed7217
to
880fe49
Compare
I added it! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests has been added and it works as expected. LGTM
STILL DO NOT MERGE
880fe49
to
94ffbb8
Compare
The latest push squashed commits. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pirat89 pointed out that a unit test was added, but only for the system_facts actor. Tests are still missing for the parse_repofile
and potentially _parse_repository
functions.
Also docstrings have to be included on public members in shared libraries (it would be okay in an actor lib).
class InvalidRepoDefinition(Exception): | ||
def __init__(self, msg, repofile, repoid): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is public and in a shared library, add a docstring describing what is the exception used for.
Also update the docstring in the parse_repofile
function to document that it can raise this exception and when.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests were added and docstrings were updated.
94ffbb8
to
5a584b8
Compare
/packit copr-build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add a little more test cases, otherwise ok.
repos/system_upgrade/common/libraries/tests/test_repofileutils.py
Outdated
Show resolved
Hide resolved
5a584b8
to
0a55672
Compare
/packit copr-build |
0a55672
to
3af8eec
Compare
This error occurs when repo file has invalid definition, specifically when the 'name' entry of the config files is invalid. Also add tests. Jira: RHEL-19249
3af8eec
to
ad4dbc3
Compare
This error occurs when repo file has invalid definition, specifically the 'name' entry of the config file.
After this, we get rid of the traceback error, and the following errors are shown
Jira: RHEL-19249