-
Notifications
You must be signed in to change notification settings - Fork 748
Remove unnecessary Jinja2 macros in control files #13592
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
Remove unnecessary Jinja2 macros in control files #13592
Conversation
An alternative could be to introduce more structured schema for control YAML files, allowing us to define product-specific rules without having to involve Jinja2:
|
That is a nice idea @jan-cerny . I think that for now it is simpler to just remove the macros and manage the deltas in profiles. They are usually exceptions and not a big deal to edit few files. Actually, I personally like the simplicity of centralizing the profiles particularities in profile files. In any case, any mechanism that maintain the YAML syntax integer, so external scripts and integrations can process these files without needing to load and render Jinja2 macros would work. |
ANSSI is a product agnostic profile and should include rules applicable to multiple products. If a rule in a product agnostic profile is not applicable to a specific product, it should be unselected on profile level. Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
It is not necessary to use Jinja2. The exceptions can be treated in profile level. It is more readable and a way easier to work with automation when there is no Jinja2 in controls. Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
Most of the exceptions were already in profiles. Treating only a few cases with Jinja2 is not consistent and make it harder to integrate automation. Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
The same result can be better treated in profile files without jinja2. Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
This macro is useless since the rules are already excluded in rhel profiles. Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
af53fd8
to
a791219
Compare
Rebased and force-pushed to resolve the conflicts. |
Aligned the YAML indentation with the project style guides since we have now CI tests checking YAML format consistencies. Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
The control file was introduced with many extra spaces. This was fixed now. Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
Included more commits to fix the YAML lint issues caught by |
Code Climate has analyzed commit 965030c and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (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. |
/test 4.12-images |
Description:
Remove unnecessary Jinja2 macros in control files so we can make the profiles more transparent, consistent and it also enable us to automatically process control files without bringing avoidable complexity to integrations.
It also ensure indentation consistence in profiles that were touched.
Rationale:
There is already a better mechanism to manage differences between selections in product agnostic control files and specific products using product profiles. This mechanism makes the profiles more transparent and removing Jinja2 macros from control files also allow us to use automation to process control files.
Review Hints:
CI tests should be enough to validate the changes.
Jinja2 macros were removed and the same outcome was achieved by updating the relevant product profiles when necessary.
The commits are organized by control files and produces, so it may be easier to review one by one.
UPDATE: The first 8 commits are part of the initial PR. The others are about fixing YAML lint issues.
A similar effort was already made in the past: #13180