Skip to content

chore(ci): Add script to verify flyway health - #108

Merged
etiennej70 merged 2 commits into
mainfrom
chore/flyway-health
Aug 6, 2026
Merged

chore(ci): Add script to verify flyway health#108
etiennej70 merged 2 commits into
mainfrom
chore/flyway-health

Conversation

@etiennej70

@etiennej70 etiennej70 commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

PR Description

What this PR Provides

To ensure the health and proper execution of flyway migrations, we must guarantee that they remain sequential and that any changes are added after existing ones. Since working on multiple features in parallel can lead to collisions and flawed tests in isolated environments, this pull request (PR) proposes a misconfiguration check between a working branch (PR) and the main branch.

Fixes

Fix the behavior introduced by the commits 50599033e09ee1a7be83c04d06bacc6cf109be7e and 977dbbcc97198ad27afc883fc9ed47ce749a5f7c

Review

The reviewer must double-check these points:

  • The reviewer has tested the feature
  • The reviewer has reviewed the implementation of the feature
  • The documentation has been updated

How to test

  • Checkout this branch
  • Introduce a new flyway migration in the middle of existing ones
  • git commit the change
  • Run .github/scripts/check_flyway_migration_order.sh
  • See the failure

Breaking changes (if any)

  • N/A

@github-code-quality

github-code-quality Bot commented Jul 31, 2026

Copy link
Copy Markdown

Code Coverage Overview

Languages: Java

Java / code-coverage/jacoco

The overall coverage in commit 6f4ae2f in the chore/flyway-health branch remains at 91%, unchanged from commit 8dfc367 in the main branch.


Updated August 06, 2026 12:39 UTC

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a CI guardrail to prevent Flyway migration “version backfills” (and changes to already-merged migrations) by comparing the PR branch’s migrations against the base branch, and documenting the new rule for contributors.

Changes:

  • Add a new GitHub Actions job that runs a migration-order verification script and reports results on the PR.
  • Introduce a Bash script to detect out-of-order, duplicated, renamed/deleted, or modified Flyway migrations vs the base branch.
  • Update contributor and database guidance docs to describe the new CI behavior and migration ordering rules.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
docs/src/contributing/ci-workflow.md Documents the new Flyway migration order check in the CI workflow and key checks list.
.github/workflows/basic_code_checks.yml Adds the new “Flyway Migration Order Check” job and PR-commenting behavior.
.github/tests/test_check_flyway_migration_order.bats Adds Bats tests covering the migration-order script’s expected behavior and edge cases.
.github/scripts/check_flyway_migration_order.sh Implements the migration order / immutability validation and markdown reporting.
.github/instructions/database.instructions.md Updates migration versioning rules to reflect the new CI enforcement.
Suppressed comments (1)

.github/workflows/basic_code_checks.yml:370

  • Same as above: setting only pull-requests: write overrides defaults and can remove contents: read, which actions/checkout needs. Include contents: read in this job's permissions.
    permissions:
      pull-requests: write

Comment thread .github/workflows/basic_code_checks.yml
Comment thread .github/workflows/basic_code_checks.yml Outdated
Comment thread .github/workflows/basic_code_checks.yml
@etiennej70
etiennej70 force-pushed the chore/flyway-health branch 2 times, most recently from 1ecb586 to 59c4398 Compare August 5, 2026 12:54
@etiennej70
etiennej70 marked this pull request as ready for review August 5, 2026 12:59
@etiennej70
etiennej70 force-pushed the chore/flyway-health branch from 6ed381c to 484097d Compare August 6, 2026 12:35
@etiennej70
etiennej70 force-pushed the chore/flyway-health branch from 484097d to 6f4ae2f Compare August 6, 2026 12:36
@sonarqubecloud

sonarqubecloud Bot commented Aug 6, 2026

Copy link
Copy Markdown

@RVANDO12

RVANDO12 commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

local test :
The following Flyway migration issues must be fixed:

src/main/resources/db/migration/V6_4__migrate_entity_dynamic_mapping_relations_to_array.sql is deleted or renamed. A migration already merged on origin/main must be kept as is. Create a new migration instead.
src/main/resources/db/migration/V6_5__migrate_entity_dynamic_mapping_relations.sql is deleted or renamed.

A migration already merged on origin/main must be kept as is. Create a new migration instead.

Highest migration currently on origin/main: V6_5__migrate_entity_dynamic_mapping_relations.sql

@etiennej70
etiennej70 merged commit b65c9e7 into main Aug 6, 2026
23 checks passed
@etiennej70
etiennej70 deleted the chore/flyway-health branch August 6, 2026 14:49
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.

3 participants