diff --git a/.agents/skills/grails-developer/SKILL.md b/.agents/skills/grails-developer/SKILL.md index 00a6728513f..e004968c26c 100644 --- a/.agents/skills/grails-developer/SKILL.md +++ b/.agents/skills/grails-developer/SKILL.md @@ -1,28 +1,13 @@ - --- name: grails-developer description: Comprehensive guide for Grails 7 development, covering web applications, REST APIs, GORM, controllers, services, views, plugins, and testing with Spock and Geb license: Apache-2.0 -compatibility: opencode, claude, grok, gemini, copilot, cursor, windsurf -metadata: - audience: developers - frameworks: grails - versions: 7 --- + ## What I Do diff --git a/.agents/skills/groovy-developer/SKILL.md b/.agents/skills/groovy-developer/SKILL.md index 5931bf5add8..0b7feab35f9 100644 --- a/.agents/skills/groovy-developer/SKILL.md +++ b/.agents/skills/groovy-developer/SKILL.md @@ -1,29 +1,13 @@ - --- name: groovy-developer description: Expert guide for Groovy 4 development, covering concise syntax, closures, DSLs, metaprogramming, static compilation, and integration with Java 17 and Grails license: Apache-2.0 -compatibility: opencode, claude, grok, gemini, copilot, cursor, windsurf -metadata: - audience: developers - languages: groovy, java - versions: 4.0 - paradigms: dynamic, static, functional, object-oriented, DSL-oriented --- + ## What I Do diff --git a/.agents/skills/java-developer/SKILL.md b/.agents/skills/java-developer/SKILL.md index 0f8a9d163ac..94d7dc5b932 100644 --- a/.agents/skills/java-developer/SKILL.md +++ b/.agents/skills/java-developer/SKILL.md @@ -1,28 +1,13 @@ - --- name: java-developer description: Guide for developing in Java 17 LTS, including modern features, best practices, and integration with Groovy/Grails projects license: Apache-2.0 -compatibility: opencode, claude, grok, gemini, copilot, cursor, windsurf -metadata: - audience: developers - languages: java - versions: 17 --- + ## What I Do diff --git a/.agents/skills/test-fixer/SKILL.md b/.agents/skills/test-fixer/SKILL.md new file mode 100644 index 00000000000..a34ca8ccb71 --- /dev/null +++ b/.agents/skills/test-fixer/SKILL.md @@ -0,0 +1,142 @@ +--- +name: test-fixer +description: Guide for running, reviewing, and fixing test failures across grails-core modules using Gradle test reports +license: Apache-2.0 +--- + + +## What I Do + +- Guide targeted and full test runs across grails-core modules. +- Help interpret Gradle HTML and XML test reports. +- Help triage failing specs, static state pollution, and module-specific regressions. + +## When to Use Me + +Activate this skill when: + +- Running a failing module or specific spec. +- Preparing a commit and verifying affected module tests. +- Triaging regressions after a dependency upgrade or refactor. +- Reviewing aggregate test results from `:grails-test-report`. + +--- + +## Key Tasks + +### Targeted Testing Recommended + +To save time, run only related tests: + +```bash +./gradlew :grails-data-hibernate7-core:test --tests "grails.gorm.tests.BasicCollection*" +``` + +### Full Run + +```bash +./gradlew test --continue +``` + +Use `--continue` when you need later modules to run after an earlier module fails. + +--- + +## Aggregate Test Reports + +The `grails-test-report` project owns repository test aggregation. + +```bash +./gradlew :grails-test-report:check --continue +``` + +This generates: + +- Unit HTML: `grails-test-report/build/reports/tests/test/index.html` +- Unit Markdown: `grails-test-report/build/reports/tests/test.md` +- Integration HTML: `grails-test-report/build/reports/tests/integrationTest/index.html` +- Integration Markdown: `grails-test-report/build/reports/tests/integrationTest.md` +- Combined HTML: `grails-test-report/build/reports/tests/combined/index.html` +- Combined Markdown: `grails-test-report/build/reports/tests/combined.md` + +The aggregate report includes root subprojects that define matching `test` or `integrationTest` tasks. + +The collected unit and integration `Test` tasks are finalized by their matching aggregate report tasks. Reports are attempted after failures and after targeted module test runs, but they summarize the XML results currently available on disk. Use `--continue` for full-suite runs so Gradle keeps scheduling later test tasks after an earlier failure; without it, reports can be partial. Run `clean` first when stale XML results should be excluded. + +--- + +## Running Tests for a Specific Module + +```bash +# All tests in a module +./gradlew :grails-data-hibernate7-dbmigration:test + +# A specific spec +./gradlew :grails-data-hibernate7-dbmigration:test \ + --tests "org.grails.plugins.databasemigration.command.DbmGenerateGormChangelogCommandSpec" + +# A specific feature method +./gradlew :grails-data-hibernate7-core:test \ + --tests "org.grails.orm.hibernate.FooSpec.my feature name" + +# Force rerun even if Gradle thinks it is up-to-date +./gradlew :grails-data-hibernate7-core:test --rerun-tasks +``` + +--- + +## Test Source Layout + +| Source set | Directory | Task | +|------------|-----------|------| +| Unit tests | `src/test/groovy/` | `test` | +| Integration tests | `src/integration-test/groovy/` | `integrationTest` | + +Most specs in grails-core are unit tests (`src/test/groovy/`) run by the `test` task. A small number of modules use `integrationTest` for full Spring context tests. + +--- + +## Parallel Test Execution + +Tests run in parallel (`maxParallelForks` defaults to `4` on CI and to `availableProcessors * 3/4` otherwise; override with `-PmaxTestParallel`). This can cause: + +- Static state pollution: one test mutating a static field that another test reads. +- Port conflicts: multiple test JVMs binding the same port. +- `@Shared` field contamination: shared state not properly cleaned up between feature methods. + +To diagnose flaky failures, rerun with forced serial execution: + +```bash +./gradlew :module:test -PmaxTestParallel=1 --rerun-tasks +``` + +--- + +## Test Configuration Flags + +| Property | Effect | +|----------|--------| +| `skipTests` | Skips all `Test` tasks (build only) | +| `maxTestParallel=N` | Override parallel fork count | +| `onlyFunctionalTests` | Run only functional test suites | +| `skipHibernate7Tests` | Skip H7-specific test suites | +| `onlyMongodbTests` | Run only MongoDB test suites | +| `onlyCoreTests` | Run only core module tests | + +--- + +## XML Report Location + +Gradle writes JUnit XML test results to: + +```text +/build/test-results/ +├── test/ +│ └── TEST-org.grails.SomeSpec.xml +└── integrationTest/ + └── TEST-org.grails.SomeIntegrationSpec.xml +``` diff --git a/.agents/skills/violation-fixer/SKILL.md b/.agents/skills/violation-fixer/SKILL.md new file mode 100644 index 00000000000..07ed784d355 --- /dev/null +++ b/.agents/skills/violation-fixer/SKILL.md @@ -0,0 +1,231 @@ +--- +name: violation-fixer +description: Guide for running, interpreting, and fixing code style and analysis violations in grails-core using GrailsCodeStylePlugin, GrailsCodeAnalysisPlugin, and GrailsViolationAggregationPlugin — covering CodeNarc, Checkstyle, PMD, SpotBugs, and JaCoCo +license: Apache-2.0 +--- + + +## What I Do + +- Explain how `GrailsCodeStylePlugin`, `GrailsCodeAnalysisPlugin`, and `GrailsViolationAggregationPlugin` enforce code quality across all 60+ modules. +- Guide you through running style and analysis checks, interpreting the per-tool Markdown violation reports, and fixing each class of violation. +- Describe which tools are always-on vs. opt-in, how to configure them via Gradle properties, and which violations can be auto-fixed. + +## When to Use Me + +Activate this skill when: + +- Running `./gradlew aggregateViolations` and interpreting the resulting `*_VIOLATIONS.md` files. +- Fixing CodeNarc, Checkstyle, PMD, SpotBugs, or Spotless violations reported in those files. +- Configuring code style or analysis tools across the repo (enabling/disabling tools or adjusting rule files). +- Preparing a commit — the plugin output must be clean before merging. + +--- + +## Plugin Overview + +| Plugin | Applied to | Responsibility | +|--------|-----------|----------------| +| `org.apache.grails.gradle.grails-code-style` | Every subproject | Applies Checkstyle and CodeNarc; registers per-project `codeStyle` task; redirects XML reports to root `build/reports/codestyle/` | +| `org.apache.grails.gradle.grails-code-analysis` | Every subproject | Applies PMD and SpotBugs (both opt-in); registers per-project `codeAnalysis` task; redirects XML reports to root `build/reports/codestyle/` | +| `org.apache.grails.gradle.grails-jacoco` | Every subproject | Applies JaCoCo; wires `jacocoTestReport` to run after each `test` task | +| `org.apache.grails.gradle.grails-violation-aggregation` | **Root project only** | Registers `aggregateViolations` and `aggregateJacocoCoverage` tasks; writes Markdown summaries to `build/reports/violations/` | + +--- + +## Key Tasks + +| Task | Scope | Description | +|------|-------|-------------| +| `./gradlew codeStyle` | per-project | Runs Checkstyle and CodeNarc for that project | +| `./gradlew codeAnalysis` | per-project | Runs PMD and/or SpotBugs for that project (when enabled) | +| `./gradlew aggregateViolations` | root | Runs all checks across every module, then writes `*_VIOLATIONS.md` to `build/reports/violations/` | +| `./gradlew aggregateJacocoCoverage` | root | Runs JaCoCo reports across every module, then writes `JACOCO_COVERAGE.md` to `build/reports/violations/` | +| `./gradlew codenarcFix` | per-project | Auto-fixes a subset of CodeNarc violations | + +### Quick commands + +```bash +# Check a single module (style only) +./gradlew :grails-core:codeStyle + +# Check a single module (analysis — must be enabled via properties) +./gradlew :grails-core:codeAnalysis -Pgrails.codeanalysis.enabled.pmd=true + +# Full multi-module check + report +./gradlew aggregateViolations + +# Include test sources in style checks +./gradlew aggregateViolations -Pgrails.codestyle.enabled.tests=true + +# Include test sources in analysis +./gradlew aggregateViolations -Pgrails.codeanalysis.enabled.tests=true + +# Ignore failures (collect reports without failing the build) +./gradlew aggregateViolations -Pgrails.codestyle.ignoreFailures=true -Pgrails.codeanalysis.ignoreFailures=true + +# Auto-fix some CodeNarc violations before running checks +./gradlew codenarcFix codeStyle + +# JaCoCo coverage report +./gradlew aggregateJacocoCoverage +``` + +--- + +## Output Files + +After running `aggregateViolations`, these files appear under `build/reports/violations/` in the **root project build directory**: + +| File | Tool | Always generated | +|------|------|-----------------| +| `build/reports/violations/CODENARC_VIOLATIONS.md` | CodeNarc | Yes | +| `build/reports/violations/CHECKSTYLE_VIOLATIONS.md` | Checkstyle | Yes | +| `build/reports/violations/PMD_VIOLATIONS.md` | PMD | Yes — contains `No violations found!` when PMD is disabled | +| `build/reports/violations/SPOTBUGS_VIOLATIONS.md` | SpotBugs | Yes — contains `No violations found!` when SpotBugs is disabled | + +After running `aggregateJacocoCoverage`: + +| File | Tool | Generated | +|------|------|-----------| +| `build/reports/violations/JACOCO_COVERAGE.md` | JaCoCo | Only when at least one subproject has a JaCoCo CSV report | + +All reports are inside `build/` and are excluded from version control via `.gitignore`. A clean run produces `No violations found! 🎉` in each style file. **The build must be clean before committing.** + +Each file is a Markdown table grouped by module, with columns: **Class**, **Tool**, **Violation**, **Line**, **Message**. + +--- + +## Tool Details + +### CodeNarc (Groovy — always enabled) + +Rule file: `build/codestyle/codenarc/codenarc.groovy` (generated by the plugin during setup; not intended to be edited directly). + +Most common violations and how to fix them: + +| Rule | Fix | +|------|-----| +| `UnnecessaryGString` | Replace `"plain string"` with `'plain string'` | +| `UnnecessarySemicolon` | Remove trailing `;` | +| `SpaceBeforeOpeningBrace` | Add space before `{` → `method() {` | +| `SpaceAroundMapEntryColon` | `[key: value]` not `[key:value]` | +| `ConsecutiveBlankLines` | Collapse 3+ blank lines to 2 | +| `ClassStartsWithBlankLine` | Remove blank line right after `class Foo {` | +| `NoWildcardImports` | Expand `import org.foo.*` to explicit imports | +| `UnusedImport` | Remove imports not referenced in the file | +| `MethodName` | Method names must be camelCase (not `snake_case`) | +| `VariableName` | Variable names must be camelCase | +| `LineLength` | Keep lines ≤ 200 chars (default) | + +Auto-fixable via `codenarcFix`: `ClassStartsWithBlankLine`, `SpaceAroundMapEntryColon`, `UnnecessaryGString`, `UnnecessarySemicolon`, `SpaceBeforeOpeningBrace`, `ConsecutiveBlankLines`. + +### Checkstyle (Java — always enabled) + +Rule file: `build/codestyle/checkstyle/checkstyle.xml`. + +Common violations: + +| Rule | Fix | +|------|-----| +| `ImportOrder` | Re-order imports: `java|javax`, then `groovy`, then `jakarta`, then blank, then `io.spring|org.springframework`, then `grails|org.apache.grails|org.grails`, then static imports | +| `AvoidStarImport` | Use explicit class imports | +| `UnusedImports` | Remove unused imports | +| `WhitespaceAround` | Add spaces around operators and keywords | +| `NeedBraces` | Add `{}` to single-statement `if`/`for`/`while` | +| `FileTabCharacter` | Replace tabs with 4 spaces | +| `NewlineAtEndOfFile` | Ensure file ends with `\n` | + +### PMD (Java/Groovy — opt-in) + +Enable: `-Pgrails.codeanalysis.enabled.pmd=true` + +Rule file: `build/codeanalysis/pmd/pmd.xml`. + +### SpotBugs (Java bytecode — opt-in) + +Enable: `-Pgrails.codeanalysis.enabled.spotbugs=true` + +Runs at `Effort.MAX` / `Confidence.HIGH`. Only high-confidence bugs are reported. + +### Spotless (Java auto-formatting — opt-in) + +Enable: `-Pgrails.codestyle.enabled.spotless=true` + +Uses Palantir Java Format. Can auto-fix by running: +```bash +./gradlew spotlessApply +``` + +--- + +## Configuration Properties + +All properties can be set in `gradle.properties` or passed as `-P` flags: + +### `grails-code-style` plugin (Checkstyle + CodeNarc) + +| Property | Default | Description | +|----------|---------|-------------| +| `grails.codestyle.enabled.checkstyle` | `true` | Enable Checkstyle | +| `grails.codestyle.enabled.codenarc` | `true` | Enable CodeNarc | +| `grails.codestyle.enabled.spotless` | `false` | Enable Spotless | +| `grails.codestyle.enabled.tests` | `false` | Also check test source sets | +| `grails.codestyle.ignoreFailures` | `false` | Collect reports without failing build | +| `grails.codestyle.codenarc.fix` | `false` | Run `codenarcFix` before CodeNarc tasks | +| `grails.codestyle.dir.checkstyle` | (auto) | Custom path to Checkstyle config dir | +| `grails.codestyle.dir.codenarc` | (auto) | Custom path to CodeNarc config dir | +| `skipCodeStyle` | unset | If present, all style tasks are skipped | + +### `grails-code-analysis` plugin (PMD + SpotBugs) + +| Property | Default | Description | +|----------|---------|-------------| +| `grails.codeanalysis.enabled.pmd` | `false` | Enable PMD | +| `grails.codeanalysis.enabled.spotbugs` | `false` | Enable SpotBugs | +| `grails.codeanalysis.enabled.tests` | `false` | Also analyse test source sets | +| `grails.codeanalysis.ignoreFailures` | `false` | Collect reports without failing build | +| `grails.codeanalysis.dir.pmd` | (auto) | Custom path to PMD config dir | +| `skipCodeStyle` | unset | If present, all analysis tasks are also skipped | + +--- + +## Fixing Violations Workflow + +1. Run `./gradlew aggregateViolations -Pgrails.codestyle.ignoreFailures=true -Pgrails.codeanalysis.ignoreFailures=true` +2. Open `build/reports/violations/CODENARC_VIOLATIONS.md` and `build/reports/violations/CHECKSTYLE_VIOLATIONS.md` to see all issues by module +3. For CodeNarc, run `./gradlew codenarcFix` to auto-fix what it can +4. Fix remaining violations manually using the table above +5. Re-run `./gradlew aggregateViolations` and confirm files contain `No violations found! 🎉` +6. The reports are inside `build/` and do not need to be deleted before committing + +--- + +## Reports Directory Structure + +All XML reports are consolidated at: +``` +build/reports/codestyle/ ← XML inputs for style aggregation +├── checkstyle/ +│ ├── grails-core-checkstyleMain.xml +│ ├── grails-web-mvc-checkstyleMain.xml +│ └── ... +├── codenarc/ +│ ├── grails-core-codenarcMain.xml +│ └── ... +├── pmd/ (if enabled) +└── spotbugs/ (if enabled) + +build/reports/violations/ ← Markdown summaries written by aggregateViolations +├── CODENARC_VIOLATIONS.md +├── CHECKSTYLE_VIOLATIONS.md +├── PMD_VIOLATIONS.md +├── SPOTBUGS_VIOLATIONS.md +└── JACOCO_COVERAGE.md ← written by aggregateJacocoCoverage +``` + +The module name is derived from the filename: everything before the last `-` (e.g. `grails-core-checkstyleMain.xml` → module `grails-core`). diff --git a/.editorconfig b/.editorconfig index 4c509b592c4..fc99647e201 100644 --- a/.editorconfig +++ b/.editorconfig @@ -23,4 +23,5 @@ indent_size = 4 indent_style = space insert_final_newline = true spaces_around_operators = true -wildcard_import_limit = 999 \ No newline at end of file +wildcard_import_limit = 999 +imports_layout = java.**, |, javax.**, |, groovy.**, org.apache.groovy.**, org.codehaus.groovy.**, |, jakarta.**, |, *, |, io.spring.**, org.springframework.**, |, grails.**, org.apache.grails.**, org.grails.**, |, $* \ No newline at end of file diff --git a/.github/workflows/codeanalysis.yml b/.github/workflows/codeanalysis.yml new file mode 100644 index 00000000000..f9d08fe5f2f --- /dev/null +++ b/.github/workflows/codeanalysis.yml @@ -0,0 +1,95 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: "Code Analysis" +on: + push: + branches: + - '[0-9]+.[0-9]+.x' + - '8.0.x-hibernate7.*' + pull_request: + workflow_dispatch: +# queue jobs and only allow 1 run per branch due to the likelihood of hitting GitHub resource limits +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} +jobs: + check_core_projects: + name: "Core Projects" + runs-on: ubuntu-24.04 + steps: + - name: "🌐 Output Agent IP" # in the event RAO blocks this agent, this can be used to debug it + run: curl -s https://api.ipify.org + - name: "📥 Checkout repository" + uses: actions/checkout@v6 + - name: "☕️ Setup JDK" + uses: actions/setup-java@v4 + with: + distribution: liberica + java-version: 21 + - name: "🐘 Setup Gradle" + uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0 + with: + develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }} + - name: "🔎 Check Core Projects" + run: ./gradlew aggregateAnalysisViolations --continue + - name: "📤 Upload Reports" + if: always() + uses: actions/upload-artifact@v7.0.1 + with: + name: core-reports + path: build/reports/violations/ + - name: "📋 Publish Code Analysis Report in Job Summary" + if: always() + run: | + echo "## 🔎 Code Analysis Report - Core Projects" >> $GITHUB_STEP_SUMMARY + for report in PMD_VIOLATIONS.md SPOTBUGS_VIOLATIONS.md; do + file="build/reports/violations/$report" + [ -f "$file" ] && cat "$file" >> $GITHUB_STEP_SUMMARY || true + done + check_gradle_plugin_projects: + name: "Gradle Plugin Projects" + runs-on: ubuntu-24.04 + steps: + - name: "🌐 Output Agent IP" # in the event RAO blocks this agent, this can be used to debug it + run: curl -s https://api.ipify.org + - name: "📥 Checkout repository" + uses: actions/checkout@v6 + - name: "☕️ Setup JDK" + uses: actions/setup-java@v4 + with: + distribution: liberica + java-version: 21 + - name: "🐘 Setup Gradle" + uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0 + with: + develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }} + - name: "🔎 Check Gradle Plugin Projects" + working-directory: grails-gradle + run: ./gradlew aggregateAnalysisViolations --continue + - name: "📤 Upload Reports" + if: always() + uses: actions/upload-artifact@v7.0.1 + with: + name: gradle-plugin-reports + path: grails-gradle/build/reports/violations/ + - name: "📋 Publish Code Analysis Report in Job Summary" + if: always() + run: | + echo "## 🔎 Code Analysis Report - Gradle Plugin Projects" >> $GITHUB_STEP_SUMMARY + for report in PMD_VIOLATIONS.md SPOTBUGS_VIOLATIONS.md; do + file="grails-gradle/build/reports/violations/$report" + [ -f "$file" ] && cat "$file" >> $GITHUB_STEP_SUMMARY || true + done diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index ef4cb95ae2b..afebcffa9d4 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -30,10 +30,12 @@ on: push: branches: - '[4-9]+.[0-9]+.x' + - '8.0.x-hibernate7.*' pull_request: # The branches below must be a subset of the branches above branches: - '[4-9]+.[0-9]+.x' + - '8.0.x-hibernate7.*' # queue jobs and only allow 1 run per branch due to the likelihood of hitting GitHub resource limits concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml index 4a3663fea1e..cb4abe4ec8d 100644 --- a/.github/workflows/codestyle.yml +++ b/.github/workflows/codestyle.yml @@ -18,6 +18,7 @@ on: push: branches: - '[0-9]+.[0-9]+.x' + - '8.0.x-hibernate7.*' pull_request: workflow_dispatch: # queue jobs and only allow 1 run per branch due to the likelihood of hitting GitHub resource limits @@ -43,27 +44,23 @@ jobs: with: develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }} - name: "🔎 Check Core Projects" - run: ./gradlew codeStyle - - name: "📤 Upload Failure Reports" + run: ./gradlew aggregateStyleViolations --continue + - name: "📤 Upload Reports" if: always() uses: actions/upload-artifact@v7.0.1 with: name: core-reports - path: build/reports/codestyle/ + path: build/reports/violations/ - name: "📋 Publish Code Style Report in Job Summary" if: always() run: | echo "## 🔎 Code Style Report - Core Projects" >> $GITHUB_STEP_SUMMARY - for file in build/reports/codestyle/checkstyle/*.xml build/reports/codestyle/codenarc/*.xml; do - [ -f "$file" ] || continue - if grep -q "> $GITHUB_STEP_SUMMARY - grep "> $GITHUB_STEP_SUMMARY - grep "> $GITHUB_STEP_SUMMARY - fi + for report in CODENARC_VIOLATIONS.md CHECKSTYLE_VIOLATIONS.md; do + file="build/reports/violations/$report" + [ -f "$file" ] && cat "$file" >> $GITHUB_STEP_SUMMARY || true done - check_gradle_plugin_projects: - name: "Gradle Plugin Projects" + check_forge_projects: + name: "Forge Projects" runs-on: ubuntu-24.04 steps: - name: "🌐 Output Agent IP" # in the event RAO blocks this agent, this can be used to debug it @@ -79,29 +76,25 @@ jobs: uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0 with: develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }} - - name: "🔎 Check Gradle Plugin Projects" - working-directory: grails-gradle - run: ./gradlew codeStyle - - name: "📤 Upload Failure Reports" + - name: "🔎 Check Forge Projects" + working-directory: grails-forge + run: ./gradlew aggregateStyleViolations --continue + - name: "📤 Upload Reports" if: always() uses: actions/upload-artifact@v7.0.1 with: - name: gradle-plugin-reports - path: grails-gradle/build/reports/codestyle/ + name: forge-reports + path: grails-forge/build/reports/violations/ - name: "📋 Publish Code Style Report in Job Summary" if: always() run: | - echo "## 🔎 Code Style Report - Gradle Plugin Projects" >> $GITHUB_STEP_SUMMARY - for file in grails-gradle/build/reports/codestyle/checkstyle/*.xml grails-gradle/build/reports/codestyle/codenarc/*.xml; do - [ -f "$file" ] || continue - if grep -q "> $GITHUB_STEP_SUMMARY - grep "> $GITHUB_STEP_SUMMARY - grep "> $GITHUB_STEP_SUMMARY - fi + echo "## 🔎 Code Style Report - Forge Projects" >> $GITHUB_STEP_SUMMARY + for report in CODENARC_VIOLATIONS.md CHECKSTYLE_VIOLATIONS.md; do + file="grails-forge/build/reports/violations/$report" + [ -f "$file" ] && cat "$file" >> $GITHUB_STEP_SUMMARY || true done - check_grails_forge_projects: - name: "Forge Projects" + check_gradle_plugin_projects: + name: "Gradle Plugin Projects" runs-on: ubuntu-24.04 steps: - name: "🌐 Output Agent IP" # in the event RAO blocks this agent, this can be used to debug it @@ -117,24 +110,20 @@ jobs: uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0 with: develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }} - - name: "🔎 Check Forge Projects" - working-directory: grails-forge - run: ./gradlew codeStyle - - name: "📤 Upload Failure Reports" + - name: "🔎 Check Gradle Plugin Projects" + working-directory: grails-gradle + run: ./gradlew aggregateStyleViolations --continue + - name: "📤 Upload Reports" if: always() uses: actions/upload-artifact@v7.0.1 with: - name: forge-reports - path: grails-forge/build/reports/codestyle/ + name: gradle-plugin-reports + path: grails-gradle/build/reports/violations/ - name: "📋 Publish Code Style Report in Job Summary" if: always() run: | - echo "## 🔎 Code Style Report - Forge Projects" >> $GITHUB_STEP_SUMMARY - for file in grails-forge/build/reports/codestyle/checkstyle/*.xml grails-forge/build/reports/codestyle/codenarc/*.xml; do - [ -f "$file" ] || continue - if grep -q "> $GITHUB_STEP_SUMMARY - grep "> $GITHUB_STEP_SUMMARY - grep "> $GITHUB_STEP_SUMMARY - fi - done \ No newline at end of file + echo "## 🔎 Code Style Report - Gradle Plugin Projects" >> $GITHUB_STEP_SUMMARY + for report in CODENARC_VIOLATIONS.md CHECKSTYLE_VIOLATIONS.md; do + file="grails-gradle/build/reports/violations/$report" + [ -f "$file" ] && cat "$file" >> $GITHUB_STEP_SUMMARY || true + done diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 8132d637e28..bfb2e28f1cc 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -18,6 +18,7 @@ on: push: branches: - '[0-9]+.[0-9]+.x' + - '8.0.x-hibernate7.*' pull_request: workflow_dispatch: # Queue jobs - cancel in-progress PR runs when new commits pushed, but allow branch builds to complete @@ -267,6 +268,7 @@ jobs: -PonlyFunctionalTests -PskipCodeStyle -PskipHibernate5Tests + -PskipHibernate7Tests -PskipMongodbTests mongodbFunctional: if: ${{ !contains(github.event.head_commit.message, '[skip tests]') }} @@ -345,6 +347,43 @@ jobs: -PgrailsIndy=${{ matrix.indy }} -PonlyHibernate5Tests -PskipCodeStyle + hibernate7Functional: + if: ${{ !contains(github.event.head_commit.message, '[skip tests]') }} + name: "Hibernate7 Functional Tests (Java ${{ matrix.java }}, indy=${{ matrix.indy }})" + runs-on: ubuntu-24.04 + strategy: + fail-fast: false + matrix: + java: [ 21, 25 ] + indy: [ false ] + include: + - java: 21 + indy: true + steps: + - name: "Output Agent IP" # in the event RAO blocks this agent, this can be used to debug it + run: curl -s https://api.ipify.org + - name: "📥 Checkout the repository" + uses: actions/checkout@v6 + - name: "☕️ Setup JDK" + uses: actions/setup-java@v4 + with: + distribution: liberica + java-version: ${{ matrix.java }} + - name: "🐘 Setup Gradle" + uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0 + with: + develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }} + - name: "🏃 Run Functional Tests" + env: + GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} + run: > + ./gradlew bootJar check + --continue + --rerun-tasks + --stacktrace + -PgrailsIndy=${{ matrix.indy }} + -PonlyHibernate7Tests + -PskipCodeStyle publishGradle: if: github.repository_owner == 'apache' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') needs: [ buildGradle ] diff --git a/.github/workflows/groovy-joint-workflow.yml b/.github/workflows/groovy-joint-workflow.yml index 6ad2ec94f36..f438a3b0da4 100644 --- a/.github/workflows/groovy-joint-workflow.yml +++ b/.github/workflows/groovy-joint-workflow.yml @@ -17,10 +17,12 @@ name: "CI - Groovy Joint Validation Build" on: push: branches: - - '[4-9]+.[0-9]+.x' + - '[0-9]+.[0-9]+.x' + - '8.0.x-hibernate7.*' pull_request: branches: - - '[4-9]+.[0-9]+.x' + - '[0-9]+.[0-9]+.x' + - '8.0.x-hibernate7.*' workflow_dispatch: # queue jobs and only allow 1 run per branch due to the likelihood of hitting GitHub resource limits concurrency: @@ -123,7 +125,6 @@ jobs: run: | cd groovy ./gradlew pTML -x groovydoc -x javadoc -x javadocAll -x groovydocAll -x asciidoc -x docGDK - build_grails: needs: [build_groovy] runs-on: ubuntu-latest diff --git a/.github/workflows/rat.yml b/.github/workflows/rat.yml index c7e3a6072b9..b593e140861 100644 --- a/.github/workflows/rat.yml +++ b/.github/workflows/rat.yml @@ -17,14 +17,12 @@ name: "Licensing - RAT Report" on: push: branches: - - '[4-9]+.[0-9]+.x' - - '[3-9]+.[3-9]+.x' - - license-audit + - '[0-9]+.[0-9]+.x' + - '8.0.x-hibernate7.*' pull_request: branches: - - '[4-9]+.[0-9]+.x' - - '[3-9]+.[3-9]+.x' - - license-audit + - '[0-9]+.[0-9]+.x' + - '8.0.x-hibernate7.*' workflow_dispatch: # queue jobs and only allow 1 run per branch due to the likelihood of hitting GitHub resource limits concurrency: diff --git a/.gitignore b/.gitignore index ca770d0c557..46293f4418c 100644 --- a/.gitignore +++ b/.gitignore @@ -54,7 +54,10 @@ testWatchedFile.properties _alternativeTable.gsp **/src/en/ref/Versions/Grails BOM.adoc **/src/en/ref/Versions/Grails BOM Hibernate5.adoc +**/src/en/ref/Versions/Grails BOM Hibernate7.adoc **/src/en/ref/Versions/Grails BOM Micronaut.adoc +**/src/en/ref/Versions/Grails BOM Hibernate5 Micronaut.adoc +**/src/en/ref/Versions/Grails BOM Hibernate7 Micronaut.adoc **/src/en/ref/Configuration/Application Properties.adoc stacktrace.log target diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index ab13aa909ae..ce4b40f7953 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -54,6 +54,7 @@ +