-
Notifications
You must be signed in to change notification settings - Fork 75
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
feat: add custom annotation for configuration property and feature flag documentation #2852
Conversation
Adding feedback from @nynymike here |
At first I was going to ask why don't use markdown template and substituting, like in https://github.com/kongchen/swagger-maven-plugin (sample generated doc https://raw.githubusercontent.com/kongchen/swagger-maven-example/master/generated/document.html). But here it seems goal is to generate separate markdown files for each java file and then inject into docs, right? |
I think this is good approach but im a bit confused here. I think @yuriyz brings up a good note. We are already adding work to our swagger annotations and the more we can add there the less we have to spread out. Meaning less is more for documentation purposes its easier to serve it from one place. With the automation purpose in mind my question would be if we actually miss anything if we follow one spec instead of doing this? Too many is confusing from the users point of view and the developers too. If there is a huge union between swagger spec that can be generated vs this we should reconsider and continue the efforts with our swagger documentation as is being done with config-api. |
The purpose here is to make sure documentation about these properties and flags is easily accessible as well as providing developers with a way to do that. Having these properties documented in our doc site (markdown) has a few advantages:
About using Swagger spec:
About the current approach:
|
We can switch swagger to markdown but with that said if we are planning to move ahead with the above proposal lets agree on the following:
|
I agree. Summarizing documentation approaches.
Raised #2938 to add these as guideline to developer documentation. I'll create |
Let me know if |
Just |
@ossdhaval is it possible to generate swagger spec without REST API stuff. I mean just models? There are different tools that can generate markdown out of swagger. In this case we can continue to use swagger annotation and use markdown in our docs from models. I guess this is what @moabu meant. cc @pujavs , she may know the answer for generator. |
Yes that's exactly what I meant . We can cover a lot with swagger and easily convert to markdown. There shouldn't be an overlap . |
[jans-config-api-parent] Kudos, SonarCloud Quality Gate passed! |
[notify] Kudos, SonarCloud Quality Gate passed! |
[jans-linux-setup] Kudos, SonarCloud Quality Gate passed! |
.github/workflows/build-docs.yml
Outdated
echo "Generate properties and feature flag documents from elements annotated with @DocFeatureFlag and @DocProperty" | ||
|
||
# Compile jans-core to pick-up any changes in annotation processors | ||
mvn -q -f jans-core/pom.xml -DskipTests clean compile install | ||
|
||
# Compile modules where classes that use these annotations exist. | ||
# This will generate markdown files under target/classes directory | ||
mvn -q -f jans-auth-server/pom.xml clean compile | ||
mvn -q -f jans-fido2/pom.xml clean compile | ||
mvn -q -f jans-scim/pom.xml clean compile | ||
|
||
# Move markdown files to appropriate locations under documentation root 'doc' | ||
mv -f jans-auth-server/model/target/classes/janssenauthserver-properties.md docs/admin/reference/json/properties | ||
mv -f jans-auth-server/model/target/classes/janssenauthserver-feature-flags.md docs/admin/reference/json/feature-flags | ||
mv -f jans-fido2/model/target/classes/fido2-properties.md docs/admin/reference/json/properties | ||
mv -f jans-scim/model/target/classes/scim-properties.md docs/admin/reference/json/properties |
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 inject a bash script at https://github.com/JanssenProject/jans/tree/main/automation
under a new folder docs
. This will allow the workflows to be a little bit cleaner as I suspect we will have more of these flows.
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.
@moabu Done. I have moved these commands to a separate script. Please check.
@ossdhaval lets fix bugs found by sonar [jans-core] SonarCloud Quality Gate failed. |
[jans-core] SonarCloud Quality Gate failed. |
@yuriyz Thanks for highlighting this. I have now taken care of most of these Sonar issues. There are two due to duplicate code. The check is failing due to the same reason. Some amount of this duplicate code is intentional to allow customized formating of the document if needed. One method |
* docs: docker installation (#3027) * docs: docker installation * docs: add quick-start page * docs: readme.md and compose,md made identical * docs: adjust warning as per github pages syntex * docs: replace docker with docker compose * docs: github page identical to compose page * docs: remove yml file deletion * docs: fix * docs: fix helm chart url * build(deps): bump zeebe-io/backport-action from 0.0.8 to 0.0.9 (#3060) Bumps [zeebe-io/backport-action](https://github.com/zeebe-io/backport-action) from 0.0.8 to 0.0.9. - [Release notes](https://github.com/zeebe-io/backport-action/releases) - [Commits](korthout/backport-action@v0.0.8...v0.0.9) --- updated-dependencies: - dependency-name: zeebe-io/backport-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * docs: improve vm install instructions (#3091) * docs: add sha check instructions for rhel * docs: add sha check instructions for suse * docs: formating and proofreading of install docs (#3092) * feat: add custom annotation for configuration property and feature flag documentation (#2852) * feat: add custom annotation for prop documentation * feat: add annotation processor * feat: annotate properties * feat: configure annotation processor * feat: add default value * feat: add annotation to enum * feat: add comment * feat: rename annotation * feat: rename processor class * feat: refactor to new core module * feat: fix test class errors * feat: rename the module * feat: add table and details view of content * feat: sort properties * feat: change wording - mandatory to required * feat: add exception handling and logging * feat: write file under classes output dir * feat: create output file under target directory * feat: rename property and file * feat: create separate annotation for feature flags * feat: code cleanup * fix: add description to properties * fix: add property descriptions from Gluu docs * fix: add descriptions from Swagger * fix(fido2): annotate fido config properties * feat(scim): configure property documentation annotations * fix: add module name to file and title * fix: add Feature Flag descriptions * fix: integrate doc generation with CI * fix: add tags to generated docs * fix: create separate sections for properties and flags * fix: update the artifact version for jans-doc * fix: contents of markdown files after merge * ci: remove token req * fix: sonar issues * fix: sonar issues * fix: sonar issues * fix: move doc generation to shell script Co-authored-by: Mohammad Abudayyeh <47318409+moabu@users.noreply.github.com> * ci: use hotspath-storage in quickstart script * doc: remove redundant API details sections (#3093) * feat(jans-auth-server): specify minimum acr for clients #343 (#3083) * feat(jans-auth-server): specify minimum acr for clients #343 * feat(jans-auth-server): added minimum acr properties to dynamic registration #343 * doc(jans-auth-server): added docs and updated swagger with new minimum acr related properties #343 * docs: add kuberentes planning guide initial points * docs: add kuberentes planning guide initial points * Update certificates.md (#3096) * docs: scim logs Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Amro Misbah <amromisba7@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Dhaval D <343411+ossdhaval@users.noreply.github.com> Co-authored-by: Mohammad Abudayyeh <47318409+moabu@users.noreply.github.com> Co-authored-by: YuriyZ <yzabrovarniy@gmail.com> Co-authored-by: mzico <mohib@gluu.org>
Prepare
Description
PR is work in progress and aimed to gather feedback on approach towards automating documentation of configuration properties and feature flags
The problem that we are trying to solve is of missing out on documenting properties and feature flags. Developers often add these elements without updating relevant documentation resulting in the user not being aware of the feature or property setting.
If developers can have a simple annotation to take care of generating the documentation, it will make sure that code and documentation will stay in synch for properties and feature flags.
The proposed approach leverages annotation processing at compile time. It involves
A sample of generated markdown looks like below:
Tasks:
jans\docs
Review comments:
Target issue
closes #issue-number-here
Implementation Details
Test and Document the changes