Skip to content
This repository was archived by the owner on Sep 9, 2026. It is now read-only.

NO-ISSUE: adds migration file numbering validation tests - #450

Merged
openshift-merge-bot[bot] merged 1 commit into
osac-project:mainfrom
wgordon17:feat/migration-crashloop-detection-pr1
Apr 25, 2026
Merged

openshift-merge-bot[bot] merged 1 commit into
osac-project:mainfrom
wgordon17:feat/migration-crashloop-detection-pr1

Conversation

@wgordon17

@wgordon17 wgordon17 commented Apr 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds test specs to catch duplicate migration numbers, naming convention violations, and unexpected numbering gaps
  • Uses a known-gaps allowlist for the intentionally skipped migration 18

Summary by CodeRabbit

  • Tests
    • Added migration integrity validation checks to ensure database migrations maintain unique identifiers, follow consistent naming conventions, and preserve continuous numbering.
    • These tests improve system reliability by catching malformed or conflicting migration files earlier, reducing deployment/runtime migration failures and making upgrade paths safer.

@openshift-ci-robot

Copy link
Copy Markdown

@wgordon17: This pull request explicitly references no jira issue.

Details

In response to this:

Summary

  • Adds test specs to catch duplicate migration numbers, naming convention violations, and unexpected numbering gaps
  • Uses a known-gaps allowlist for the intentionally skipped migration 18

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci

openshift-ci Bot commented Apr 24, 2026

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@wgordon17
wgordon17 marked this pull request as ready for review April 24, 2026 22:30
@openshift-ci
openshift-ci Bot requested review from larsks and trewest April 24, 2026 22:30
@coderabbitai

coderabbitai Bot commented Apr 24, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0493b1f4-a7dc-4840-b3f2-0bb24663525f

📥 Commits

Reviewing files that changed from the base of the PR and between 38f848c and c7cf395.

📒 Files selected for processing (1)
  • internal/database/database_migrations_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • internal/database/database_migrations_test.go

Walkthrough

Adds three Ginkgo tests in internal/database/database_migrations_test.go to validate migration file integrity: (1) ensures uniqueness of migration identifiers by extracting the numeric prefix and direction from each migrations/*.sql basename and failing on duplicates; (2) enforces a filename regex requiring <digits>_<lowercase_or_underscore_name>.(up|down).sql and reports nonconforming basenames; and (3) checks continuity of numeric prefixes among .up.sql files, computing the max number and failing if any numbers are missing except for an explicitly allowed gap (18). Imports were updated to support parsing, regex, and numeric conversion.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding validation tests for migration file numbering, which is directly reflected in the file changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Generated-By: Claude Code (Anthropic)
Signed-off-by: Will Gordon <wgordon@redhat.com>
@wgordon17
wgordon17 force-pushed the feat/migration-crashloop-detection-pr1 branch from 38f848c to c7cf395 Compare April 24, 2026 23:30
@openshift-ci

openshift-ci Bot commented Apr 25, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jhernand, wgordon17

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot
openshift-merge-bot Bot merged commit 5b31c1f into osac-project:main Apr 25, 2026
12 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants