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

Publish rendered policy artifacts #10585

Merged

Conversation

ggbecker
Copy link
Member

@ggbecker ggbecker commented May 18, 2023

Description

@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

@ggbecker ggbecker force-pushed the publish-render-policy-artifacts branch 2 times, most recently from cf94c62 to ca60604 Compare May 19, 2023 10:49
@ggbecker
Copy link
Member Author

ggbecker commented May 19, 2023

@rhmdnd @jhrozek @Vincent056

Here's a proof of concept for the rendered policies we talked about. You can find the artifacts here:
https://github.com/ComplianceAsCode/content/suites/13010052155/artifacts/704568550

When we merge it, this would be shown in this page: https://complianceascode.github.io/content-pages/

@marcusburghardt
Copy link
Member

Is it a WIP PR? If so, could you set it as draft, please? I would like to confirm based on the title.

@ggbecker
Copy link
Member Author

Is it a WIP PR? If so, could you set it as draft, please? I would like to confirm based on the title.

It isn't anymore. I'm keeping the ready status and will update the title.

@ggbecker ggbecker changed the title [draft] Publish rendered policy artifacts Publish rendered policy artifacts May 22, 2023
@ggbecker ggbecker force-pushed the publish-render-policy-artifacts branch 2 times, most recently from e2a722e to c0e39a6 Compare May 22, 2023 08:42
@yuumasato yuumasato self-assigned this May 22, 2023
utils/generate_html_pages.sh Show resolved Hide resolved
cmake/SSGCommon.cmake Outdated Show resolved Hide resolved
@ggbecker
Copy link
Member Author

The new page looks like this:

Screenshot from 2023-05-22 14-32-53

@ggbecker ggbecker force-pushed the publish-render-policy-artifacts branch 4 times, most recently from 7855a6d to 846e4e8 Compare May 23, 2023 08:18
@ggbecker
Copy link
Member Author

@ggbecker
Copy link
Member Author

@yuumasato I think this should be good to go.

cmake/SSGCommon.cmake Outdated Show resolved Hide resolved
utils/gen_rendered_policies_index.py Outdated Show resolved Hide resolved
cmake/SSGCommon.cmake Outdated Show resolved Hide resolved

import ssg.jinja
from utils.template_renderer import FlexibleLoader
from utils.gen_html_guides_index import create_index
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I value the reuse of code, but this function is not in a module/file in which it is explicit that it is reused.
One update to the utils/gen_html_guides_index.py changing that function may break this script.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, it's the codeclimate bothering our lives... I guess I can just return it back be we can waive the codeclimate results.

They scan all the control files and render the policy according to the
product being built.
Store the built content that can be inspected locally to check if the
built pages are correct.
There are output files that don't need to be regenerated every time so
the custom command should work better here.
Disregard any other folder that might contain product.yml files, for
example the build/ directory would have them after the project was
built. Creating duplicated guides entries in the rendered guides page.
@ggbecker ggbecker force-pushed the publish-render-policy-artifacts branch from 846e4e8 to cba0ade Compare May 23, 2023 15:07
@ggbecker ggbecker requested a review from yuumasato May 23, 2023 15:08
@ggbecker
Copy link
Member Author

@yuumasato feedback addressed

@yuumasato yuumasato added this to the 0.1.68 milestone May 23, 2023
@yuumasato yuumasato added the Infrastructure Our content build system label May 23, 2023
@codeclimate
Copy link

codeclimate bot commented May 23, 2023

Code Climate has analyzed commit cba0ade and detected 2 issues on this pull request.

Here's the issue category breakdown:

Category Count
Duplication 2

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 52.5% (0.0% change).

View more on Code Climate.

@yuumasato yuumasato merged commit 260302f into ComplianceAsCode:master May 24, 2023
@ggbecker
Copy link
Member Author

it's live: https://complianceascode.github.io/content-pages/rendered-policies/index.html

@jan-cerny jan-cerny added the Highlight This PR/Issue should make it to the featured changelog. label Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Highlight This PR/Issue should make it to the featured changelog. Infrastructure Our content build system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants