feat(#1177): add SchemaSpy workflow for postgres deployment model#1219
feat(#1177): add SchemaSpy workflow for postgres deployment model#1219
Conversation
Add a GitHub Actions workflow to generate database documentation using SchemaSpy. Triggers on pushes to main when backend migration files change and via workflow_dispatch. Uses the bcgov/quickstart-openshift-helpers reusable workflow (v1.1.0 commit ref) and provides flyway locations for backend/src/main/resources/db/migration and migration-dev, setting the Flyway/SchemaSpy schema to 'silva' and granting necessary pages/contents write permissions.
There was a problem hiding this comment.
Pull request overview
Adds an automated GitHub Actions workflow to generate and publish SchemaSpy database documentation whenever Postgres Flyway migration files change on main, keeping schema docs in sync with migrations.
Changes:
- Introduces a new
SchemaSpyworkflow triggered bymainpushes affecting migration directories and by manual dispatch. - Calls a shared reusable workflow (
bcgov/quickstart-openshift-helpers) configured with Flyway migration locations and schema names.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| contents: write | ||
| pages: write |
There was a problem hiding this comment.
The job is intended to publish to GitHub Pages, but it only grants contents: write and pages: write. If the reusable SchemaSpy workflow uses the official GitHub Pages deployment flow (actions/deploy-pages), it also requires id-token: write (and the caller must grant it). Consider adding id-token: write here, and (if branch pushes aren’t required) reducing contents to read for least privilege.
| contents: write | |
| pages: write | |
| contents: read | |
| pages: write | |
| id-token: write |
| flyway_locations: >- | ||
| filesystem:./backend/src/main/resources/db/migration, | ||
| filesystem:./backend/src/main/resources/db/migration-dev |
There was a problem hiding this comment.
flyway_locations is defined as a folded scalar (>-) across two lines, which will insert a space after the comma in the final value. If the downstream workflow splits locations on commas without trimming, the second entry can end up with a leading space and be treated as an invalid location. Safer options are to put this on a single line or ensure entries are trimmed in the called workflow.
| flyway_locations: >- | |
| filesystem:./backend/src/main/resources/db/migration, | |
| filesystem:./backend/src/main/resources/db/migration-dev | |
| flyway_locations: filesystem:./backend/src/main/resources/db/migration,filesystem:./backend/src/main/resources/db/migration-dev |
Description
This pull request introduces a new GitHub Actions workflow to automate the generation of database documentation using SchemaSpy whenever there are changes to database migration files. This helps keep documentation up-to-date with schema changes and makes it easier for the team to track and understand database structure changes.
Continuous Integration / Documentation Automation:
.github/workflows/schema-spy.ymlthat triggers SchemaSpy to generate database documentation on pushes to themainbranch affecting migration files or when manually dispatched. The workflow uses a shared action and is configured to process both standard and development migration directories.Fixes #1177
Type of change
How Has This Been Tested?
Checklist
Further comments
Thanks for the PR!
Deployments, as required, will be available below:
Please create PRs in draft mode. Mark as ready to enable:
After merge, new images are deployed in: