refactor: replace hardcoded URLs with dynamic placeholders for improved configurability#50
Open
refactor: replace hardcoded URLs with dynamic placeholders for improved configurability#50
Conversation
…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
Member
Author
|
@jdaugherty new iteration of #49 |
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.
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
.github/workflows/update-contributors.ymland.github/scripts/update-contributors.groovyto automatically update thecontributorssection inproject.ymlby fetching contributor data from GitHub and committing changes when necessary. [1] [2].github/workflows/update-versions.ymland.github/scripts/update-versions.groovyto automate updating the list of versions inproject.yml, generate theghpages.htmldocumentation index, and push updates to thegh-pagesbranch. [1] [2]Documentation Build and Metadata Modernization
ghPagesRootIndexPage) for generating the documentation index and replaced it with the new GitHub Actions-based solution. [1] [2]project.ymlinto Gradle viabuild-logic/src/main/groovy/config.project-metadata.gradle, making project properties (like title, description, org, contributors, versions) available throughout the build.Dependency and Build Logic Updates
org.apache.groovy:groovy-yamlas 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.