-
Notifications
You must be signed in to change notification settings - Fork 671
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 shorthand.xml from the build process #9548
Conversation
Skipping CI for Draft Pull Request. |
Instead of creating namespace-less elements and then using hack with hard-setting the xmlns attribute we should create elements with the OCIL namespace explicitely set.
Add ability to extract root XML element of the OCIL document without a need to save the document to a file.
This change moves the responsibility of the `relabel_ids.py` to the `build_shorthand.py`. In other words, OVAL and OCIL IDs will be changed when the shorthand is created, and the 2 aforementioned scripts are merged. The benefit is that we will avoid saving the content to file and load it back, which can make the build faster.
The script now builds a full XCCDF 1.2 file, it doesn't create what we used to call "shorthand" in past. To avoid confusion, it would be better to rename it to describe more its actual purpose.
f338d64
to
dc52493
Compare
I have fixed the Code Climate problem, and I have rebased this PR on the top of the latest upstream master branch. |
There was a problem hiding this 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. Can you please update the build system docs with the changes you made?
Rename the CMake macro `ssg_build_shorthand_xml` to `ssg_build_xccdf_oval_ocil` according its output type to better describe its purpose. Then, update comments, and remove outdated comment about shorhtand format and its processing.
I have updated the build system documentation and then I cleaned shorthand from the CMake files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one minor change in the markdown. This should fix the Code Climate issues.
Datastream document, | ||
6. Generating any derived products (such as CentOS and Scientific Linux). | ||
|
||
1. Generate SCE content and metadata. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use 1.
for the numbering here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused, it already uses 1.
here, so probably you wanted to say the opposite.
I have [Change list to not use numbers |
I think what is tripping up Code Climate here is that some lists in this file have a space before the To fix this issue, you may want to reformat the lists in |
Code Climate has analyzed commit 1816f31 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 4.5% (50% is the threshold). This pull request will bring the total coverage in the repository to 40.8% (0.1% change). View more on Code Climate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than my two minor questions on the Markdown, everything looks good. Content builds just fine even with SCE enabled.
Thanks for the PR.
@Mab879 Using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waving the code climate test as tets are coming in other PRs.
Description:
Remove shorthand.xml from the build process, because the tools now generate a proper XCCDF 1.2 file. We will achieve this removal by merging the responsibility of the
relabel_ids.py
tobuild_shorthand.py
. Then, we will renamebuild_shorthand.py
tobuild_xccdf.py
.For more details please read the commit messages of every commit.
Rationale:
Simplify the build process, avoid unnecessary writing and loading back, improve naming.