docs: add Configuration Reference to Quick Reference section#15407
docs: add Configuration Reference to Quick Reference section#15407jamesfredley wants to merge 1 commit intoapache:7.0.xfrom
Conversation
Add a comprehensive Application Properties reference page under
ref/Configuration/ listing all Grails-specific configuration keys
with descriptions and default values. Covers core framework, GORM,
DataSource, Hibernate, Database Migration Plugin, Cache Plugin,
Asset Pipeline Plugin, Spring Security Plugin, and MongoDB GORM Plugin.
All external links use doc variables ({springBootVersion},
{hibernate5Reference}) for version-safe URLs.
Assisted-by: OpenCode <opencode@opencode.ai>
Assisted-by: Claude <claude@anthropic.com>
|
A decent start. There is a gray area in terms of what is included and what is not, more feels better, but I am not apposed to cutting things that are rarely used. |
|
so we aren't going to try to make a technical change to generate this? |
|
I thought about it, but it is spread across so many different locations and some external repos if we leave asset-pipeline, etc. So I think for this PR having a static adoc will allow it to move forward and it could be potentially automated in some way in the future. |
There was a problem hiding this comment.
Pull request overview
This PR adds a comprehensive Application Properties reference page to the Quick Reference section of the Grails documentation. The new file grails-doc/src/en/ref/Configuration/Application Properties.adoc provides a centralized reference for approximately 160 Grails-specific configuration keys organized into 21 categories covering core framework settings and bundled plugins.
Changes:
- Added comprehensive configuration reference documentation covering core Grails framework properties, GORM settings, and major bundled plugins (Database Migration, Cache, Asset Pipeline, Spring Security, MongoDB GORM)
- Uses AsciiDoc table format with Property/Description/Default columns for consistent presentation
- Properly uses doc variables (
{springBootVersion},{hibernate5Reference}) for version-safe external links
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@jamesfredley I strongly disagree here. A static doc is just ripe for getting out of date. We need an actual technical solution to this problem so it can be generated as needed. Why not have an app that starts up and dump the config in bootstrap / stop the app? This could be an easy task and would make sure the defaults are always properly reflected. |
|
I think this is a POC and potentially a placeholder due to the following. Config is scattered across 4 different mechanisms with no unified registry:
"start an app and dump config in bootstrap"
What could be done, likely for Grails 8
|
|
@jamesfredley I don't believe this is true. All of this gets added as a property source on the environment. we can merge any property sources so they're flattened and then dump them. We could even enable the actuators in spring boot to do this if we wanted. I'll take a pass at adding a command to do this as a proof of concept and we can compare. |
|
@jamesfredley checkout https://github.com/apache/grails-core/tree/configuration-command and see if this works. Right now it generates the asciidoc from the command, but we could just as easily generate json, command line readable, etc. Assuming this looks correct (tests seem to pass), then I think we can go with this solution instead, yes? |
|
I would love for it to be automated. Here is a comparison of the static doc and automated process. |
|
config-command-actual-output.html - the full output turned into similar html with some values redacted |
|
I see 4 issues based on these diffs:
I've pushed a fix for the first. For plugins like asset-pipeline, we should not be adding this to grails-core docs. They can change at any time. For cases where the defaults vary (i.e. mongodb vs hibernate have different values), this is the strongest indicator we should not be publishing a static document. For the remaining issue, technically, it's "not" configured but it's using a default. If we take the plugin.yml fix, we can check in plugin configuration and remove the defaults from the plugin code. Then they'll show and be maintained. We can even use your initial effort to figure out what to check in, where. I am okay with compromising here though. Use the configuration command to get the configured values, and then make it aware of the defaults (hard code them to start). Then we can gradually move the defaults in the command to actual config and iterate. But to solve the dynamic differences, we'll have to permute your document. We also need to figure out if longer term we want to allow the defaults in code instead of plugin configuration. If we do, we'll need a standard way to do this so we can parse the classpath to find them. This is probably out of scope of the first pass. But we should consider using codenarc to enforce whatever we decide here - if we force configuration files, it should enforce that default is specified in the plugin config instead of inline in the code. |
|
some other examples where we have different defaults: grails-layout vs grails-sitemesh. This is why I think it's a must we handle this programmatically. |
|
If you can make it automated, without losing the depth of information, specifically the Description and Default, I am all for it. Keeping it similar to https://docs.spring.io/spring-boot/appendix/application-properties/index.html. But I would hate to lose all the clarity. It took OpenCode ~15 minutes to generate this and it would be faster going forward, but we can't automate using AI since it is non-deterministic. |
|
I'd suggest we move this to draft status then. I'm a -1 because of the burden of keeping this up to date when defaults are added/changed, documenting external plugins that aren't even in core (changes external to core will mismatch historical documentation), & the generated doc assumes the same features for every project (if different libraries are included, these defaults can change, be missing, or even wrong). The chance of being wrong here is what I view as the largest detriment. A compromise proposal:
Longer term we can move those defaults into a location that we can programmatically retrieve them (I gave one proposal earlier). |
Summary
ref/Configuration/in the Quick Reference section of the documentationapplication.ymlconfiguration keys across 21 categories with descriptions and default values{springBootVersion},{hibernate5Reference}) for version-safe URLsSections
Core Framework (16 sections):
Core Properties, Web & Controllers, CORS, Views & GSP, Content Negotiation & MIME Types, Data Binding, Internationalization, Static Resources, URL Mappings, Scaffolding, Development & Reloading, Events, JSON & Converters, GORM (+ Multi-Tenancy), DataSource, Hibernate
Bundled Plugins (5 sections):
Database Migration Plugin, Cache Plugin, Asset Pipeline Plugin, Spring Security Plugin, MongoDB GORM Plugin
Sources
Default values verified against source code:
grails.config.Settings(grails-core) - 40+ core framework constantsorg.grails.datastore.mapping.config.Settings(grails-datastore-core) - GORM constantsDatabaseMigrationGrailsPlugin+DatabaseMigrationCommand- migration plugin keysDataBindingConfigurationProperties- data binding defaultsDefaultSecurityConfig.groovy(grails-spring-security) - all Spring Security defaultsAssetPipelineGrailsPlugin+AssetPipelineExtension(wondrify/asset-pipeline) - asset pipeline keysMongoSettings(grails-data-mongodb) - MongoDB GORM keysconfig.put()calls) - programmatic config generationapplication.ymlfiles - web/rest-api/base profile defaults