Skip to content

feat(database): add automated migration status check for CI and startup - #149

Open
Seunfunmi-319509 wants to merge 4 commits into
ASTROIDX556:mainfrom
Seunfunmi-319509:feat/migration-status-check
Open

feat(database): add automated migration status check for CI and startup#149
Seunfunmi-319509 wants to merge 4 commits into
ASTROIDX556:mainfrom
Seunfunmi-319509:feat/migration-status-check

Conversation

@Seunfunmi-319509

Copy link
Copy Markdown
Contributor

Implemented automated Prisma migration status verification across application startup and the CI pipeline to prevent schema drift and deployment failures.

What was done

  • Added a migration verification utility to detect unapplied or inconsistent Prisma migrations.
  • Integrated migration status validation into the NestJS application startup sequence.
  • Configured strict startup behavior to log a critical error and abort when pending migrations are detected.
  • Updated the GitHub Actions CI workflow to validate Prisma client generation and migration status without applying migrations.
  • Added unit tests covering migration verification and failure scenarios.
  • Verified type checking, test execution, and CI workflow configuration.

Acceptance Criteria

  • Migration verification utility implemented.
  • Application startup validates migration status.
  • CI validates Prisma generation and migration status.
  • Unit tests cover the migration verification helper.
  • Clear errors are provided for migration inconsistencies.
  • Tests and type checks pass.

Closes #96

Implements a migration verification utility that checks if the Prisma schema
matches applied database migrations. Adds startup validation in PrismaService
and a CI workflow step to verify migration integrity without destructive actions.

Closes ASTROIDX556#96

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
@drips-wave

drips-wave Bot commented Aug 30, 2026

Copy link
Copy Markdown

@Seunfunmi-319509 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@mergekeeper

mergekeeper Bot commented Aug 30, 2026

Copy link
Copy Markdown

MergeKeeper review

Scope: in scope for linked issue #96.
Verdict: clean

Successfully implemented automated Prisma migration status checks for the CI pipeline and NestJS startup sequence with appropriate unit tests.

Reviewed commit: 8b7dc063c482785cafb4442ddb8d4a9edc92bed2.
CI and merge eligibility are checked separately.

@mergekeeper

mergekeeper Bot commented Aug 30, 2026

Copy link
Copy Markdown

MergeKeeper merge status

Status: blocked
PR state: open
Mergeability: mergeable
Checked commit: 8b7dc063c482785cafb4442ddb8d4a9edc92bed2.

Reason:
GitHub pull request merge request failed with 403: Resource not accessible by integration

Next steps:
GitHub rejected this as a permissions/ruleset problem, not a review problem — a maintainer merge override cannot force this through.

  1. Confirm the MergeKeeper GitHub App has Contents: Read & write and Pull requests: Read & write permissions for this repository.
  2. If this repository uses a ruleset, add the MergeKeeper GitHub App as a Bypass actor on it (Settings → Rules → Rulesets → the ruleset → Bypass list) — this is what the "bypass rules" checkbox on GitHub's merge button represents, and MergeKeeper can only do the same once it's listed there.
  3. Retry the merge once either is fixed.

Seunfunmi-319509 and others added 2 commits August 30, 2026 20:25
…k job

prisma validate and prisma generate require DATABASE_URL to be set even for
schema-only validation. Add a dummy connection string so CI can validate the
schema without a real database.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
…rtions

Fixes @typescript-eslint/no-explicit-any lint errors in migration checker
tests by casting mock objects via `as unknown as PrismaClient` instead.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>

@mergekeeper mergekeeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approved

Successfully implemented automated Prisma migration status check in both CI and application startup along with unit tests.

@mergekeeper mergekeeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approved

Successfully implemented automated Prisma migration status checks for the CI pipeline and NestJS startup sequence with appropriate unit tests.

@Seunfunmi-319509

Copy link
Copy Markdown
Contributor Author

@K1NGD4VID sorry why is it not merging?

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.

Implement automated database migration status check in CI pipeline and startup health probe

1 participant