Skip to content

Chore: reuse shared 'setup-gradle' in all places in test-code.yml#15043

Merged
Siedlerchr merged 3 commits intomainfrom
reuse-shared-setup-gradle
Feb 6, 2026
Merged

Chore: reuse shared 'setup-gradle' in all places in test-code.yml#15043
Siedlerchr merged 3 commits intomainfrom
reuse-shared-setup-gradle

Conversation

@jjohannes
Copy link
Copy Markdown
Collaborator

I noticed that there was one place in the GH actions setup where the ./.github/actions/setup-gradle is not used, but instead the gradle/actions/setup-gradle@v5 is used directly. I assume this is not intentional (?). This PR adjusts this one line in test-code.yml.

Steps to test

This is tested by the GH actions running on this PR.

Mandatory checks

  • I own the copyright of the code submitted and I license it under the MIT license

/

@qodo-free-for-open-source-projects
Copy link
Copy Markdown
Contributor

Review Summary by Qodo

Reuse shared setup-gradle action in test-code workflow

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Consolidate Gradle setup to use shared action
• Replace direct gradle/actions/setup-gradle with local wrapper
• Improve consistency across CI workflow
Diagram
flowchart LR
  A["test-code.yml workflow"] -- "previously used" --> B["gradle/actions/setup-gradle@v5"]
  A -- "now uses" --> C["./.github/actions/setup-gradle"]
  C -- "wraps" --> B
Loading

Grey Divider

File Changes

1. .github/workflows/tests-code.yml ⚙️ Configuration changes +1/-2

Replace direct Gradle action with shared wrapper

• Replaced direct gradle/actions/setup-gradle@v5 with local ./.github/actions/setup-gradle
 wrapper
• Removed explicit step name "Setup Gradle" for consistency
• Maintains same functionality while improving workflow consistency

.github/workflows/tests-code.yml


Grey Divider

Qodo Logo

@qodo-free-for-open-source-projects
Copy link
Copy Markdown
Contributor

qodo-free-for-open-source-projects Bot commented Feb 6, 2026

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Unpinned JBang action 🐞 Bug ⛨ Security
Description
• After switching to the composite ./.github/actions/setup-gradle, this job now runs
  jbangdev/setup-jbang@main.
• Referencing an external action by a moving branch (@main) is a supply-chain and reliability risk
  (upstream changes can break CI or introduce unexpected behavior).
• While this unpinned reference pre-exists in the composite action, this PR expands its usage to the
  requirements_coverage job, increasing the blast radius.
Code

.github/workflows/tests-code.yml[554]

+      - uses: ./.github/actions/setup-gradle
Evidence
The job now uses the composite action, and the composite action includes an unpinned external action
reference (@main). Therefore, the job inherits this risk as a direct consequence of the PR change.

.github/workflows/tests-code.yml[551-555]
.github/actions/setup-gradle/action.yml[39-40]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The composite action `./.github/actions/setup-gradle` uses `jbangdev/setup-jbang@main`, which is a moving target and creates supply-chain and CI stability risks. This PR makes `requirements_coverage` depend on that unpinned action.

### Issue Context
Even if the composite action is local, it still pulls and executes external actions. Pinning to a tag/SHA reduces risk and prevents unexpected breakages.

### Fix Focus Areas
- .github/actions/setup-gradle/action.yml[39-40]
- .github/workflows/tests-code.yml[551-555]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Redundant Java setup 🐞 Bug ⛯ Reliability
Suggestion Impact:The workflow’s explicit `Set up JDK` (`actions/setup-java@v5`) step was removed from `requirements_coverage`, leaving Java setup to be handled only by the `./.github/actions/setup-gradle` composite action and eliminating the duplicate Java configuration.

code diff:

-      - name: Set up JDK
-        uses: actions/setup-java@v5
-        with:
-          java-version: 25
-          distribution: 'corretto'
-          check-latest: true
       - uses: ./.github/actions/setup-gradle

Description
• The requirements_coverage job configures Java, then invokes ./.github/actions/setup-gradle,
  which configures Java again.
• This adds CI time and creates a maintenance trap: future changes to the job’s Java setup can be
  silently overridden by the composite action’s Java defaults (last setup-java wins).
• The PR change makes the job effectively depend on the composite action’s Java configuration rather
  than the job-local one.
Code

.github/workflows/tests-code.yml[R551-554]

          java-version: 25
          distribution: 'corretto'
          check-latest: true
-      - name: Setup Gradle
-        uses: gradle/actions/setup-gradle@v5
+      - uses: ./.github/actions/setup-gradle
Evidence
The job still contains an explicit actions/setup-java@v5 configuration, but after the PR change it
also calls a composite action that itself runs actions/setup-java@v5, resulting in two Java setups
in sequence.

.github/workflows/tests-code.yml[541-555]
.github/actions/setup-gradle/action.yml[17-25]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The `requirements_coverage` job runs `actions/setup-java` and then calls `./.github/actions/setup-gradle`, which also runs `actions/setup-java`. This duplicates work and can override the job’s intended Java settings.

### Issue Context
The PR replaced a direct `gradle/actions/setup-gradle@v5` step with the composite action. The composite action currently always sets up the JDK.

### Fix Focus Areas
- .github/workflows/tests-code.yml[548-555]
- .github/actions/setup-gradle/action.yml[14-40]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

check-latest: true
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
- uses: ./.github/actions/setup-gradle
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.

Action required

1. Unpinned jbang action 🐞 Bug ⛨ Security

• After switching to the composite ./.github/actions/setup-gradle, this job now runs
  jbangdev/setup-jbang@main.
• Referencing an external action by a moving branch (@main) is a supply-chain and reliability risk
  (upstream changes can break CI or introduce unexpected behavior).
• While this unpinned reference pre-exists in the composite action, this PR expands its usage to the
  requirements_coverage job, increasing the blast radius.
Agent Prompt
### Issue description
The composite action `./.github/actions/setup-gradle` uses `jbangdev/setup-jbang@main`, which is a moving target and creates supply-chain and CI stability risks. This PR makes `requirements_coverage` depend on that unpinned action.

### Issue Context
Even if the composite action is local, it still pulls and executes external actions. Pinning to a tag/SHA reduces risk and prevents unexpected breakages.

### Fix Focus Areas
- .github/actions/setup-gradle/action.yml[39-40]
- .github/workflows/tests-code.yml[551-555]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@jjohannes jjohannes requested a review from koppor February 6, 2026 07:10
@JabRef JabRef deleted a comment from testlens-app Bot Feb 6, 2026
Copy link
Copy Markdown
Member

@koppor koppor left a comment

Choose a reason for hiding this comment

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

Both work.... Here, I had speed in mind. However, consitency is maybe more important 😅

Copy link
Copy Markdown
Member

@koppor koppor left a comment

Choose a reason for hiding this comment

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

Neeed to address #15043 (comment)

@github-actions github-actions Bot added the status: changes-required Pull requests that are not yet complete label Feb 6, 2026
@testlens-app
Copy link
Copy Markdown

testlens-app Bot commented Feb 6, 2026

✅ All tests passed ✅

🏷️ Commit: 528e46b
▶️ Tests: 11185 executed
⚪️ Checks: 52/52 completed


Learn more about TestLens at testlens.app.

@jjohannes jjohannes requested a review from koppor February 6, 2026 08:54
@Siedlerchr Siedlerchr added this pull request to the merge queue Feb 6, 2026
@github-actions github-actions Bot added the status: to-be-merged PRs which are accepted and should go into the merge-queue. label Feb 6, 2026
Merged via the queue into main with commit 4a4e2c2 Feb 6, 2026
53 checks passed
@Siedlerchr Siedlerchr deleted the reuse-shared-setup-gradle branch February 6, 2026 10:52
Siedlerchr added a commit that referenced this pull request Feb 8, 2026
…es/jablib/src/main/resources/csl-styles-6c79ffe

* upstream/main: (68 commits)
  Chore(deps): Bump org.apache.httpcomponents.client5:httpclient5 (#15060)
  Chore(deps): Bump com.google.errorprone:error_prone_core in /versions (#15059)
  Chore(deps): Bump de.undercouch.download:de.undercouch.download.gradle.plugin (#15057)
  Chore(deps): Bump org.postgresql:postgresql in /versions (#15058)
  Chore(deps): Bump de.undercouch.download:de.undercouch.download.gradle.plugin (#15056)
  Updates on Wednesday, not on Sunday
  Add screenshot requirement (#15050)
  Switch image for javadoc
  Better docker layer caching during build (#15042)
  New Crowdin updates (#15045)
  Chore: reuse shared 'setup-gradle' in all places in test-code.yml (#15043)
  Chore: add 'testlens-app/setup-testlens' GH action (#15044)
  Add: HTTP Server and LSP server toggles to quick settings (#14972)
  Some more recipes from OpenRewrite (#15030)
  feat: Add PDF Upload endpoint to EntryResource (#14963)
  Heuristics also used at batch (#15025)
  Fix cleanup-pr.yml
  New Crowdin updates (#15035)
  Use patched Gradle version (#15034)
  Add OpenAlex-based Citation Fetcher (#15023)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: changes-required Pull requests that are not yet complete status: to-be-merged PRs which are accepted and should go into the merge-queue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants