Repository navigation
Automate /docs/ updates with a docs-sync workflow - #65
Closed
Aman-Mittal wants to merge 1 commit into
Closed
Aman-Mittal wants to merge 1 commit into
Aman-Mittal wants to merge 1 commit into
Conversation
Aman-Mittal
force-pushed
the
docs-sync-workflow
branch
from
October 25, 2026 08:03
a55fb0f to
db06a92
Compare
Add .github/workflows/docs-sync.yml, which rebuilds the Fineract docs weekly (or on demand) and opens a PR against asf-site: - develop: refreshes docs/X.Y.Z-SNAPSHOT behind /docs/develop, skipped when develop has not moved or only the build timestamps changed. - the newest X.Y.Z release tag without docs/X.Y.Z/: adds it and points /docs/stable at it. The workflow only calls scripts in .github/scripts, so a run can be reproduced and verified locally: - docs-sync.sh: plan, and build (backend clone, asciidoctor, then `fineract-site docs` unchanged, then docs_aliases.py, then the same site build and checks as site-pr-check.yml). It stops before building when Graphviz or the Vega CLI tools are missing, and deletes fineract-doc/build first so no stale diagram is reused (see #66). - docs_aliases.py: the .htaccess changes done by hand so far. With no new release it changes nothing; when the snapshot version rolls it removes the previous snapshot folder so Git records a rename, as in 3c4e0c1. - docs-sync-pr.sh: commit message, PR title, branch and body. The Vega CLI tools are pinned in .github/docs-sync/package-lock.json; Graphviz comes from apt. `fineract-site test` also runs the tests in .github/scripts.
Aman-Mittal
force-pushed
the
docs-sync-workflow
branch
from
October 25, 2026 08:25
db06a92 to
036badd
Compare
Member
Author
|
Closing this needs testing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Automates the steps from #64: building the docs with
./gradlew asciidoctor, copying them withfineract-site docs, and updating.htaccess. It follows the same pattern as the API spec sync in fineract-backoffice-ui.fineract-site docs(scripts/generate_docs.py) is unchanged. Everything new lives in.github/scripts.What it does
.github/workflows/docs-sync.ymlruns every Monday, or by hand withref,dry_runandforceinputs, and opens a PR againstasf-site:developdevelophas moved since the commit recorded in the lastupdate /docs/*-SNAPSHOTcommitdocs/X.Y.Z-SNAPSHOT/in place. If the backend version has rolled after a release, it removes the previous snapshot folder (so Git records a rename, as in 3c4e0c1) and points/docs/developand the commented/docs/rccandidate at the new version.X.Y.Ztagdocs/X.Y.Z/yet/docs/stable(and so/docs/current) at it.When there's no new release, only the snapshot
index.htmlchanges: no rename and no.htaccessedit. A rebuild where only the "Built on" or "Last updated" stamps change opens no PR. Each target uses a fixed branch (bot/docs-develop,bot/docs-X.Y.Z), so re-runs update the open PR instead of adding new ones. Commits are signed by GitHub (sign-commits), soverify-commits.ymlpasses.Layout
The workflow only calls the scripts below, so a run can be reproduced locally (README, "Automated docs sync").
.github/scripts/docs-sync.sh:planandbuild.builddoes the following in order:dot(Graphviz),vl2vgandvg2svgare present, and stops if notfineract-doc/build, so no diagram rendered while a tool was missing gets reused (see Fix broken diagrams in /docs/1.16.0 and /docs/1.17.0-SNAPSHOT; fail the build on them #66)./gradlew asciidoctorfineract-site docs --version Vdocs_aliases.pysite-tool buildand checks assite-pr-check.yml, including the diagram check from Fix broken diagrams in /docs/1.16.0 and /docs/1.17.0-SNAPSHOT; fail the build on them #66.github/scripts/docs_aliases.py: the.htaccessand snapshot-folder changes that were done by hand. It stages them and appends a note for each toDOCS-LOG-MESSAGE. It can also be run by hand afterfineract-site docs..github/scripts/docs-sync-pr.sh: turnsDOCS-LOG-MESSAGEinto the commit message, PR title, branch and body, so no${{ }}is interpolated into shell..github/scripts/test_docs_aliases.py: unit tests for the alias logic, plus end-to-end runs against a scratch Git repo covering no release, a snapshot roll, a new release, and running beforefineract-site docs.site-tool testnow also runs the tests in.github/scripts..github/docs-sync/package-lock.json: pinsvega-cliandvega-lite. Graphviz comes from apt, since the runner image doesn't include it.Security
zizmor --persona=pedanticreports no findings. The one ignore issuperfluous-actionsonpeter-evans/create-pull-request, becausegh pr createcan't make signed commits.actionlintandshellcheckare clean.persist-credentials: falseandpermissions: {}at the top level.--ignore-scripts.github.tokenonly. PRs opened with that token don't trigger other workflows, so the job itself runs the samesite-tool buildand checks assite-pr-check.yml.Verified locally
On this commit, in a fresh clone:
build develop developfrom a simulated pre-roll state (/docs/developpointing at1.16.0-SNAPSHOT), built fromdevelopat apache/fineract@01bb02b:docs/1.16.0-SNAPSHOT/index.html -> docs/1.17.0-SNAPSHOT/index.htmlas a rename./docs/developand the/docs/rccandidate move to 1.17.0.site-tool test: the Ruby suite (23 runs) and 21 Python tests (13 from Fix broken diagrams in /docs/1.16.0 and /docs/1.17.0-SNAPSHOT; fail the build on them #66, 8 here) pass.From the earlier round, unchanged since:
planplans nothing whiledevelopis still at the commit the snapshot docs came from, plans a release build when given1.16.0, and rejects a malformed ref. A rebuild of an unchanged commit giveschanged=false, so no PR.docs-sync-pr.shproduces the expected commit message, branch and body.Note
The first run will change the widths of the Vega-Lite diagrams compared with the hand-built pages. Without the native
canvasmodule (skipped by--ignore-scripts), Vega estimates text widths instead of measuring real fonts. Output is byte-identical from run to run, so this is a one-time diff.