Skip to content

Add schema diagram workflow using SchemaCrawler-Action#188

Open
Copilot wants to merge 3 commits intomainfrom
copilot/create-schema-diagram-workflow-again
Open

Add schema diagram workflow using SchemaCrawler-Action#188
Copilot wants to merge 3 commits intomainfrom
copilot/create-schema-diagram-workflow-again

Conversation

Copy link
Contributor

Copilot AI commented Feb 7, 2026

Adds a GitHub Actions workflow to auto-generate database schema diagrams from the SQLAlchemy models using SchemaCrawler-Action.

  • .github/workflows/schema-diagram.yml — Triggers on model changes to main (push/PR) and workflow_dispatch. Creates a sample SQLite DB from the ORM models, runs SchemaCrawler to produce a PNG diagram, uploads as artifact.
  • .github/scripts/create-sample-db.sh — Generates an empty SQLite database with the full schema via Base.metadata.create_all(). Accepts output path as argument.

SchemaCrawler-Action is Docker-based, so it uses a version tag (@v17.6.0) rather than a SHA pin — Docker actions don't resolve SHAs correctly.

Original prompt

This section details on the original issue you should resolve

<issue_title>Create schema diagram</issue_title>
<issue_description>Use a GitHub action workflow to make a schema diagram. Example tool: https://github.com/schemacrawler/SchemaCrawler-Action</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Create a GitHub Actions workflow that generates database schema diagrams
using SchemaCrawler-Action. The workflow:
- Triggers on push/PR to main when backend model files change
- Supports manual dispatch
- Creates a sample SQLite DB from SQLAlchemy models
- Generates a schema diagram PNG via SchemaCrawler
- Uploads the diagram as a workflow artifact

Co-authored-by: DevSecNinja <14926452+DevSecNinja@users.noreply.github.com>
Copilot AI changed the title [WIP] Add GitHub action workflow for schema diagram Add schema diagram workflow using SchemaCrawler-Action Feb 7, 2026
Copilot AI requested a review from DevSecNinja February 7, 2026 19:31
@DevSecNinja DevSecNinja requested review from Copilot and removed request for DevSecNinja February 7, 2026 19:33
@DevSecNinja DevSecNinja marked this pull request as ready for review February 7, 2026 19:33
@github-actions github-actions bot added the ci/cd label Feb 7, 2026
@github-actions
Copy link

github-actions bot commented Feb 7, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails
actions/actions/checkout de0fac2e4500dabe0009e67214ff5f5447ce83dd 🟢 6.4
Details
CheckScoreReason
Code-Review🟢 10all changesets reviewed
Maintained🟢 57 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 5
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Binary-Artifacts🟢 10no binaries found in the repo
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Packaging⚠️ -1packaging workflow not detected
Pinned-Dependencies🟢 3dependency not pinned by hash detected -- score normalized to 3
Signed-Releases⚠️ -1no releases found
Security-Policy🟢 9security policy file detected
Branch-Protection🟢 6branch protection is not maximal on development and all release branches
Vulnerabilities🟢 73 existing vulnerabilities detected
SAST🟢 8SAST tool detected but not run on all commits
actions/actions/setup-python a309ff8b426b58ec0e2a45f0f869d46889d02405 🟢 5
Details
CheckScoreReason
Maintained🟢 57 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 5
Code-Review🟢 10all changesets reviewed
Binary-Artifacts🟢 10no binaries found in the repo
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Packaging⚠️ -1packaging workflow not detected
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Signed-Releases⚠️ -1no releases found
Security-Policy🟢 9security policy file detected
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
Vulnerabilities⚠️ 010 existing vulnerabilities detected
SAST🟢 9SAST tool is not run on all commits -- score normalized to 9
actions/actions/upload-artifact ea165f8d65b6e75b540449e92b4886f43607fa02 🟢 6.2
Details
CheckScoreReason
Packaging⚠️ -1packaging workflow not detected
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Code-Review🟢 10all changesets reviewed
Maintained🟢 1027 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 10
Binary-Artifacts🟢 10no binaries found in the repo
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Fuzzing⚠️ 0project is not fuzzed
Signed-Releases⚠️ -1no releases found
Security-Policy🟢 9security policy file detected
Pinned-Dependencies⚠️ 1dependency not pinned by hash detected -- score normalized to 1
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
Vulnerabilities🟢 64 existing vulnerabilities detected
SAST🟢 10SAST tool is run on all commits
actions/schemacrawler/SchemaCrawler-Action 17.6.0 🟢 5.2
Details
CheckScoreReason
Code-Review⚠️ 0Found 0/20 approved changesets -- score normalized to 0
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Binary-Artifacts🟢 10no binaries found in the repo
Maintained🟢 1023 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Security-Policy⚠️ 0security policy file not detected
Vulnerabilities🟢 100 existing vulnerabilities detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: some github tokens can't read classic branch protection rules: https://github.com/ossf/scorecard-action/blob/main/docs/authentication/fine-grained-auth-token.md
Packaging🟢 10packaging workflow detected
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0

Scanned Files

  • .github/workflows/schema-diagram.yml

@codecov
Copy link

codecov bot commented Feb 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.82%. Comparing base (e9daa58) to head (581e4a1).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #188   +/-   ##
=======================================
  Coverage   71.82%   71.82%           
=======================================
  Files          11       11           
  Lines         802      802           
  Branches      124      124           
=======================================
  Hits          576      576           
  Misses        163      163           
  Partials       63       63           
Flag Coverage Δ
backend 71.82% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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 automated generation of a database schema diagram in CI to visualize the current SQLAlchemy/SQLite schema.

Changes:

  • Introduces a new schema-diagram GitHub Actions workflow that generates a PNG schema diagram and uploads it as an artifact.
  • Adds a helper script to generate an empty SQLite database from the SQLAlchemy ORM metadata for SchemaCrawler to introspect.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/schema-diagram.yml New workflow to create a sample DB, run SchemaCrawler, and upload a diagram artifact.
.github/scripts/create-sample-db.sh New script to create the SQLite schema via Base.metadata.create_all().

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create schema diagram

3 participants