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

Preserve the original inhibitor detection valid for now #781

Merged
merged 1 commit into from
Jul 27, 2022

Conversation

pirat89
Copy link
Member

@pirat89 pirat89 commented Jun 21, 2022

As we substituted Tags and Flags with Groups recently, it has
impact on original detection of inhibitor inside leapp-repository
which is not compatible with the new reporting implementation.
As it could happen that new framework and old leapp-repository could
be installed on the system, the consequence in such a case is that
inhibitors will not be caught and user running:

  # leapp upgrade --reboot

could hit various serious issues. This change make sure we keep the
original functionality working, until we drop flags & tags
completely, providing enough time to everyone to adapt to new
changes.

@github-actions
Copy link

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 mergable.
If you want to request a review or rebuild a package in copr, you can use following commands as a comment:

  • review please to notify leapp developers of review request
  • /packit copr-build to submit a public copr build using packit

To launch regression testing public members of oamg organization can leave the following comment:

  • /rerun to schedule basic regression tests using this pr build and leapp-repository*master* as artifacts
  • /rerun 42 to schedule basic regression tests using this pr build and leapp-repository*PR42* as artifacts
  • /rerun-all to schedule all tests (including sst) using this pr build and leapp-repository*master* as artifacts
  • /rerun-all 42 to schedule all tests (including sst) using this pr build and leapp-repository*PR42* as artifacts

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 consider rerunning the CI by commenting leapp-ci build (might require several comments). If the problem persists, contact leapp-infra.

@centos-ci
Copy link

Can one of the admins verify this patch?

Copy link
Member

@MichalHe MichalHe left a comment

Choose a reason for hiding this comment

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

I've just reviewed the changes, thus, I cannot approve it until I test it. However, looks good to me with a minor nitpicks.

leapp/reporting/__init__.py Outdated Show resolved Hide resolved
leapp/utils/report.py Show resolved Hide resolved
leapp/utils/report.py Show resolved Hide resolved
@MichalHe
Copy link
Member

MichalHe commented Jun 23, 2022

Tested the patch, works as expected. Builds used during the testing:

  • leapp - current master
  • leapp-PR781 - this PR
  • leapp-repository-old - leapp repository without modified inhibition detection
  • leapp-repository-new - leapp repository with modified inhibition detection
Correctly inhibits? leapp leapp-PR781
leapp-repository-old 🔴 ✔️
leapp-repository-new ✔️ ✔️

@pirat89
Copy link
Member Author

pirat89 commented Jun 24, 2022

/packit build

@fernflower
Copy link
Member

Please fix linter error.

************* Module leapp.reporting.__init__
leapp/reporting/__init__.py:330:0: C0301: Line too long (157/120) (line-too-long)

@pirat89
Copy link
Member Author

pirat89 commented Jul 12, 2022

@fernflower fixed & squashed

@fernflower
Copy link
Member

/rerun

@github-actions
Copy link

Copr build succeeded: https://copr.fedorainfracloud.org/coprs/build/4630650

@github-actions
Copy link

Testing Farm request for RHEL-8.6-rhui/4630618;4630650 regression testing has been created.
Once finished, results should be available here.
Full pipeline log.

@github-actions
Copy link

Testing Farm request for RHEL-7.9-rhui/4630618;4630650 regression testing has been created.
Once finished, results should be available here.
Full pipeline log.

@github-actions
Copy link

Testing Farm request for RHEL-8.6.0-Nightly/4630618;4630650 regression testing has been created.
Once finished, results should be available here.
Full pipeline log.

@github-actions
Copy link

Testing Farm request for RHEL-7.9-ZStream/4630618;4630650 regression testing has been created.
Once finished, results should be available here.
Full pipeline log.

@pirat89 pirat89 marked this pull request as ready for review July 13, 2022 10:11
@fernflower
Copy link
Member

/rerun

@github-actions
Copy link

Copr build succeeded: https://copr.fedorainfracloud.org/coprs/build/4684364

@github-actions
Copy link

Testing Farm request for RHEL-8.6-rhui/4656862;4684364 regression testing has been created.
Once finished, results should be available here.
Full pipeline log.

@github-actions
Copy link

Testing Farm request for RHEL-7.9-rhui/4656862;4684364 regression testing has been created.
Once finished, results should be available here.
Full pipeline log.

@github-actions
Copy link

Testing Farm request for RHEL-8.6.0-Nightly/4656862;4684364 regression testing has been created.
Once finished, results should be available here.
Full pipeline log.

leapp/utils/report.py Outdated Show resolved Hide resolved
@github-actions
Copy link

Testing Farm request for RHEL-7.9-ZStream/4656862;4684364 regression testing has been created.
Once finished, results should be available here.
Full pipeline log.

Copy link
Member

@fernflower fernflower left a comment

Choose a reason for hiding this comment

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

msg.pop('flags') should be changed to msg.pop('flags', None)

@fernflower
Copy link
Member

fernflower commented Jul 26, 2022

@pirat89 Tried adding a commit into your branch and got permission denied. Could you please allow it?
Or maybe just fix the issue I pointed out?

diff --git a/leapp/utils/report.py b/leapp/utils/report.py
index 6248101..71a2f29 100644
--- a/leapp/utils/report.py
+++ b/leapp/utils/report.py
@@ -147,5 +147,7 @@ def generate_report_file(messages_to_report, context, path, report_schema='1.1.0
                 # be negatively affected until we drop flags and tags completely.
                 messages_to_report = list(messages_to_report)
                 for msg in messages_to_report:
-                    msg.pop('flags')
+                    # NOTE(ivasilev) As flags field is created only if there is an inhibitor a default value to pop
+                    # has to be specified not to end up with a KeyError
+                    msg.pop('flags', None)
             json.dump({'entries': messages_to_report, 'leapp_run_id': context}, f, indent=2)

@pirat89
Copy link
Member Author

pirat89 commented Jul 26, 2022

@fernflower I cannot find out why you do not have the permission to commit into my fork, as regarding the github settings you should be able to do it. Let's experiment with that in future. I will just update the commit now to unblock it.

As we substituted Tags and Flags with Groups recently, it has
impact on original detection of inhibitor inside leapp-repository
which is not compatible with the new reporting implementation.
As it could happen that new framework and old leapp-repository could
be installed on the system, the consequence in such a case is that
inhibitors will not be caught and user running:
  # leapp upgrade --reboot

could hit various serious issues. This change make sure we keep the
original functionality working, until we drop flags & tags
completely, providing enough time to everyone to adapt to new
changes.

Co-authored-by: Michal Hečko <michal.sk.com@gmail.com>
Co-authored-by: Ina Vasilevskaya <ivasilev@redhat.com>
@fernflower
Copy link
Member

/rerun

@github-actions
Copy link

Copr build succeeded: https://copr.fedorainfracloud.org/coprs/build/4686481

@github-actions
Copy link

Testing Farm request for RHEL-8.6-rhui/4685924;4686481 regression testing has been created.
Once finished, results should be available here.
Full pipeline log.

@github-actions
Copy link

Testing Farm request for RHEL-7.9-rhui/4685924;4686481 regression testing has been created.
Once finished, results should be available here.
Full pipeline log.

@github-actions
Copy link

Testing Farm request for RHEL-8.6.0-Nightly/4685924;4686481 regression testing has been created.
Once finished, results should be available here.
Full pipeline log.

@github-actions
Copy link

Testing Farm request for RHEL-7.9-ZStream/4685924;4686481 regression testing has been created.
Once finished, results should be available here.
Full pipeline log.

Copy link
Member

@fernflower fernflower left a comment

Choose a reason for hiding this comment

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

Now the tests are fine.

@fernflower fernflower merged commit 62680b9 into oamg:master Jul 27, 2022
pirat89 added a commit to pirat89/leapp that referenced this pull request Aug 23, 2022
## Packaging
-  bumped leapp-framework to 3.1 (oamg#677)

## Framework

### Fixes
- Fixed a problem where passing environment variables to an executed child process modified the environment variables of the parent process (​​oamg#784)
- Ignore invalid FQDNs (oamg#790)

### Enhancements
- Deprecate `reporting.(Tags|Flags)`, replaced by `reporting.Groups` (oamg#677, oamg#781, oamg#788)
- Introduce `is_inhibitor` function (oamg#677)
- Introduce a `Blob` model field (oamg#789)
- Introduce new report JSON schema v1.2.0 (default: 1.1.0) (oamg#677)

## Leapp (tool)

### Fixes
- Handle missing CLI commands gracefully (oamg#785)
- Requires to be executed by root only (oamg#775)
@pirat89 pirat89 mentioned this pull request Aug 23, 2022
pirat89 added a commit to pirat89/leapp that referenced this pull request Aug 23, 2022
## Packaging
-  bumped leapp-framework to 3.1 (oamg#677)

## Framework

### Fixes
- Fixed a problem where passing environment variables to an executed child process modified the environment variables of the parent process (​​oamg#784)
- Ignore invalid FQDNs (oamg#790)

### Enhancements
- Deprecate `reporting.(Tags|Flags)`, replaced by `reporting.Groups` (oamg#677, oamg#781, oamg#788)
- Introduce `is_inhibitor` function (oamg#677)
- Introduce a `Blob` model field (oamg#789)
- Introduce new report JSON schema v1.2.0 (default: 1.1.0) (oamg#677)

## Leapp (tool)

### Fixes
- Handle missing CLI commands gracefully (oamg#785)
- Requires to be executed by root only (oamg#775)

Signed-off-by: Petr Stodulka <pstodulk@redhat.com>
MichalHe pushed a commit that referenced this pull request Aug 23, 2022
## Packaging
-  bumped leapp-framework to 3.1 (#677)

## Framework

### Fixes
- Fixed a problem where passing environment variables to an executed child process modified the environment variables of the parent process (​​#784)
- Ignore invalid FQDNs (#790)

### Enhancements
- Deprecate `reporting.(Tags|Flags)`, replaced by `reporting.Groups` (#677, #781, #788)
- Introduce `is_inhibitor` function (#677)
- Introduce a `Blob` model field (#789)
- Introduce new report JSON schema v1.2.0 (default: 1.1.0) (#677)

## Leapp (tool)

### Fixes
- Handle missing CLI commands gracefully (#785)
- Requires to be executed by root only (#775)

Signed-off-by: Petr Stodulka <pstodulk@redhat.com>

Signed-off-by: Petr Stodulka <pstodulk@redhat.com>
@pirat89 pirat89 added the changelog-checked The merger/reviewer checked the changelog draft document and updated it when relevant label Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-checked The merger/reviewer checked the changelog draft document and updated it when relevant
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants