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: split spec_cleaner to multiple sub-modules #4324

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xiangce
Copy link
Contributor

@xiangce xiangce commented Jan 3, 2025

This is a preparation for IPv6 and MAC address obfuscation. By splitting it to multiple sub-modules, it will be easy for adding new modules, e.g. IPv6 and MAC obfuscation. Jira: RHINENG-15077

  • replace the get_obfuscate_functions with a new keyword argument width, for specs that need to keep the original words width, this width needs to be set by hand before content cleaning. In the future, it will be moved to the RegistryPoint for user to set by hand per specs.
  • the processing of "password" and "keyword" is kind of "obfuscation" which replace the potential password value and specified keywords to kind of fixed strings/words, so moved it to the obfuscation module. User can exclude it by specifying it with, e.g. "no_obfuscate=['password']" while adding its RegistryPoint in insights.specs.Specs. Jira: RHINENG-14756

All Pull Requests:

Check all that apply:

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

Complete Description of Additions/Changes:

Add your description here

This is a preparation for the support of IPv6 and MAC address
obfuscation.  By splitting it to multiple sub-modules, it will be easy
for adding new modules, e.g. IPv6 and MAC obfuscation.
Jira: RHINENG-15077

- replace the `get_obfuscate_functions` with a new keyword argument
  `width`, for specs that need to keep the original words width, this
  `width` needs to be set by hand before content cleaning.  In the
  future, it will be moved to the RegistryPoint for user to set by hand
  per specs.
- the processing of "password" and "keyword" is kind of "obfuscation"
  which replace the potential `password value` and specified `keywords`
  to kind of fixed strings/words, so moved it to the obfuscation module.
  User can exclude it by specifying it with, e.g.
  "no_obfuscate=['password']" while adding its RegistryPoint in
  `insights.specs.Specs`.
  Jira: RHINENG-14756

Signed-off-by: Xiangce Liu <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Jan 3, 2025

Codecov Report

Attention: Patch coverage is 99.44904% with 2 lines in your changes missing coverage. Please review.

Project coverage is 77.05%. Comparing base (9c64871) to head (8e9b4b6).

Files with missing lines Patch % Lines
insights/collect.py 60.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4324      +/-   ##
==========================================
+ Coverage   76.98%   77.05%   +0.07%     
==========================================
  Files         735      742       +7     
  Lines       41306    41350      +44     
  Branches     8772     8775       +3     
==========================================
+ Hits        31801    31864      +63     
+ Misses       8439     8431       -8     
+ Partials     1066     1055      -11     
Flag Coverage Δ
unittests 77.04% <99.44%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

2 participants