Add template sync workflow, TEMPLATE_README, and warning comments#2
Open
sbglasius wants to merge 6 commits into
Open
Add template sync workflow, TEMPLATE_README, and warning comments#2sbglasius wants to merge 6 commits into
sbglasius wants to merge 6 commits into
Conversation
sbglasius
commented
May 13, 2026
Collaborator
- Add .github/workflows/files-sync.yml: syncs infrastructure files to registered plugin repos on release, using a GitHub App for cross-org write access (gpc + grails-plugins)
- Add .github/scripts/prepare-sync-matrix.groovy: builds GH Actions matrix from .github/projects.yml
- Add .github/projects.yml: registry of target repos for the sync
- Add TEMPLATE_README.md: guide for new plugins and migration path
- Prepend "do not edit" warning comments to all synced files (workflows, scripts, build-logic convention plugins)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Collaborator
Author
|
@jdaugherty @matrei the idea here is, that this template project will automatically make PRs on child projects (mentioned in .github/projects.yml) when a new version of the template project is released. |
81a9b5d to
4925253
Compare
6344062 to
6a3da24
Compare
* Missing codestyle and codecoverage added, fixing codenarc violations * correct plugin test task path and load project metadata in docs build * allow publish jobs for both grails-plugins and gpc orgs * Potential fix for pull request finding * correct contributor name typo and duplicated wording in docs * correct typo in documentation URL (templatae -> template)
- Add .github/workflows/files-sync.yml: syncs infrastructure files to registered plugin repos on release, using a GitHub App for cross-org write access (gpc + grails-plugins) - Add .github/scripts/prepare-sync-matrix.groovy: builds GH Actions matrix from .github/projects.yml - Add .github/projects.yml: registry of target repos for the sync - Add TEMPLATE_README.md: guide for new plugins and migration path - Prepend "do not edit" warning comments to all synced files (workflows, scripts, build-logic convention plugins) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
6a3da24 to
8e47cc4
Compare
There was a problem hiding this comment.
Pull request overview
This PR turns the repository into a reusable Grails plugin template with standardized Gradle multi-project structure, CI/release automation, and a new GitHub Actions workflow to sync “infrastructure” files into registered downstream plugin repos.
Changes:
- Adds a template file-sync workflow (
.github/workflows/files-sync.yml) plus registry/matrix tooling (.github/projects.yml,.github/scripts/prepare-sync-matrix.groovy). - Introduces a full multi-project Gradle layout (composite
build-logicconvention plugins,plugin/,docs/,examples/app1/,code-coverage/). - Adds template documentation and contributor guidance (
TEMPLATE_README.md, updated README/docs/skills/agents content).
Reviewed changes
Copilot reviewed 76 out of 95 changed files in this pull request and generated 19 comments.
Show a summary per file
| File | Description |
|---|---|
| TEMPLATE_README.md | New “how to use/migrate to template” guide. |
| settings.gradle | Defines composite build + multi-project structure and dependency resolution. |
| README.md | Repository overview + install snippet + docs link. |
| project.yml | Central metadata for publishing/docs/index generation. |
| plugin/src/main/groovy/grails/plugins/template/PluginTemplateGrailsPlugin.groovy | Adds a basic plugin descriptor class. |
| plugin/grails-app/conf/plugin.yml | Adds placeholder plugin config file. |
| plugin/build.gradle | Applies convention plugins + declares plugin dependencies. |
| plugin/grails-app/assets/stylesheets/export.css | Adds plugin CSS asset. |
| plugin/grails-app/assets/images/skin/readme.txt | Third-party icon attribution text. |
| plugin/grails-app/assets/images/skin/csv.png | Plugin asset image. |
| plugin/grails-app/assets/images/skin/excel.png | Plugin asset image. |
| plugin/grails-app/assets/images/skin/ods.png | Plugin asset image. |
| plugin/grails-app/assets/images/skin/pdf.png | Plugin asset image. |
| plugin/grails-app/assets/images/skin/rtf.png | Plugin asset image. |
| plugin/grails-app/assets/images/skin/xml.png | Plugin asset image. |
| plugin/grails-app/assets/images/skin/shadow.jpg | Plugin asset image. |
| LICENSE.txt | Adds Apache 2.0 license text. |
| gradlew | Adds Gradle wrapper script (POSIX). |
| gradlew.bat | Adds Gradle wrapper script (Windows). |
| gradle/wrapper/gradle-wrapper.properties | Pins Gradle distribution for wrapper. |
| gradle/wrapper/gradle-wrapper.jar | Wrapper jar artifact. |
| gradle.properties | Central version properties (Grails, tooling, build flags). |
| gradle/publish.gradle | Legacy publish script (currently appears unused). |
| gradle/documentation.gradle | Legacy docs script (currently appears unused). |
| build.gradle | Root build applying root-level convention plugins. |
| code-coverage/build.gradle | Declares aggregated coverage convention plugin usage. |
| build-logic/settings.gradle | Composite build settings for convention plugins. |
| build-logic/build.gradle | Convention-plugin build dependencies (yaml, Grails plugins, Asciidoctor, etc.). |
| build-logic/config/checkstyle/checkstyle.xml | Checkstyle configuration for the template. |
| build-logic/config/checkstyle/checkstyle-suppressions.xml | Checkstyle suppressions file (empty baseline). |
| build-logic/config/codenarc/codenarc.groovy | CodeNarc ruleset for Groovy sources. |
| build-logic/src/main/groovy/config.compile.gradle | Convention: Java/Groovy compile settings and Java version resolution from .sdkmanrc. |
| build-logic/src/main/groovy/config.testing.gradle | Convention: JUnit Platform + test-logger setup. |
| build-logic/src/main/groovy/config.grails-plugin.gradle | Convention: Grails plugin + asset pipeline setup. |
| build-logic/src/main/groovy/config.grails-assets.gradle | Convention: asset-pipeline webjars includes/excludes. |
| build-logic/src/main/groovy/config.example-app.gradle | Convention: example app plugins composition. |
| build-logic/src/main/groovy/config.docs.gradle | Convention: docs aggregation (Groovydoc + Asciidoctor). |
| build-logic/src/main/groovy/config.publish.gradle | Convention: publish metadata wiring from project.yml. |
| build-logic/src/main/groovy/config.publish-root.gradle | Root publish workaround (Nexus publish plugin issue). |
| build-logic/src/main/groovy/config.project-metadata.gradle | Loads project.yml into Gradle extra properties. |
| build-logic/src/main/groovy/config.code-style.gradle | Convention: Checkstyle + CodeNarc setup. |
| build-logic/src/main/groovy/config.code-coverage.gradle | Convention: JaCoCo unit/integration report wiring. |
| build-logic/src/main/groovy/config.code-coverage-aggregate.gradle | Convention: aggregate JaCoCo across subprojects. |
| build-logic/src/main/groovy/config.app-run.gradle | Convention: bootRun debug flags. |
| docs/build.gradle | Docs build using Asciidoctor + metadata. |
| docs/src/docs/index.adoc | Asciidoctor entrypoint. |
| docs/src/docs/index.tmpl | HTML template for gh-pages version index generation. |
| docs/src/docs/introduction.adoc | Introduction page composition. |
| docs/src/docs/introduction/license.adoc | License section. |
| docs/src/docs/introduction/acknowledgements.adoc | Contributors section. |
| docs/src/docs/introduction/sourceCode.adoc | Source/issues links section. |
| examples/app1/build.gradle | Example app build + dependency on the plugin-under-test. |
| examples/app1/grails-app/init/grails/plugins/template/Application.groovy | Example app entrypoint. |
| examples/app1/grails-app/controllers/grails/plugins/template/UrlMappings.groovy | Example app URL mappings. |
| examples/app1/grails-app/controllers/grails/plugins/template/TestController.groovy | Example controller scaffold. |
| examples/app1/grails-app/views/layouts/main.gsp | Example app layout. |
| examples/app1/grails-app/views/test/index.gsp | Example “welcome/status” view. |
| examples/app1/grails-app/conf/application.yml | Example app config (profile, mime types, datasource, etc.). |
| examples/app1/grails-app/conf/logback.xml | Example app logback config. |
| examples/app1/grails-app/assets/stylesheets/application.css | Asset-pipeline manifest for example app. |
| examples/app1/grails-app/assets/stylesheets/errors.css | Example app error styling. |
| examples/app1/grails-app/assets/stylesheets/grails.css | Example app scaffold table styling. |
| examples/app1/grails-app/assets/stylesheets/welcome.css | Example app UI styling (reload indicator, sorting hints). |
| examples/app1/grails-app/assets/images/grails.svg | UI icon asset. |
| examples/app1/grails-app/assets/images/spring.svg | UI icon asset. |
| examples/app1/grails-app/assets/images/spring-boot.svg | UI icon asset. |
| examples/app1/grails-app/assets/images/java.svg | UI icon asset. |
| examples/app1/grails-app/assets/images/groovy.svg | UI icon asset. |
| examples/app1/grails-app/assets/images/documentation.svg | UI icon asset. |
| examples/app1/grails-app/assets/images/community.svg | UI icon asset. |
| examples/app1/grails-app/assets/images/advancedgrails.svg | UI icon asset. |
| examples/app1/grails-app/assets/images/favicon.ico | Favicon asset. |
| CONTRIBUTING.md | Contributor guide (currently contains references to a different repo). |
| AGENTS.md | Agent guidance + repository rules. |
| .skills/repository-structure.md | “Canonical structure” skill doc. |
| .skills/plugin-project.md | Skill doc: plugin module scope rules. |
| .skills/example-apps.md | Skill doc: example apps + integration test patterns. |
| .skills/gradle-best-practices.md | Skill doc: convention plugins + lazy Gradle APIs. |
| .sdkmanrc | Pins Java/Gradle/Groovy toolchain versions. |
| .gitignore | Ignore rules for Gradle/IDEs/build artifacts. |
| .github/dependabot.yml | Dependabot configuration for Gradle + GitHub Actions. |
| .github/renovate.json | Renovate configuration and grouping rules. |
| .github/release-drafter.yml | Release Drafter configuration and auto-labeling. |
| .github/dependency-graph/external-references.yml | GitHub dependency graph external package association (Maven purl). |
| .github/projects.yml | Registry of downstream repos for file sync. |
| .github/scripts/update-versions.groovy | Updates project.yml versions based on gh-pages dirs; generates build/ghpages.html. |
| .github/scripts/update-contributors.groovy | Updates project.yml contributors via GitHub API/GraphQL. |
| .github/scripts/prepare-sync-matrix.groovy | Builds sync matrix JSON from .github/projects.yml. |
| .github/workflows/ci.yml | CI workflow for build/test + snapshot publish + docs deploy. |
| .github/workflows/release.yml | Multi-stage release workflow (stage, release, docs, bump). |
| .github/workflows/release-notes.yml | Release drafter automation workflow. |
| .github/workflows/update-contributors.yml | Workflow to update contributors block in project.yml. |
| .github/workflows/update-versions.yml | Workflow to update versions + gh-pages index. |
| .github/workflows/files-sync.yml | New workflow to sync infrastructure files into registered downstream repos. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| NONSTOP* ) nonstop=true ;; | ||
| esac | ||
|
|
||
| CLASSPATH="\\\"\\\"" |
Comment on lines
+39
to
+43
| include('plugin') | ||
| project(':plugin').name = 'grails-plugin-template' | ||
| include('docs') | ||
| project(':docs').name = 'grails-plugin-template-docs' | ||
| include('code-coverage') |
Comment on lines
+109
to
+133
| # Workflow files — exclude files-sync.yml (template-only) | ||
| mkdir -p target/.github/workflows/ | ||
| rsync -a --delete --exclude='files-sync.yml' \ | ||
| source/.github/workflows/ target/.github/workflows/ | ||
|
|
||
| # Scripts — exclude prepare-sync-matrix.groovy (template-only) | ||
| mkdir -p target/.github/scripts/ | ||
| rsync -a --exclude='prepare-sync-matrix.groovy' \ | ||
| source/.github/scripts/ target/.github/scripts/ | ||
|
|
||
| # GitHub config singles (lock-aware) | ||
| maybe_copy .github/dependabot.yml .github/dependabot.yml | ||
| maybe_copy .github/renovate.json .github/renovate.json | ||
| maybe_copy .github/release-drafter.yml .github/release-drafter.yml | ||
|
|
||
| # Directories | ||
| mkdir -p target/.github/dependency-graph/ | ||
| rsync -a source/.github/dependency-graph/ target/.github/dependency-graph/ | ||
| mkdir -p target/.skills/ | ||
| rsync -a --delete source/.skills/ target/.skills/ | ||
| mkdir -p target/build-logic/ | ||
| rsync -a source/build-logic/ target/build-logic/ | ||
| mkdir -p target/gradle/ | ||
| rsync -a source/gradle/ target/gradle/ | ||
|
|
| @@ -0,0 +1,162 @@ | |||
| # Contributing to Export | |||
Comment on lines
+24
to
+25
| git clone https://github.com/gpc/grails-export.git | ||
| cd export |
| ## Directory Layout | ||
|
|
||
| ``` | ||
| export/ |
Comment on lines
+26
to
+29
| include('plugin') | ||
| project(':plugin').name = 'grails-my-plugin' // artifact ID | ||
| include('docs') | ||
| project(':docs').name = 'grails-my-plugin-docs' |
Comment on lines
+103
to
+106
| include('plugin') | ||
| project(':plugin').name = 'grails-my-plugin' | ||
| include('docs') | ||
| project(':docs').name = 'grails-my-plugin-docs' |
Comment on lines
+21
to
+23
| projectUrl : "https://github.com/${githubOrg}/${githubProject}", | ||
| sourcedir : "${rootProject.allprojects.find { it.name == 'grails-plugin-template' }.projectDir}/src/main/groovy", | ||
| grailsVersion : grailsVersion |
Comment on lines
+11
to
+14
|
|
||
| implementation project(':grails-plugin-template') | ||
|
|
||
| implementation platform("org.apache.grails:grails-bom:$grailsVersion") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.