-
Notifications
You must be signed in to change notification settings - Fork 305
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
feature: Documentation command #1009
base: master
Are you sure you want to change the base?
Conversation
92993db
to
f9f3d0e
Compare
3d36716
to
73114d4
Compare
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.
hey @xNok
Thanks for bringing this together, I actually very liked the idea of using go templates and embedding both so if the user has their own, overriding it to balance flexibility with functionality.
This can help us collectively gather feedback on how users actually use it and refactor to get it closer to the user needs.
+1 from me on implementation.
Just left some comments at first glance, will look at more.
191ca6e
to
5b32548
Compare
7b3dbe6
to
61b27da
Compare
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 PR! It is very thorough and including documentation on how to use the feature is much appreciated.
@jalseth, I have addressed your comment. It seems there is a broken test, and it fails on |
@xNok Please rebase the branch, the CI should now be passing |
530a4c1
to
0cb4f3e
Compare
Signed-off-by: Alexandre Couedelo <[email protected]> refactor: change the way we access annotations I am testing different way to generate the doc. Having the compiler object is much easier than the annotation set only Signed-off-by: Alexandre Couedelo <[email protected]>
Signed-off-by: Alexandre Couedelo <[email protected]>
Signed-off-by: Alexandre Couedelo <[email protected]>
Signed-off-by: Alexandre Couedelo <[email protected]> fix: make title coherent in submodules documentation Signed-off-by: Alexandre Couedelo <[email protected]>
Signed-off-by: Alexandre Couedelo <[email protected]> chore: ignore golden files in git Signed-off-by: Alexandre Couedelo <[email protected]> chore: document and test the custom template feature Signed-off-by: Alexandre Couedelo <[email protected]> chore: linting Signed-off-by: Alexandre Couedelo <[email protected]>
…9.0 (open-policy-agent#1010) Bumps [github.com/open-policy-agent/opa](https://github.com/open-policy-agent/opa) from 0.68.0 to 0.69.0. - [Release notes](https://github.com/open-policy-agent/opa/releases) - [Changelog](https://github.com/open-policy-agent/opa/blob/main/CHANGELOG.md) - [Commits](open-policy-agent/opa@v0.68.0...v0.69.0) --- updated-dependencies: - dependency-name: github.com/open-policy-agent/opa dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: Alexandre Couedelo <[email protected]>
build(deps): bump github.com/open-policy-agent/opa from 0.68.0 to 0.69.0 (open-policy-agent#1010) Bumps [github.com/open-policy-agent/opa](https://github.com/open-policy-agent/opa) from 0.68.0 to 0.69.0. - [Release notes](https://github.com/open-policy-agent/opa/releases) - [Changelog](https://github.com/open-policy-agent/opa/blob/main/CHANGELOG.md) - [Commits](open-policy-agent/opa@v0.68.0...v0.69.0) --- updated-dependencies: - dependency-name: github.com/open-policy-agent/opa dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: Alexandre Couedelo <[email protected]> chore: go mod tidy
Signed-off-by: Alexandre Couedelo <[email protected]>
Signed-off-by: Alexandre Couedelo <[email protected]>
jalseth Signed-off-by: Alexandre Couedelo <[email protected]>
Signed-off-by: Alexandre Couedelo <[email protected]>
Signed-off-by: Alexandre Couedelo <[email protected]>
Signed-off-by: Alexandre Couedelo <[email protected]>
0cb4f3e
to
0396ea4
Compare
the name of the variable has changed to be more meaningful Signed-off-by: Alexandre Couedelo <[email protected]>
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 found myself wanting to generate reference documentation for my policies, and I figured it would be nice if this was a built-in feature of conftest.
While the way of structuring the documentation can be opinionated, I think using the FlatAnnotationsRefSet is a safe bet, as OPA's core does all the heavy lifting of organizing annotations and rules.
My initial attempt was to combine
FlatAnnotationsRefSet
and Go-template and offer the least opinionated approach to documentation format that can be easily overridden. However, I had some trouble properly formatting titles (H1, H2, H3, etc...) and had to introduce some custom logic to handle it. (As a side note this could potentially be handles by adding template function libraries such as sprig)