Skip to content

Upgrade Spotless to fix npm compatibility - #12003

Open
dhruv9b wants to merge 3 commits into
testcontainers:mainfrom
dhruv9b:fix/11997-spotless-npm
Open

Upgrade Spotless to fix npm compatibility#12003
dhruv9b wants to merge 3 commits into
testcontainers:mainfrom
dhruv9b:fix/11997-spotless-npm

Conversation

@dhruv9b

@dhruv9b dhruv9b commented Aug 31, 2026

Copy link
Copy Markdown

Description

This pull request fixes the Spotless/Prettier build failure reported in #11997.

Spotless 6.22.0 invokes npm with the --scripts-prepend-node-path option, which is no longer supported by current npm versions and causes the build to fail with:

npm error Unknown cli flag: --scripts-prepend-node-path

This change upgrades the Spotless Gradle plugin from 6.22.0 to 8.10.1, which contains the upstream fix for this issue.

Verification

  • ./gradlew :test-support:spotlessJava --rerun-tasks
  • ./gradlew :test-support:test --rerun-tasks
  • git diff --check

Fixes #11997.

Summary by CodeRabbit

  • Chores
    • Updated code formatting tooling across the project, examples, and smoke-test builds.
    • Enabled automated dependency updates for the formatting tooling.
    • No user-facing functionality or public APIs were changed.

@dhruv9b
dhruv9b requested a review from a team as a code owner August 31, 2026 18:31
@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 74013e02-ff77-4012-8b9d-5a777547d776

📥 Commits

Reviewing files that changed from the base of the PR and between 918f465 and c9c8997.

📒 Files selected for processing (1)
  • .github/dependabot.yml

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The Gradle configurations update Spotless from 6.22.0 to 8.10.1. Dependabot can now update the Spotless dependency. The existing apply false settings remain unchanged.

Changes

Spotless plugin upgrade

Layer / File(s) Summary
Align Spotless plugin versions and updates
build.gradle, examples/build.gradle, smoke-test/build.gradle, .github/dependabot.yml
The Gradle configurations use Spotless version 8.10.1 and retain apply false. Dependabot now allows updates for com.diffplug.spotless.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to c9c89

This updates the Spotless plugin to address the npm invocation failure and enables future Dependabot updates. The build configuration changes are aligned and present no remaining merge-blocking risk.

Suggested reviewers: eddumelendez

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the primary change: upgrading Spotless to resolve npm compatibility problems.
Description check ✅ Passed The description explains the failure, identifies the unsupported npm option, describes the Spotless upgrade, references issue #11997, and lists verification steps.
Linked Issues check ✅ Passed The changes satisfy issue #11997 by upgrading Spotless to 8.10.1 in all listed Gradle build files. The Dependabot allow-list update also addresses the documented maintenance requirement.
Out of Scope Changes check ✅ Passed The changes are limited to the Spotless version upgrade and the related Dependabot allow-list update. No unrelated changes are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…

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.

@dhruv9b

dhruv9b commented Sep 2, 2026

Copy link
Copy Markdown
Author

Hi, just wanted to follow up on this PR. If someone has a chance to review it, I’d really appreciate any feedback. Thanks!

@vpelikh

vpelikh commented Sep 5, 2026

Copy link
Copy Markdown

The reason Dependabot isn't creating PRs for Spotless is the allow rule in .github/dependabot.yml for the root directory:

allow:
  - dependency-name: "com.gradle*"

This restricts updates to only dependencies starting with com.gradle, so Spotless (com.diffplug.spotless) is excluded. We should either remove the rule or add an explicit exception for Spotless.

Explicitly allow com.diffplug.spotless in the root Gradle Dependabot configuration so Dependabot can create Spotless update PRs.
Add spotless dependency to Dependabot configuration
@dhruv9b

dhruv9b commented Sep 5, 2026

Copy link
Copy Markdown
Author

Thanks for catching this! I’ve updated the Dependabot configuration and added the change to this PR. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Build fails with "Unknown cli flag: --scripts-prepend-node-path" due to outdated Spotless plugin

2 participants