8000 Stop processing templated remediations by Jinja by jan-cerny · Pull Request #13471 · ComplianceAsCode/content · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Stop processing templated remediations by Jinja #13471

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

Merged
merged 1 commit into from
May 16, 2025

Conversation

jan-cerny
Copy link
Collaborator

Remediations that were generated from templates already have all Jinja code resolved. Therefore, it isn't necessary to process them with Jinja for the second time. In collect_remediations.py, we will process with Jinja only static remediations and we will not process with Jinja the generated remediations. This will speed the build up because there are many remediations generated from templates and Jinja processing takes a lot of time.

As a part of this change we will rename all parse_from_file_with_jinja methods in Remediation and subclasses.

Remediations that were generated from templates already have all Jinja
code resolved. Therefore, it isn't necessary to process them with Jinja
for the second time. In `collect_remediations.py`, we will process with
Jinja only static remediations and we will not process with Jinja the
generated remediations. This will speed the build up because there are
many remediations generated from templates and Jinja processing takes a
lot of time.

As a part of this change we will rename all `parse_from_file_with_jinja`
methods in `Remediation` and subclasses.
@jan-cerny jan-cerny added this to the 0.1.77 milestone May 16, 2025
@jan-cerny jan-cerny added the Infrastructure Our content build system label May 16, 2025
Copy link
codeclimate bot commented May 16, 2025

Code Climate has analyzed commit 98c1904 and detected 1 issue on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1

The test coverage on the diff in this pull request is 88.8% (50% is the threshold).

This pull request will bring the total coverage in the repository to 61.9% (0.0% change).

View more on Code Climate.

@vojtapolasek vojtapolasek self-assigned this May 16, 2025
Copy link
Collaborator
@vojtapolasek vojtapolasek left a comment

Choose a reason for hiding this comment

The reaso 8000 n will be displayed to describe this comment to others. Learn more.

Looks good, thank you very much.

@vojtapolasek
Copy link
Collaborator

Just fyi, I did some quick tests.
I tried to build rhel9 product and then all three rhel products.
This fix saved 10 seconds in both cases.

@vojtapolasek vojtapolasek merged commit 98f1d65 into ComplianceAsCode:master May 16, 2025
106 of 109 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Infrastructure Our content build system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0