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

fix(general): Fix jsonpath-key handling for special characters like "/" and reduce log size #6907

Merged
merged 6 commits into from
Dec 17, 2024

Conversation

rotemavni
Copy link
Collaborator

@rotemavni rotemavni commented Dec 15, 2024

User description

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Description

  • Removed logging self.attributes to prevent log files from becoming too large.
  • Updated _get_jsonpath_key function to handle the "/" character correctly, and added matching tests to it

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my feature, policy, or fix is effective and works
  • New and existing tests pass locally with my changes

Generated description

Below is a concise technical summary of the changes proposed in this PR:

Refactors the logging and key handling in the CloudFormation graph builder and renderer. Removes verbose logging of attributes to reduce log file size. Improves the _get_jsonpath_key method in the Block class to handle special characters in keys more efficiently.

TopicDetails
Key Handling Refactor Refactors the _get_jsonpath_key method to handle special characters in keys more efficiently.
Modified files (3)
  • checkov/common/graph/graph_builder/graph_components/blocks.py
  • tests/common/graph/checks/test_block.py
  • checkov/cloudformation/graph_builder/graph_components/blocks.py
Latest Contributors(2)
UserCommitDate
tsmithv11fix-terraform-Fix-two-...November 26, 2024
bo156fix-general-Used-jsonp...November 19, 2024
Logging Reduction Reduces log file size by removing verbose logging of attributes and changing log level for non-rendered values.
Modified files (2)
  • checkov/common/graph/graph_builder/graph_components/blocks.py
  • checkov/cloudformation/graph_builder/variable_rendering/renderer.py
Latest Contributors(2)
UserCommitDate
tsmithv11fix-terraform-Fix-two-...November 26, 2024
bo156fix-cloudformation-Fix...November 21, 2024
This pull request is reviewed by Baz. Join @rotemavni and the rest of your team on (Baz).

@rotemavni rotemavni closed this Dec 15, 2024
@rotemavni rotemavni deleted the reduce-log-size branch December 15, 2024 07:57
@rotemavni rotemavni restored the reduce-log-size branch December 17, 2024 07:49
@rotemavni rotemavni reopened this Dec 17, 2024
… code to one location, in addition added a test for the jsonpath key generation
@bo156 bo156 changed the title fix(general): Remove logging of attributes to reduce log size fix(general): Fix jsonpath-key handling for special characters like "/" and reduce log size Dec 17, 2024
@bo156 bo156 merged commit 8741983 into main Dec 17, 2024
39 of 40 checks passed
@bo156 bo156 deleted the reduce-log-size branch December 17, 2024 14:35
Saarett pushed a commit that referenced this pull request Dec 17, 2024
…/" and reduce log size (#6907)

* remove logging of attributes to reduce log size

* Handled cases of / character in complex attribute switch

* Refactored unneeded method

* Removed implemention of jsonpath_key in cloudformation and refactored code to one location, in addition added a test for the jsonpath key generation

* flake8

---------

Co-authored-by: Barak Fatal <[email protected]>
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.

5 participants