Skip to content

Conversation

@tahminator
Copy link
Owner

@tahminator tahminator commented Jan 27, 2026

677

Description of changes

Checklist before review

  • I have done a thorough self-review of the PR
  • Copilot has reviewed my latest changes, and all comments have been fixed and/or closed.
  • If I have made database changes, I have made sure I followed all the db repo rules listed in the wiki here. (check if no db changes)
  • All tests have passed
  • I have successfully deployed this PR to staging
  • I have done manual QA in both dev (and staging if possible) and attached screenshots below.

Screenshots

Dev

Staging

@github-actions
Copy link
Contributor

Available PR Commands

  • /ai - Triggers all AI review commands at once
  • /review - AI review of the PR changes
  • /describe - AI-powered description of the PR
  • /improve - AI-powered suggestions
  • /deploy - Deploy to staging

See: https://github.com/tahminator/codebloom/wiki/CI-Commands

@github-actions
Copy link
Contributor

Title

677: replace maven caching with explicit cache action


PR Type

Enhancement


Description

  • Add explicit Maven cache via actions/cache

  • Apply caching across composite actions

  • Use hash of pom.xml for cache key

  • Provide OS-scoped restore keys


Diagram Walkthrough

flowchart LR
  setupJava["Setup Java (actions/setup-java@v4)"] -- "Maven cache disabled" --> cacheStep["Cache Maven (actions/cache@v4)"]
  cacheStep -- "Restore ~/.m2 by keys" --> buildSteps["Build/Test/Validate steps"]
Loading

File Walkthrough

Relevant files
Enhancement
7 files
action.yml
Add Maven cache step to build-image                                           
+8/-0     
action.yml
Add Maven cache step to redeploy                                                 
+8/-0     
action.yml
Cache Maven dependencies before backend pre-tests               
+8/-0     
action.yml
Cache Maven dependencies before backend tests                       
+8/-0     
action.yml
Cache Maven dependencies before frontend pre-tests             
+8/-0     
action.yml
Cache Maven dependencies before frontend tests                     
+8/-0     
action.yml
Cache Maven dependencies before DB validation                       
+8/-0     

@github-actions
Copy link
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Redundant Caching

Both actions/setup-java and actions/cache are configured to cache Maven; this duplication may cause non-deterministic cache behavior or unnecessary steps. Consider removing setup-java's internal cache when using actions/cache explicitly.

  uses: actions/setup-java@v4
  with:
    distribution: "temurin"
    java-version: "25"
    cache: "maven"

- name: Cache Maven packages
  uses: actions/cache@v4
  with:
    path: ~/.m2/repository
    key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
    restore-keys: |
      ${{ runner.os }}-maven-

- name: Expose GitHub Runtime
Cache Key Specificity

The cache key only hashes pom.xml files; if repositories reference settings.xml, profiles, or Maven wrapper config affecting dependencies, cache may become stale or incorrect. Consider including relevant files (e.g., **/pom.xml, */mvnw, **/.mvn/wrapper/maven-wrapper.properties, settings.xml).

- name: Cache Maven packages
  uses: actions/cache@v4
  with:
    path: ~/.m2/repository
    key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
    restore-keys: |
      ${{ runner.os }}-maven-
OS-Scoped Restore Keys

The restore-keys are OS-scoped, which is good, but ensure runners never switch architectures (x64/arm64) across jobs; otherwise cache mismatches may occur. Consider including runner.arch in key if mixed architectures are used.

- name: Cache Maven packages
  uses: actions/cache@v4
  with:
    path: ~/.m2/repository
    key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
    restore-keys: |
      ${{ runner.os }}-maven-

@tahminator
Copy link
Owner Author

/review

@tahminator
Copy link
Owner Author

/review

@tahminator
Copy link
Owner Author

/review

@tahminator
Copy link
Owner Author

/review

@tahminator
Copy link
Owner Author

/review

@github-actions
Copy link
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Cache Key Scope

The cache key uses ${{ github.job }}-${{ hashFiles('**/pom.xml') }}, which fragments cache per job. Consider a broader, stable prefix (e.g., ${{ runner.os }}-maven-) and adding restore-keys to improve hit rates across jobs.

- name: Cache Maven packages
  uses: actions/cache@v5
  with:
    path: |
      ~/.m2
      ~/repository
    key: ${{ github.job }}-${{ hashFiles('**/pom.xml') }}
Cache Paths

Caching both ~/.m2 and ~/repository may be redundant or incorrect; Maven local repo is typically ~/.m2/repository. Align paths with intended target to avoid unnecessary cache size and misses.

path: |
  ~/.m2
  ~/repository
key: ${{ github.job }}-${{ hashFiles('**/pom.xml') }}
Behavior Change

Switching to postgres:16-alpine changes runtime libraries and startup behavior; verify local dev parity with CI/prod images and ensure any alpine-specific differences (e.g., musl, extensions) are acceptable.

postgres:16-alpine`;

@codecov
Copy link

codecov bot commented Jan 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

2 participants