docs: backend config and user import schema and markdown generation improvements #1582
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Cleans up the config, moves evertyhing JSON schema related to their own
cmd
s, provides CI workflows for automation.Implementation
Config.go
changes:config.go
into files based on top level config properties.New commands:
schema generate config
- Generates JSON schema for the backend configschema generate import
- Generates JSON schema for the user import/exportschema markdown config
- Generates markdown for the backend configschema markdown import
- Generates markdown for the user import/exportNew workflows:
.github/workflows/schema-generate-config.yml
and./.github/workflows/schema-generate-import.yml
- On every push to themain
branch, if thebackend/config.go
/backend/cmd/user/format.go
file has been changed:./.github/workflows/schema-markdown-import.yml
and./.github/workflows/schema-markdown-config.yml
- On everybackend/*
tag:.md
file endings from links inside generated.md
files (because the GitHub Wiki cannot handle those links)Version
markdown section to all generated.md
files based on the semver contained in the tag that triggered the workflowworkflow_dispatch
in case we might want rollback the docs in the wiki to an earlier versionHow to test
To test the workflows either:
1. Fork the
hanko
repo, uncheck the box for forking only themain
branch.2. In your fork: remove or set all workflows to
workflow_dispatch
(i.e. replace everything under theon
withworkflow_dispatch:
) and commit.3. Go to the fork's
Settings > Features
section, make sureWiki
is enabled.4. Navigate to the Wiki and create a first page, contents are irrelevant at this point. This is necessary because the Wiki repo is not available before adding a page.
5. Merge the PR branch
doc-generation-improvements
intomain
.6.
schema-generate-config
andschema-generate-import
workflows should already run at this point because the PR contains changes to the files/file paths "watched" by the workflow. Make further changes to the files in order to trigger the flows.7. Tag the backend (e.g.
backend/v1.1.0
), the other two workflows should run. They do not push to the Wiki if no changes are detected.