Add Develocity SetDevelocityProjectId and SetDevelocityServer recipes - #8311
Merged
Conversation
Adds a recipe that sets `projectId` in the `develocity` block of a Gradle settings file, inserting it after the `server` assignment when absent or updating it when it differs. Handles both the Kotlin and Groovy settings DSLs. This supports the Develocity server migration where each project's build scans must now declare `projectId = "openrewrite"`.
This was referenced Jul 22, 2026
This was referenced Jul 22, 2026
Aligns with the other Develocity recipes (AddDevelocityGradlePlugin, RemoveDevelocityConfiguration, MigrateGradleEnterpriseToDevelocity), which live in org.openrewrite.gradle.plugins.
Extracts the develocity-block traversal and property upsert into a package-private Develocity helper, and adds SetDevelocityServer to set or update the `server` in a Gradle settings file's `develocity` block.
Declare displayName/description as initialized final fields so Lombok generates the getters, matching EnableDevelocityBuildCache.
SetDevelocityProjectId recipeSetDevelocityProjectId and SetDevelocityServer recipes
timtebeek
added a commit
to openrewrite/rewrite-rewrite
that referenced
this pull request
Jul 22, 2026
* Keep Develocity build scan config consistent in recipe best practices Add SetDevelocityServer and SetDevelocityProjectId to OpenRewriteRecipeBestPractices so every OpenRewrite recipe project's settings.gradle(.kts) points at community.develocity.cloud with projectId "openrewrite". Depends on openrewrite/rewrite#8311 (introduces these recipes); the build stays red until that is merged and released. * Regenerate recipes.csv
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.
As part of the Develocity server migration, each project's
develocityconfiguration insettings.gradle(.kts)must declare aprojectId(and, for stragglers, point at the newserver) so build scans are associated with the correct project on the new server.This adds two focused recipes under
org.openrewrite.gradle.plugins, alongside the existing Develocity recipes:SetDevelocityProjectId— insertsprojectId = "<value>"right after theserverassignment in thedevelocity {}block when absent, updates it when it differs, and no-ops when already set.SetDevelocityServer— sets/updatesserver = "<value>"(inserted as the first statement when absent); useful for migrating builds between Develocity servers.Both share a package-private
Develocityhelper (block traversal + string-property upsert) and handle both the Kotlin (settings.gradle.kts) and Groovy (settings.gradle) DSLs, including Groovy's implicit-returnon a closure's last statement.Example (
settings.gradle.kts):develocity { server = "https://community.develocity.cloud/" projectId = "openrewrite" // ... }SetDevelocityProjectIdhas already been run across the OpenRewrite org repositories to addprojectId = "openrewrite"to each settings file.