Skip to content

Synchronize gradle/scripts with the uptream - #1322

Merged
ikhoon merged 1 commit into
line:mainfrom
ikhoon:up-gradle-scripts
Jul 1, 2026
Merged

Synchronize gradle/scripts with the uptream#1322
ikhoon merged 1 commit into
line:mainfrom
ikhoon:up-gradle-scripts

Conversation

@ikhoon

@ikhoon ikhoon commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

subrepo:
subdir: "gradle/scripts"
merged: "164b0ab73"
upstream:
origin: "https://github.com/line/gradle-scripts.git"
branch: "main"
commit: "164b0ab73"
git-subrepo:
version: "0.4.6"
origin: "https://github.com/ingydotnet/git-subrepo"
commit: "110b9eb"

subrepo:
  subdir:   "gradle/scripts"
  merged:   "164b0ab73"
upstream:
  origin:   "https://github.com/line/gradle-scripts.git"
  branch:   "main"
  commit:   "164b0ab73"
git-subrepo:
  version:  "0.4.6"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "110b9eb"
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR bumps the gradle/scripts subrepo pin, adds documentation and conditional wiring for an optional mavenCentralMirror Gradle property across multiple build scripts, refactors shadow-jar dependency shading in java-shade.gradle, adds a Nexus publish client timeout, removes an unused import, updates default author metadata, and bumps Apache Thrift to 0.23.0 with updated checksums in three Dockerfiles.

Changes

Maven Central mirror support

Layer / File(s) Summary
Mirror property documentation
gradle/scripts/README.md
Adds Table of Contents entry and a new section documenting the mavenCentralMirror property, its configuration via gradle.properties or CLI, and scope of effect.
Conditional mirror repository wiring
gradle/scripts/lib/common-dependencies.gradle, gradle/scripts/lib/java-rpc-proto.gradle, gradle/scripts/lib/java-shade.gradle, gradle/scripts/version-catalog.gradle
Replaces unconditional mavenCentral() calls with logic that reads mavenCentralMirror and adds a maven repository pointing to it when set, falling back to mavenCentral() otherwise.

Shadow jar dependency shading refactor

Layer / File(s) Summary
Shadow exclusions and deferred task configuration
gradle/scripts/lib/java-shade.gradle
Computes globalShadowExclusions from a root project property, propagates it to subprojects via ext.shadowExclusions, and defers configureShadowTask calls for shadedJar/shadedTestJar using project.afterEvaluate.
Shaded dependency exclusion logic
gradle/scripts/lib/java-shade.gradle
Applies shadowExclusions inside configureShadowTask, computes shadedDeps from the shade configuration, and changes relocate-path filtering to exclude only dependencies absent from shadedDeps.

Publish timeout, import cleanup, and metadata updates

Layer / File(s) Summary
Publish timeout, import removal, and author metadata
gradle/scripts/lib/common-publish.gradle, gradle/scripts/lib/java-javadoc.gradle, gradle/scripts/lib/common-info.gradle
Adds a 30-minute clientTimeout to Nexus publishing, removes the unused javax.inject.Inject import, and updates default authorName/authorEmail plus copyrightFooter string concatenation formatting.

Subrepo pin and Thrift version bump

Layer / File(s) Summary
Thrift 0.23.0 upgrade and subrepo pin
gradle/scripts/.gitrepo, gradle/scripts/lib/thrift/dockerfile/Dockerfile.bionic, Dockerfile.centos7, Dockerfile.trusty
Updates the git-subrepo commit/parent/cmdver metadata and bumps THRIFT_VERSION to 0.23.0 with matching updated SHA256 checksums in each Dockerfile.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

Not applicable — changes are build configuration updates without multi-component runtime interaction flows.

Suggested labels: review_needed_junior_swe, review_depth_standard

Suggested reviewers: minwoox, ikhoon

Gradle scripts refreshed, checksums renewed,
A mirror path added, where mavens convened,
Shadows now filtered by name, not erased,
Thrift climbs a version, its hash interlaced,
Small tweaks in footers, a timeout serene—
Build pipes hum onward, tidy and clean.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change by describing a synchronization of gradle/scripts with upstream.
Description check ✅ Passed The description is directly related to the subrepo sync and pinned commit details in this changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@gradle/scripts/lib/common-publish.gradle`:
- Around line 65-66: The common-publish Gradle script uses
Duration.ofMinutes(30) and Duration.ofSeconds(20) without an explicit import, so
add the missing java.time.Duration import at the top of the script. Update the
common-publish.gradle script near the clientTimeout and related timeout
configuration so the unqualified Duration references resolve correctly.

In `@gradle/scripts/lib/java-shade.gradle`:
- Around line 41-45: The `shade` configuration is being exposed through
`project.configurations.api.extendsFrom(shadeConfig)`, which incorrectly
publishes shaded libraries to consumers. Remove that `api` extension and instead
drive `ShadowJar` from the resolved `shade` dependency graph (or the `shade`
configuration itself), using `shadedDeps` only for selecting the shaded inputs.
If compile-time access is needed, wire those dependencies through a compile-only
path rather than `api`, and apply the same fix anywhere the same
`shade`/`shadedDeps` pattern appears.
- Around line 23-28: The `shadowExclusions` parsing in `java-shade.gradle` is
keeping whitespace around comma-separated values, so entries like `a, b` won’t
match excludes correctly. Update the normalization where `rawShadowExclusions`
is converted into `globalShadowExclusions` to trim each token and ignore empty
items before storing the list for subprojects. Keep the existing type check in
place and apply the cleanup directly in the `split(",")` handling.

In `@gradle/scripts/README.md`:
- Around line 782-784: The documented scope of mavenCentralMirror is too broad
compared with the current wiring. Update the README text to match what the
implementation actually redirects, or extend the Gradle script handling so
mavenCentral() is also replaced in settings.gradle, buildSrc, and buildscript
blocks; use the existing mavenCentralMirror repository wiring and related script
repository setup as the reference points. Keep the wording precise about which
repositories are affected so users do not expect their own
settings.gradle/buildSrc declarations to be rewritten unless that behavior is
actually implemented.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c6d22f7d-28d5-4556-a308-7109407f0aa9

📥 Commits

Reviewing files that changed from the base of the PR and between b0011fd and 30eca5c.

⛔ Files ignored due to path filters (1)
  • gradle/scripts/lib/thrift/0.23/thrift.windows-x86_64.exe is excluded by !**/*.exe
📒 Files selected for processing (16)
  • gradle/scripts/.gitrepo
  • gradle/scripts/README.md
  • gradle/scripts/lib/common-dependencies.gradle
  • gradle/scripts/lib/common-info.gradle
  • gradle/scripts/lib/common-publish.gradle
  • gradle/scripts/lib/java-javadoc.gradle
  • gradle/scripts/lib/java-rpc-proto.gradle
  • gradle/scripts/lib/java-shade.gradle
  • gradle/scripts/lib/thrift/0.23/thrift.linux-aarch_64
  • gradle/scripts/lib/thrift/0.23/thrift.linux-x86_64
  • gradle/scripts/lib/thrift/0.23/thrift.osx-aarch_64
  • gradle/scripts/lib/thrift/0.23/thrift.osx-x86_64
  • gradle/scripts/lib/thrift/dockerfile/Dockerfile.bionic
  • gradle/scripts/lib/thrift/dockerfile/Dockerfile.centos7
  • gradle/scripts/lib/thrift/dockerfile/Dockerfile.trusty
  • gradle/scripts/version-catalog.gradle
💤 Files with no reviewable changes (1)
  • gradle/scripts/lib/java-javadoc.gradle

Comment on lines +65 to +66
clientTimeout.set(Duration.ofMinutes(30))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
rg -n 'import java.time.Duration' gradle/scripts/lib/common-publish.gradle

Repository: line/centraldogma

Length of output: 155


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- file outline ---'
ast-grep outline gradle/scripts/lib/common-publish.gradle --view expanded || true

echo
echo '--- first 120 lines ---'
sed -n '1,120p' gradle/scripts/lib/common-publish.gradle | cat -n

echo
echo '--- search for Duration usage/imports in Gradle scripts ---'
rg -n '\bDuration\b|import java\.time\.Duration|java\.time\.' gradle/scripts/lib -g '*.gradle' -g '*.groovy' || true

Repository: line/centraldogma

Length of output: 5302


Import java.time.Duration at the top of this script. Duration.ofMinutes(30) and Duration.ofSeconds(20) both use an unqualified type here, so the script won’t compile without an explicit import.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@gradle/scripts/lib/common-publish.gradle` around lines 65 - 66, The
common-publish Gradle script uses Duration.ofMinutes(30) and
Duration.ofSeconds(20) without an explicit import, so add the missing
java.time.Duration import at the top of the script. Update the
common-publish.gradle script near the clientTimeout and related timeout
configuration so the unqualified Duration references resolve correctly.

Comment on lines +23 to +28
def rawShadowExclusions = rootProject.findProperty("shadowExclusions")
if (!(rawShadowExclusions instanceof String)) {
throw new RuntimeException("Property 'shadowExclusions' must be a String but was: ${rawShadowExclusions.getClass().name}")
}
globalShadowExclusions = rawShadowExclusions.split(",")
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Trim shadowExclusions entries before storing them.

split(",") preserves whitespace and empty tokens, so a value like a, b produces " b" and the exclude no longer matches. Normalize the list here before copying it to subprojects.

Proposed fix
-    globalShadowExclusions = rawShadowExclusions.split(",")
+    globalShadowExclusions = rawShadowExclusions
+            .split(',')
+            .collect { it.trim() }
+            .findAll { !it.isEmpty() }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
def rawShadowExclusions = rootProject.findProperty("shadowExclusions")
if (!(rawShadowExclusions instanceof String)) {
throw new RuntimeException("Property 'shadowExclusions' must be a String but was: ${rawShadowExclusions.getClass().name}")
}
globalShadowExclusions = rawShadowExclusions.split(",")
}
def rawShadowExclusions = rootProject.findProperty("shadowExclusions")
if (!(rawShadowExclusions instanceof String)) {
throw new RuntimeException("Property 'shadowExclusions' must be a String but was: ${rawShadowExclusions.getClass().name}")
}
globalShadowExclusions = rawShadowExclusions
.split(',')
.collect { it.trim() }
.findAll { !it.isEmpty() }
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@gradle/scripts/lib/java-shade.gradle` around lines 23 - 28, The
`shadowExclusions` parsing in `java-shade.gradle` is keeping whitespace around
comma-separated values, so entries like `a, b` won’t match excludes correctly.
Update the normalization where `rawShadowExclusions` is converted into
`globalShadowExclusions` to trim each token and ignore empty items before
storing the list for subprojects. Keep the existing type check in place and
apply the cleanup directly in the `split(",")` handling.

Comment on lines +41 to +45
def shadeConfig = project.configurations.create("shade") {
canBeResolved = true
canBeConsumed = false
}
project.configurations.api.extendsFrom(shadeConfig)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Keep shade off api and drive shading from the resolved shade graph.

api.extendsFrom(shadeConfig) publishes shaded libraries as normal dependencies, while shadedDeps only tracks the direct declarations on shade. The current filter therefore drops transitives from the shadow JAR but still advertises the direct deps to consumers, which is the wrong contract for shaded artifacts. Use shade (or its resolved dependency graph) as the ShadowJar input, and if compilation needs those jars, wire them into a compile-only path instead of api.

Also applies to: 369-374, 400-403

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@gradle/scripts/lib/java-shade.gradle` around lines 41 - 45, The `shade`
configuration is being exposed through
`project.configurations.api.extendsFrom(shadeConfig)`, which incorrectly
publishes shaded libraries to consumers. Remove that `api` extension and instead
drive `ShadowJar` from the resolved `shade` dependency graph (or the `shade`
configuration itself), using `shadedDeps` only for selecting the shaded inputs.
If compile-time access is needed, wire those dependencies through a compile-only
path rather than `api`, and apply the same fix anywhere the same
`shade`/`shadedDeps` pattern appears.

Comment thread gradle/scripts/README.md
Comment on lines +782 to +784
When set, the mirror URL replaces `mavenCentral()` in all repository declarations including
`settings.gradle`, `buildSrc`, and `buildscript` blocks of applied scripts. When unset, behavior
is identical to the default — fully backward compatible.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Narrow the documented scope of mavenCentralMirror.

This text promises that all mavenCentral() declarations, including settings.gradle and buildSrc, are redirected, but the wiring in this PR only touches the repositories inside the shipped Gradle scripts. As written, users can still leave direct mavenCentral() calls in their own settings.gradle/buildSrc and hit the public repo unexpectedly. Please either scope the docs to the script-managed repositories or add the missing wiring.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@gradle/scripts/README.md` around lines 782 - 784, The documented scope of
mavenCentralMirror is too broad compared with the current wiring. Update the
README text to match what the implementation actually redirects, or extend the
Gradle script handling so mavenCentral() is also replaced in settings.gradle,
buildSrc, and buildscript blocks; use the existing mavenCentralMirror repository
wiring and related script repository setup as the reference points. Keep the
wording precise about which repositories are affected so users do not expect
their own settings.gradle/buildSrc declarations to be rewritten unless that
behavior is actually implemented.

@ikhoon

ikhoon commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Let me merge this PR since the changes were already reviewed.

@ikhoon
ikhoon merged commit 6816166 into line:main Jul 1, 2026
13 of 14 checks passed
@ikhoon
ikhoon deleted the up-gradle-scripts branch July 1, 2026 07:24
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