-
Notifications
You must be signed in to change notification settings - Fork 2.2k
FINERACT-2421: Add Verify Liquibase Backward Compatibility check
#5313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
adamsaghy
merged 1 commit into
apache:develop
from
adamsaghy:FINERACT-2421/verify-liquibase-compability
Jan 12, 2026
+163
−0
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
163 changes: 163 additions & 0 deletions
163
.github/workflows/verify-liquibase-backward-compatibility.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,163 @@ | ||
| name: Verify Liquibase Backward Compatibility | ||
|
|
||
| on: [pull_request] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| liquibase-backward-compatibility-check: | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 30 | ||
|
|
||
| services: | ||
| postgresql: | ||
| image: postgres:17.4 | ||
| ports: | ||
| - 5432:5432 | ||
| env: | ||
| POSTGRES_USER: root | ||
| POSTGRES_PASSWORD: postgres | ||
| options: >- | ||
| --health-cmd="pg_isready -q -d postgres -U root" | ||
| --health-interval=5s | ||
| --health-timeout=2s | ||
| --health-retries=5 | ||
|
|
||
| env: | ||
| DB_USER: root | ||
| DB_PASSWORD: postgres | ||
| DB_NAME: fineract_default | ||
| TZ: Asia/Kolkata | ||
|
|
||
| steps: | ||
| - name: Checkout the base branch (`develop`) | ||
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v5 | ||
| with: | ||
| repository: ${{ github.event.pull_request.base.repo.full_name }} | ||
| ref: ${{ github.event.pull_request.base.ref }} | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Set up JDK 21 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: 'zulu' | ||
| java-version: '21' | ||
|
|
||
| - name: Wait for PostgreSQL | ||
| run: | | ||
| until pg_isready -h localhost -U $DB_USER; do | ||
| echo "Waiting for postgres..." | ||
| sleep 2 | ||
| done | ||
|
|
||
| - name: Init base schema | ||
| run: | | ||
| ./gradlew --no-daemon createPGDB -PdbName=fineract_tenants | ||
| ./gradlew --no-daemon createPGDB -PdbName=$DB_NAME | ||
|
|
||
| - name: Start backend on base branch | ||
| run: | | ||
| ./gradlew :fineract-provider:devRun --args="\ | ||
| --spring.datasource.hikari.driverClassName=org.postgresql.Driver \ | ||
| --spring.datasource.hikari.jdbcUrl=jdbc:postgresql://localhost:5432/fineract_tenants \ | ||
| --spring.datasource.hikari.username=root \ | ||
| --spring.datasource.hikari.password=postgres \ | ||
| --fineract.tenant.host=localhost \ | ||
| --fineract.tenant.port=5432 \ | ||
| --fineract.tenant.username=root \ | ||
| --fineract.tenant.password=postgres" & | ||
| BACKEND_PID=$! | ||
| echo $BACKEND_PID > backend.pid | ||
|
|
||
| # Wait for Actuator to come up (adjust host/port/path if needed) | ||
| ACTUATOR_URL="https://localhost:8443/fineract-provider/actuator/health" | ||
| TIMEOUT_SECONDS=600 | ||
| INTERVAL_SECONDS=2 | ||
|
|
||
| echo "Waiting for backend Actuator: $ACTUATOR_URL (timeout ${TIMEOUT_SECONDS}s)..." | ||
|
|
||
| start_ts=$(date +%s) | ||
| while true; do | ||
| # If the process died, fail fast | ||
| if ! kill -0 "$BACKEND_PID" 2>/dev/null; then | ||
| echo "Backend process exited before Actuator became available." | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Check endpoint | ||
| if curl -kfsS "$ACTUATOR_URL" >/dev/null 2>&1; then | ||
| echo "Actuator is up." | ||
| break | ||
| fi | ||
|
|
||
| # Timeout | ||
| now_ts=$(date +%s) | ||
| if [ $((now_ts - start_ts)) -ge "$TIMEOUT_SECONDS" ]; then | ||
| echo "Timed out waiting for Actuator." | ||
| exit 1 | ||
| fi | ||
|
|
||
| sleep "$INTERVAL_SECONDS" | ||
| done | ||
|
|
||
| - name: Stop backend | ||
| run: | | ||
| kill $(cat backend.pid) | ||
| sleep 10 | ||
|
|
||
| - name: Checkout the PR branch | ||
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v5 | ||
| with: | ||
| repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
| ref: ${{ github.event.pull_request.head.sha }} | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Start backend on PR branch | ||
| run: | | ||
| ./gradlew :fineract-provider:devRun --args="\ | ||
| --spring.datasource.hikari.driverClassName=org.postgresql.Driver \ | ||
| --spring.datasource.hikari.jdbcUrl=jdbc:postgresql://localhost:5432/fineract_tenants \ | ||
| --spring.datasource.hikari.username=root \ | ||
| --spring.datasource.hikari.password=postgres \ | ||
| --fineract.tenant.host=localhost \ | ||
| --fineract.tenant.port=5432 \ | ||
| --fineract.tenant.username=root \ | ||
| --fineract.tenant.password=postgres" & | ||
| BACKEND_PID=$! | ||
| echo $BACKEND_PID > backend.pid | ||
|
|
||
| # Wait for Actuator to come up (adjust host/port/path if needed) | ||
| ACTUATOR_URL="https://localhost:8443/fineract-provider/actuator/health" | ||
| TIMEOUT_SECONDS=600 | ||
| INTERVAL_SECONDS=2 | ||
|
|
||
| echo "Waiting for backend Actuator: $ACTUATOR_URL (timeout ${TIMEOUT_SECONDS}s)..." | ||
|
|
||
| start_ts=$(date +%s) | ||
| while true; do | ||
| # If the process died, fail fast | ||
| if ! kill -0 "$BACKEND_PID" 2>/dev/null; then | ||
| echo "Backend process exited before Actuator became available." | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Check endpoint | ||
| if curl -kfsS "$ACTUATOR_URL" >/dev/null 2>&1; then | ||
| echo "Actuator is up." | ||
| break | ||
| fi | ||
|
|
||
| # Timeout | ||
| now_ts=$(date +%s) | ||
| if [ $((now_ts - start_ts)) -ge "$TIMEOUT_SECONDS" ]; then | ||
| echo "Timed out waiting for Actuator." | ||
| exit 1 | ||
| fi | ||
|
|
||
| sleep "$INTERVAL_SECONDS" | ||
| done | ||
| - name: Stop backend | ||
| run: | | ||
| kill $(cat backend.pid) | ||
| sleep 10 | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems Ok just asking if i run this check in forked branch on push event which develop branch will it checkout? That forks develop eg. forkedRepo/develop or only apache/develop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it takes the origin which would be "apache", but i can double check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/Aman-Mittal/fineract/actions/runs/20916627097/job/60091598962?pr=4
Im running this workflow in my forked repo to crosscheck, will confirm you with results. what it is doing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just crosschecked
From https://github.com/Aman-Mittal/fineract
When we create PR- it checks the forked branch repo, based on to where PR is trying to merge when i raised the pr against my forked develop it checked out to my forked develop branch
https://github.com/Aman-Mittal/fineract/actions/runs/20916627097/job/60091598962?pr=4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is ok to merge. Behaviour is based on where the GA is ran. For anyone who wants to tests this new GA check i think we should add this on md file. where forked develop must be synced with upstream develop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I think it would be safer to use the PR base repo and ref here... let me rework.