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

Generate static website for documentation #883

Merged
merged 8 commits into from
Oct 30, 2020

Conversation

sozercan
Copy link
Member

Signed-off-by: Sertac Ozercan sozercan@gmail.com

What this PR does / why we need it:

Gatekeeper readme has grown substantially and needs better organization and versioning over time. We can use a statically hosted page in github pages to host our docs in a user-friendly way. Readme can be trimmed down to just basics and can point to docs website for more information.

This flow uses website folder to generate a static website using docusaurus. When a new commit is merged to website folder, it'll generate generate_website Github action to start deployment process, which will push the static pages to gh-pages branch. Since we also upload our charts in gh-pages branch, it'll be hosted in website folder there.

Pages are written with markdown (under website/docs). I moved over the existing readme into markdown files in website/docs and divided into categories for easier organization.

Current version is hosted here: https://sozercan.github.io/gatekeeper/

It'll be hosted in https://open-policy-agent.github.io/gatekeeper/ when it's merged (will 404 now).

Which issue(s) this PR fixes (optional, using fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when the PR gets merged):
Fixes #838

Special notes for your reviewer:

Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
@codecov-io
Copy link

codecov-io commented Oct 14, 2020

Codecov Report

Merging #883 into master will increase coverage by 0.15%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #883      +/-   ##
==========================================
+ Coverage   43.56%   43.72%   +0.15%     
==========================================
  Files          47       47              
  Lines        3170     3170              
==========================================
+ Hits         1381     1386       +5     
+ Misses       1594     1591       -3     
+ Partials      195      193       -2     
Flag Coverage Δ
#unittests 43.72% <ø> (+0.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...onstrainttemplate/constrainttemplate_controller.go 56.67% <0.00%> (+0.97%) ⬆️
pkg/readiness/object_tracker.go 79.14% <0.00%> (+1.22%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 469f747...19ce445. Read the comment docs.

Copy link
Contributor

@maxsmythe maxsmythe left a comment

Choose a reason for hiding this comment

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

This looks awesome!

I didn't have time to read the whole thing, but I had a couple nits on the audit section.

website/docs/audit.md Show resolved Hide resolved
website/docs/audit.md Outdated Show resolved Hide resolved
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
website/docs/debug.md Outdated Show resolved Hide resolved
website/docs/exempt-namespaces.md Outdated Show resolved Hide resolved
website/docs/exempt-namespaces.md Outdated Show resolved Hide resolved
website/docs/exempt-namespaces.md Outdated Show resolved Hide resolved
title: How to use Gatekeeper
---

Gatekeeper uses the [OPA Constraint Framework](https://github.com/open-policy-agent/frameworks/tree/master/constraint) to describe and enforce policy. Look there for more detailed information on their semantics and advanced usage.
Copy link
Contributor

Choose a reason for hiding this comment

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

This may be fine just to get the PR out, but I think we should clean up the documentation split a bit.

The constraint framework should definitely have the most detailed info on how things work, but much of it will likely only be relevant for people interested in writing targets or enforcement points.

Maybe this means we create a section of the CF documentation explicitly on using constraints/templates? Maybe we add documentation on how to write templates to the library?

I'm not sure what the best solution is. Whatever we do, we should make sure user's aren't overwhelmed and we should avoid repeating ourselves (which the linking does nicely).

Copy link
Member

@ritazh ritazh Oct 29, 2020

Choose a reason for hiding this comment

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

we create a section of the CF documentation explicitly on using constraints/templates?

The constraint framework should definitely have the most detailed info on how things work, but much of it will likely only be relevant for people interested in writing targets or enforcement points.

I think we should add this doc in the CF repo.

website/docs/howto.md Outdated Show resolved Hide resolved
website/docs/howto.md Outdated Show resolved Hide resolved
website/docs/install.md Outdated Show resolved Hide resolved
baseUrl: '/gatekeeper/website/',
onBrokenLinks: 'throw',
favicon: 'img/favicon.ico',
organizationName: 'sozercan', // TODO(sertac): update to openpolicyagent before merging
Copy link
Contributor

Choose a reason for hiding this comment

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

dangling TODO

Copy link
Member Author

Choose a reason for hiding this comment

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

This is known. Will need to update before merge, otherwise preview in my fork will be broken

website/docusaurus.config.js Show resolved Hide resolved
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Copy link
Contributor

@maxsmythe maxsmythe left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@ritazh ritazh left a comment

Choose a reason for hiding this comment

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

lgtm

Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
@sozercan sozercan merged commit bb9429c into open-policy-agent:master Oct 30, 2020
@sozercan sozercan deleted the docs-pages branch October 30, 2020 17:10
mmirecki pushed a commit to mmirecki/gatekeeper that referenced this pull request Nov 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build gh-pages website from docs
4 participants