Repository navigation
Add Flyway migration conflict detection in CI - #1888
Conversation
Backend Test Results118 files 118 suites 15s ⏱️ Results for commit 66fca65. ♻️ This comment has been updated with latest results. |
| name: Check for DB Migrations | ||
| if: github.event_name == 'pull_request' && ((github.base_ref == 'master' && github.head_ref == 'develop') || github.base_ref == 'develop') | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| has_migrations: ${{ steps.check_migrations.outputs.has_migrations }} | ||
| steps: | ||
| - name: Checkout PR branch | ||
| - name: Checkout Repository for Diff | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Determine comparison reference | ||
| id: compare_ref | ||
| run: | | ||
| bash .github/scripts/determine-compare-ref.sh "${{ github.base_ref }}" | ||
|
|
||
| - name: Check for migration changes | ||
| - name: Detect Flyway Migration Changes | ||
| id: check_migrations | ||
| if: steps.compare_ref.outputs.has_ref == 'true' | ||
| run: | | ||
| # Check for changes in the migration directory | ||
| if git diff --name-only --diff-filter=AMRCD ${{ env.COMPARE_REF }}...HEAD | grep -q "booklore-api/src/main/resources/db/migration/"; then | ||
| echo "Migration file changes detected." | ||
| # Compare PR head with the target base branch | ||
| if git diff --name-only origin/${{ github.base_ref }}...HEAD | grep -q "booklore-api/src/main/resources/db/migration/V.*.sql"; then | ||
| echo "Migration file changes detected. Proceeding with migration preview." | ||
| echo "has_migrations=true" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "No migration file changes detected. Skipping conflict check." | ||
| echo "No migration file changes detected. Skipping migration preview." | ||
| echo "has_migrations=false" >> $GITHUB_OUTPUT | ||
| fi | ||
|
|
||
| - name: Analyze migration changes | ||
| if: steps.check_migrations.outputs.has_migrations == 'true' | ||
| id: analyze_changes | ||
| flyway-migration-preview: |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 10 months ago
To fix this issue, we need to add a permissions block to the workflow (in .github/workflows/docker-build-publish.yml). The most effective way is to add this block at the workflow root, just below the name key and before the on key. This will ensure all jobs default to restrictive permissions unless another job needs elevated rights and overrides them. The block to add should be:
permissions:
contents: readThis change does not restrict functionality for the jobs shown, since all steps in check-for-migrations, flyway-migration-preview, and (by implication) other jobs only require source code checkout and local operations. If any job requires additional permissions, it can introduce its own permissions block. No new methods, imports, or environment changes are required—just this small YAML addition.
| @@ -1,4 +1,6 @@ | ||
| name: Build, Tag, Push, and Release to GitHub Container Registry | ||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| push: |
# Conflicts: # .github/workflows/docker-build-publish.yml
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [ghcr.io/booklore-app/booklore](https://github.com/booklore-app/booklore) | minor | `v1.14.1` -> `v1.15.0` | --- ### Release Notes <details> <summary>booklore-app/booklore (ghcr.io/booklore-app/booklore)</summary> ### [`v1.15.0`](https://github.com/booklore-app/booklore/releases/tag/v1.15.0) [Compare Source](booklore-app/booklore@v1.14.1...v1.15.0) #### 🌟 What's New in v1.15.0 #### 🚀 New Features - feat: add additional cover art actions and settings ([#​1938](booklore-app/booklore#1938)) by [@​CounterClops](https://github.com/CounterClops) - feat(hardcover): sync Kobo reading progress to Hardcover ([#​1926](booklore-app/booklore#1926)) by [@​boludo00](https://github.com/boludo00) - Add sequential next/previous book navigation from library, filtered, and search views ([#​1931](booklore-app/booklore#1931)) by [@​acx10](https://github.com/acx10) - feat(api, ui): add bookdrop bulk edit and metadata pattern extraction ([#​1846](booklore-app/booklore#1846)) by [@​CounterClops](https://github.com/CounterClops) - Add support for fb2 books ([#​1757](booklore-app/booklore#1757)) by [@​slonoed](https://github.com/slonoed) #### ✨ Enhancements - feat: add library sync URL generation in KoboUrlBuilder ([#​1937](booklore-app/booklore#1937)) by [@​ripdog](https://github.com/ripdog) - feat(opds): allow user to set sorting for opds feed in settings ([#​1824](booklore-app/booklore#1824)) by [@​WorldTeacher](https://github.com/WorldTeacher) - Feat/conversion CBX to EPUB compression configuration ([#​1844](booklore-app/booklore#1844)) by [@​thvardhan](https://github.com/thvardhan) - feat(opds): add series hierarchy ([#​1837](booklore-app/booklore#1837)) by [@​WorldTeacher](https://github.com/WorldTeacher) #### 🎨 UI Tweaks - fix: Bookdrop UI mobile support ([#​1911](booklore-app/booklore#1911)) by [@​Muppetteer](https://github.com/Muppetteer) - fix: Consistent dialogs ([#​1842](booklore-app/booklore#1842)) by [@​Muppetteer](https://github.com/Muppetteer) #### 🐛 Bug Fixes - fix: Library icon name bug ([#​1934](booklore-app/booklore#1934)) by [@​Muppetteer](https://github.com/Muppetteer) - fix: bookdrop bulk actions not applying to uncached pages ([#​1928](booklore-app/booklore#1928)) by [@​CounterClops](https://github.com/CounterClops) - fix: file renaming with wrong extension ([#​1929](booklore-app/booklore#1929)) by [@​CounterClops](https://github.com/CounterClops) - fix(FileService): update User-Agent header for ComicVine to let the Parser through ([#​1880](booklore-app/booklore#1880)) by [@​balazs-szucs](https://github.com/balazs-szucs) - fix(ui): Force page reload on logout ([#​1870](booklore-app/booklore#1870)) by [@​Muppetteer](https://github.com/Muppetteer) #### 🛠️ Refactoring & Maintenance - refactor(fb2, misc): Improve code quality, update to modern Java patterns, add reasonable initial values for StringBuilders ([#​1932](booklore-app/booklore#1932)) by [@​balazs-szucs](https://github.com/balazs-szucs) #### 📦 Dependencies - Upgrade Angular from v20 to v21 and update other dependencies ([#​1916](booklore-app/booklore#1916)) by [@​acx10](https://github.com/acx10) - chore(deps): bump docker/login-action from 2 to 3 ([#​1908](booklore-app/booklore#1908)) by @​[dependabot\[bot\]](https://github.com/apps/dependabot) - chore(deps): update actions/setup-java action to v5 ([#​1871](booklore-app/booklore#1871)) by @​[renovate\[bot\]](https://github.com/apps/renovate) - chore(deps): update actions/upload-artifact action to v6 ([#​1872](booklore-app/booklore#1872)) by @​[renovate\[bot\]](https://github.com/apps/renovate) - chore(deps): update actions/checkout action to v6 ([#​1869](booklore-app/booklore#1869)) by @​[renovate\[bot\]](https://github.com/apps/renovate) - chore(deps): update dependency org.flywaydb:flyway-mysql to v11.19.0 ([#​1868](booklore-app/booklore#1868)) by @​[renovate\[bot\]](https://github.com/apps/renovate) - chore(deps): update dependency org.apache.commons:commons-text to v1.15.0 ([#​1865](booklore-app/booklore#1865)) by @​[renovate\[bot\]](https://github.com/apps/renovate) - chore(deps): update lscr.io/linuxserver/mariadb docker tag to v11.4.8 ([#​1862](booklore-app/booklore#1862)) by @​[renovate\[bot\]](https://github.com/apps/renovate) - chore(deps): update dependency org.freemarker:freemarker to v2.3.34 ([#​1861](booklore-app/booklore#1861)) by @​[renovate\[bot\]](https://github.com/apps/renovate) - chore(deps): update dependency org.assertj:assertj-core to v3.27.6 ([#​1859](booklore-app/booklore#1859)) by @​[renovate\[bot\]](https://github.com/apps/renovate) - chore(deps): update dependency gradle to v8.14.3 ([#​1858](booklore-app/booklore#1858)) by @​[renovate\[bot\]](https://github.com/apps/renovate) #### ⚙️ CI/CD - Add Flyway migration conflict detection in CI ([#​1888](booklore-app/booklore#1888)) by [@​acx10](https://github.com/acx10) - Speed up CI builds by introducing dependency caching ([#​1874](booklore-app/booklore#1874)) by [@​acx10](https://github.com/acx10) - Add Flyway migration version conflict check in GitHub Actions ([#​1863](booklore-app/booklore#1863)) by [@​acx10](https://github.com/acx10) ##### 🐳 Docker Images - **Docker Hub:** `booklore/booklore:v1.15.0` - **GitHub Container Registry:** `ghcr.io/booklore-app/booklore:v1.15.0` **Full Changelog**: <booklore-app/booklore@v1.14.1...v1.15.0> </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi4zOS4xIiwidXBkYXRlZEluVmVyIjoiNDIuMzkuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiaW1hZ2UiXX0=--> Reviewed-on: https://gitea.alexlebens.dev/alexlebens/infrastructure/pulls/2735 Co-authored-by: Renovate Bot <renovate-bot@alexlebens.net> Co-committed-by: Renovate Bot <renovate-bot@alexlebens.net>
🚀 Pull Request
📝 Description
🛠️ Changes Implemented
🧪 Testing Strategy
📸 Visual Changes (if applicable)
developbranch./gradlew testfor backend)💬 Additional Context (optional)