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

refactor: remove legacy collection #4009

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

xiangce
Copy link
Contributor

@xiangce xiangce commented Feb 2, 2024

  • and remove all dependent codes and relevant tests
  • see RHINENG-6982

All Pull Requests:

Check all that apply:

  • Have you followed the guidelines in our Contributing document, including the instructions about commit messages?
  • Is this PR to correct an issue?
  • Is this PR an enhancement?

Complete Description of Additions/Changes:

Add your description here

@xiangce xiangce mentioned this pull request Feb 2, 2024
3 tasks
@xiangce xiangce force-pushed the remove_legacy_collection branch 2 times, most recently from 08267a6 to bfe8912 Compare February 2, 2024 08:13
@xiangce
Copy link
Contributor Author

xiangce commented Feb 27, 2024

This PR requires corresponding modifications to the IQE test. Before this, the IQE test will always fail.

Comment on lines -23 to -24
Core collection should be disabled by default, unless
the RPM version 3.1 or above
Copy link
Contributor

Choose a reason for hiding this comment

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

So, how does this work with RHEL 6, which was shipped with Client 3.0.14?

Copy link
Contributor Author

@xiangce xiangce May 10, 2024

Choose a reason for hiding this comment

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

For RHEL 6, or RHEL 7, any client installed with a version older than 3.0.14, core_collect will be set to True by default, after this change.

Copy link
Contributor Author

@xiangce xiangce May 15, 2024

Choose a reason for hiding this comment

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

Per my test, the oldest version of the insights-client insights-client-3.0.0-4 that we provided to the customers, works well with core_collect=True on RHEL 6/7, for details please check the new comment to the RHINENG-6982

@candlepin-bot
Copy link

Can one of the admins verify this patch?

@JoySnow
Copy link
Collaborator

JoySnow commented May 21, 2024

Hi @xiangce , the legacy collection change looks good to me. And I tried to run cli command insights-collect, it broken into an circular import error related to circular import, while this command works fine with the code in master branch.

FYI, the detail command output example:

$ insights-collect --help
Traceback (most recent call last):
  File "/root/Work/insights-core/venv39/bin/insights-collect", line 33, in <module>
    sys.exit(load_entry_point('insights-core', 'console_scripts', 'insights-collect')())
  File "/root/Work/insights-core/venv39/bin/insights-collect", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib64/python3.9/importlib/metadata.py", line 86, in load
    module = import_module(match.group('module'))
  File "/usr/lib64/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/root/Work/insights-core/insights/collect.py", line 23, in <module>
    from insights.core.spec_cleaner import Cleaner
  File "/root/Work/insights-core/insights/core/spec_cleaner.py", line 24, in <module>
    from insights.client.constants import InsightsConstants as constants
  File "/root/Work/insights-core/insights/client/__init__.py", line 14, in <module>
    from . import client
  File "/root/Work/insights-core/insights/client/client.py", line 22, in <module>
    from .connection import InsightsConnection
  File "/root/Work/insights-core/insights/client/connection.py", line 39, in <module>
    from insights.core.spec_cleaner import Cleaner
ImportError: cannot import name 'Cleaner' from partially initialized module 'insights.core.spec_cleaner' (most likely due to a circular import) (/root/Work/insights-core/insights/core/spec_cleaner.py)

@xiangce xiangce force-pushed the remove_legacy_collection branch 2 times, most recently from a9d0e47 to 07854e1 Compare May 21, 2024 08:17
@xiangce
Copy link
Contributor Author

xiangce commented May 21, 2024

Hi @JoySnow - thanks for reviewing. The issue you found was fixed in the latest commit, please have a look again.

Copy link
Contributor

@m-horky m-horky 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 been able to run this Core on RHEL 6.10 system with Client 3.0.14. I don't think I have notes.

Copy link
Collaborator

@JoySnow JoySnow left a comment

Choose a reason for hiding this comment

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

Thanks for the update @xiangce . The insights-collect command works well now.

$ insights-collect 
/tmp/insights-xiaoxwan-test321-rhel91.default-20240521082408

@xiangce xiangce added the WIP Includes: Approved but Not Ready for Merging/Releasing label May 28, 2024
- and remove all dependent codes and relevant tests
- update the script that generates the filters.yaml
- see RHINENG-6982

Signed-off-by: Xiangce Liu <xiangceliu@redhat.com>
Signed-off-by: Xiangce Liu <xiangceliu@redhat.com>
Signed-off-by: Xiangce Liu <xiangceliu@redhat.com>
Signed-off-by: Xiangce Liu <xiangceliu@redhat.com>
- as it's just deprecated but should supported for a while

Signed-off-by: Xiangce Liu <xiangceliu@redhat.com>
Signed-off-by: Xiangce Liu <xiangceliu@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WIP Includes: Approved but Not Ready for Merging/Releasing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants