The GitHub Actions job "CI" on grails-core.git/grails8-groovy5-sb4 has failed.
Run started by GitHub user jamesfredley (triggered by jamesfredley).

Head commit for run:
f408b2f542befd4df81356b4f585f3e629c39bf7 / James Fredley 
<[email protected]>
Derive Apache Groovy joint branch from dependencies.gradle

The `CI - Groovy Joint Validation Build` workflow previously checked
out the Apache Groovy `GROOVY_4_0_X` branch unconditionally, then
rewrote this repo's `dependencies.gradle` with the resulting
`groovyVersion` snapshot. That worked for 7.0.x/8.0.x while both
targeted Groovy 4, but it permanently reds any branch that upgrades
Grails to Groovy 5 (such as PR #15557), because the workflow force-
downgrades the build back to Groovy 4 and a Grails 8 + Groovy 5
codebase cannot be compiled against it (Spock `groovy-5` artefacts
mismatch, module conflicts like "groovy-xml loaded in 5.0.3 but
trying to load 4.0.32-SNAPSHOT", and Groovy-5-only language
features fail to resolve).

Instead of hard-coding the Apache Groovy branch, derive it from the
branch's own `dependencies.gradle`:

- Extend the initial sparse checkout to include `dependencies.gradle`
  alongside `settings.gradle`.
- Add a "Derive matching Apache Groovy branch" step that extracts
  the major version from the existing `'groovy.version'` entry
  ('5.0.5' -> '5', '4.0.31' -> '4') and outputs
  `GROOVY_<major>_0_X` as the target Apache Groovy branch.
- Replace the hard-coded `git clone ... -b GROOVY_4_0_X` step with
  `git clone ... -b ${{ steps.groovy-branch.outputs.value }}`.
- Fail fast with `::error::` if the version cannot be parsed,
  rather than silently cloning a non-existent branch.

As a result:

- `7.0.x` PRs continue to clone `GROOVY_4_0_X` (unchanged behaviour).
- `8.0.x` on its current HEAD (still Groovy 4.0.31) continues to
  clone `GROOVY_4_0_X`.
- PR branches like `grails8-groovy5-sb4` that bump `groovy.version`
  to 5.x automatically clone `GROOVY_5_0_X` and validate against the
  matching Apache Groovy development line.
- Any future bump to Groovy 6 picks up `GROOVY_6_0_X` automatically
  without another workflow change.

Verified the extraction regex with four cases (4.0.31, 5.0.5, 6.0.0,
and a defensive 10.0.0 double-digit major) -- all map to the correct
GROOVY_<major>_0_X branch. The upstream `apache/groovy` repo has a
live `GROOVY_5_0_X` branch confirmed via the GitHub API, so the
clone will succeed on Groovy-5 PRs.

Assisted-by: claude-code:claude-opus-4-7

Report URL: https://github.com/apache/grails-core/actions/runs/24531825911

With regards,
GitHub Actions via GitBox

Reply via email to