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

Remove superflous check of rule ID consistency #9539

Merged
merged 1 commit into from
Sep 20, 2022

Conversation

jan-cerny
Copy link
Collaborator

The name attribute of check-content-ref element is generated by build_shorthand.py and its value is set there to rule's ID, so we don't need to verify that its set to rule's ID.

See:

check_content_ref.set("name", self.id_)
and
ocil_check_ref.set("name", self.id_ + "_ocil")

The check code is a leftower from past when the shorthand file used to be generated by XSLTs.

Don't get confused, the checks variable in the removed code actually contains the check element and the check variable is actually a check-content-ref element.

The `name` attribute of `check-content-ref` element is generated by
build_shorthand.py and its value is set there to rule's ID, so we don't
need to verify that its set to rule's ID.

See:
https://github.com/ComplianceAsCode/content/blob/54f40fc7d4ea1b9bbc76a575ccb7ff91fc1c109e/ssg/build_yaml.py#L1685
and
https://github.com/ComplianceAsCode/content/blob/54f40fc7d4ea1b9bbc76a575ccb7ff91fc1c109e/ssg/build_yaml.py#L1694

The check code is a leftower from past when the shorthand file used to
be generated by XSLTs.

Don't get confused, the `checks` variable in the removed code actually
contains the `check` element and the `check` variable is actually
a `check-content-ref` element.
@github-actions
Copy link

Start a new ephemeral environment with changes proposed in this pull request:

Fedora Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

@codeclimate
Copy link

codeclimate bot commented Sep 20, 2022

Code Climate has analyzed commit 9399db5 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 40.5% (0.1% change).

View more on Code Climate.

@Mab879 Mab879 self-assigned this Sep 20, 2022
@Mab879 Mab879 added this to the 0.1.65 milestone Sep 20, 2022
@Mab879 Mab879 added the Infrastructure Our content build system label Sep 20, 2022
@Mab879 Mab879 merged commit aea1123 into ComplianceAsCode:master Sep 20, 2022
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