Skip to content

Add migration gotchas and clarify external plugin usage#353

Merged
bulldozer-bot[bot] merged 4 commits intodevelopfrom
docs/migration-gotchas
Jan 27, 2026
Merged

Add migration gotchas and clarify external plugin usage#353
bulldozer-bot[bot] merged 4 commits intodevelopfrom
docs/migration-gotchas

Conversation

@felixdesouza
Copy link
Contributor

@felixdesouza felixdesouza commented Jan 23, 2026

Before this PR

The testing guide's "Testing with External Plugins" section doesn't clarify that gradlePluginForTesting is already created by the plugin, and the example uses an explicit version number.

Migration-specific gotchas were scattered or missing from documentation.

After this PR

testing-guide.md (general usage):

  • Clarify that gradlePluginForTesting configuration is automatically created by the plugin
  • Update example to show multiple dependencies without explicit versions
  • Add guidance on chaining .add() calls for plugins

junit-migration-excavator-instructions.md (migration-specific):

  • Add guidance: do not add gradle-plugin-testing-junit to versions.props as the plugin provides it automatically
  • Add "Don't Use buildscript Blocks for External Plugins" section
  • Add "Don't Access Framework Internals" section (no need for version-based namespacing)
  • Add "Use Full Task Paths for Explicit Assertions" section

Based on issues discovered during review of migration PR palantir/gradle-failure-reports#432

Possible downsides?

None - documentation only.

@felixdesouza felixdesouza force-pushed the docs/migration-gotchas branch from cfd757a to af80770 Compare January 23, 2026 16:22
- Clarify that `gradlePluginForTesting` configuration is already created by the plugin
- Add "Common Mistake" callout showing wrong pattern (buildscript blocks) vs correct pattern
- Add "Common Migration Gotchas" section covering:
  - Don't access framework internals (no need for version-based namespacing)
  - Use full task paths for explicit task assertions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@felixdesouza felixdesouza force-pushed the docs/migration-gotchas branch from af80770 to b7484a0 Compare January 23, 2026 16:29
The gradle-plugin-testing plugin automatically provides the correct
version of this dependency, so it should not be added to versions.props.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

### Common Migration Gotchas

When migrating from Nebula/Spock tests to this framework, avoid these common mistakes:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

should this live in the junit-migration-excavator-instructions file instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe? feels more AI focused so maybe should be moved?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I don't think this file should reference migrations. Hopefully people can just read it without having to worry about groovy based tests at some point.


```java
// Preferred - chain the calls
rootProject.buildGradle().plugins().add("com.palantir.failure-reports").add("java");
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this better? I think it's fine if the .adds are on multiple lines, but I think the .adds on the same line is less readable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's fair, but it's also up to formatting. I wonder whether a varargs thing would be better


```java
// WRONG - Accessing implementation details
String version = ((DefaultGradleInvoker) gradle).gradleVersion().version();
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we should be more liberal with @RestrictedApi too if these need to be public. I kinda hate it but we probably just have put everything in same package.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

for restricted api absolutely, there's no downside and it guides the ai more I believe?

felixdesouza and others added 2 commits January 23, 2026 18:00
Refactor documentation to separate general usage guidance from
migration-specific advice. Migration gotchas now live in
junit-migration-excavator-instructions.md alongside other migration guidance.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@bulldozer-bot bulldozer-bot bot merged commit 4f98269 into develop Jan 27, 2026
5 checks passed
@bulldozer-bot bulldozer-bot bot deleted the docs/migration-gotchas branch January 27, 2026 14:22
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.

3 participants