Skip to content

feat(#1177): add SchemaSpy workflow for postgres deployment model#1219

Open
Abradat wants to merge 10 commits intomainfrom
feat/1177-setup-schemaspy-on-postgresql-database
Open

feat(#1177): add SchemaSpy workflow for postgres deployment model#1219
Abradat wants to merge 10 commits intomainfrom
feat/1177-setup-schemaspy-on-postgresql-database

Conversation

@Abradat
Copy link
Collaborator

@Abradat Abradat commented Mar 6, 2026

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:

  • Added a new workflow file .github/workflows/schema-spy.yml that triggers SchemaSpy to generate database documentation on pushes to the main branch 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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Documentation update

How Has This Been Tested?

  • New unit tests
  • New integrated tests
  • New component tests
  • New end-to-end tests
  • New user flow tests
  • No new tests are required
  • Manual tests (description below)
  • Updated existing tests

Checklist

  • I have read the CONTRIBUTING doc
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have already been accepted and merged

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:

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.
@Abradat Abradat linked an issue Mar 6, 2026 that may be closed by this pull request
3 tasks
@Abradat Abradat marked this pull request as ready for review March 6, 2026 23:19
Copilot AI review requested due to automatic review settings March 6, 2026 23:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 SchemaSpy workflow triggered by main pushes 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.

Comment on lines +21 to +22
contents: write
pages: write
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
contents: write
pages: write
contents: read
pages: write
id-token: write

Copilot uses AI. Check for mistakes.
Comment on lines +25 to +27
flyway_locations: >-
filesystem:./backend/src/main/resources/db/migration,
filesystem:./backend/src/main/resources/db/migration-dev
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DEV TASK]: Setup SchemaSpy on PostgreSQL database

2 participants