Skip to content

refactor: replace hardcoded URLs with dynamic placeholders for improved configurability#50

Open
sbglasius wants to merge 9 commits into7.0.xfrom
chore/project-agnostic-gh-docs-revised
Open

refactor: replace hardcoded URLs with dynamic placeholders for improved configurability#50
sbglasius wants to merge 9 commits into7.0.xfrom
chore/project-agnostic-gh-docs-revised

Conversation

@sbglasius
Copy link
Copy Markdown
Member

This pull request introduces a new automation system for keeping project metadata up-to-date, specifically focusing on contributor and version information, and modernizes how the documentation index page is generated and populated. The changes replace legacy Gradle logic with dedicated GitHub Actions workflows and Groovy scripts, making the process more robust, maintainable, and accurate. Additionally, the documentation index page (ghpages.html) is now dynamically generated with up-to-date project and version data, and all references in documentation templates are now tokenized for flexibility.

Automation and Workflow Improvements

  • Added .github/workflows/update-contributors.yml and .github/scripts/update-contributors.groovy to automatically update the contributors section in project.yml by fetching contributor data from GitHub and committing changes when necessary. [1] [2]
  • Added .github/workflows/update-versions.yml and .github/scripts/update-versions.groovy to automate updating the list of versions in project.yml, generate the ghpages.html documentation index, and push updates to the gh-pages branch. [1] [2]
  • Integrated the new workflows into the main CI and release pipelines, ensuring version and contributor updates are triggered automatically on relevant events. [1] [2]

Documentation Build and Metadata Modernization

  • Removed the legacy Gradle task (ghPagesRootIndexPage) for generating the documentation index and replaced it with the new GitHub Actions-based solution. [1] [2]
  • Centralized project metadata extraction from project.yml into Gradle via build-logic/src/main/groovy/config.project-metadata.gradle, making project properties (like title, description, org, contributors, versions) available throughout the build.
  • Updated documentation build and template files to use dynamic, tokenized values (e.g., project title, GitHub URLs, latest version, etc.) for greater flexibility and accuracy. [1] [2] [3] [4] [5] [6]

Dependency and Build Logic Updates

  • Added org.apache.groovy:groovy-yaml as a dependency for build scripts to support YAML parsing.

These changes collectively improve the reliability and maintainability of project metadata management and documentation publishing, reducing manual overhead and risk of outdated information.

sbglasius added 9 commits May 4, 2026 17:26
…ed configurability

- Updated documentation links and project metadata to use placeholders (e.g., `@GITHUB_REPO_URL@`, `@REPO_SLUG@`).
- Dynamically resolve repository details via Gradle project properties.
- Enhanced documentation build process to replace tokens with computed values.
* Metadata in gradle.properties:  index.tmlp now 100% generic, as it uses metadata from gradle.properties
* Same data is used in plugin/build.gradle (except from developers)
- Add project.yml as single source of truth for project title,
description, org, GitHub coordinates, license, and contributors
- Remove projectTitle, projectDescription, projectOrg, githubOrg,
githubProject from gradle.properties
- Read project.yml in build-logic/build.gradle via SnakeYAML and
inject all values as ext properties into every subproject
- Wire contributors to GrailsPublishExtension.setDevelopers(Map),
removing the custom GenerateMavenPom hook entirely
- Delete ContributorTask and config.contributors convention plugin;
contributor fetching moves to a dedicated GitHub Actions workflow
- Add .github/workflows/update-contributors.yml to auto-update the
contributors section in project.yml on push to release branches
- Replace manual @token@ string replacement in ghPagesRootIndexPage
with Groovy's SimpleTemplateEngine and ${TOKEN} syntax in index.tmpl
- Replace the Python heredoc in update-contributors.yml with a standalone Groovy script at .github/scripts/update-contributors.groovy.
- Workflow now installs Groovy via SDKMAN using the version from .sdkmanrc, consistent with the rest of the project's toolchain management
- Script uses YamlSlurper/YamlBuilder for proper YAML round-tripping instead of manual text manipulation
- @grab('org.apache.groovy:groovy-yaml') ensures the module is available regardless of what the Groovy installation includes on its classpath
… publish

Add versions.current/previous/ignore to project.yml as the authoritative version list. config.docs.gradle no longer calls the GitHub API or generates ghpages.html — that responsibility moves entirely to a new update-versions.groovy script.

The update-versions.yml workflow (triggered via workflow_call after docs deploy) fetches the gh-pages directory listing, filters against versions.ignore, sorts newest-first, commits updated project.yml, and pushes a freshly rendered ghpages.html directly to the gh-pages branch — eliminating the race condition where the index was generated before the new docs version was published.

- project.yml: add versions.current/previous/ignore section
- build-logic/src/main/groovy/config.project-metadata.gradle: new convention plugin that reads project.yml and sets ext properties on applying projects
- build-logic/build.gradle: remove allprojects/buildscript blocks; YAML parsing moves to the convention plugin where groovy-yaml is on the classpath
- build-logic/src/main/groovy/config.docs.gradle: remove ghPagesRootIndexPage task and GitHub API fetch entirely
- plugin/build.gradle: apply config.project-metadata
- .github/scripts/update-versions.groovy: new script — fetches gh-pages dirs, updates project.yml, generates ghpages.html from index.tmpl
- .github/workflows/update-versions.yml: new reusable workflow called after docs deploy; commits project.yml and pushes ghpages.html to gh-pages
- .github/workflows/ci.yml: add update-index job (needs: publish) to run after snapshot docs deploy
- .github/workflows/release.yml: add update-index job (needs: [docs], branch: target_commitish); close job now needs update-index

Co-Authored-By: AI
@sbglasius
Copy link
Copy Markdown
Member Author

@jdaugherty new iteration of #49

@sbglasius sbglasius requested a review from jdaugherty May 5, 2026 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant