Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for EnableExternalDTDLoad property to Checkstyle Plugin #22036

Merged
merged 13 commits into from Sep 21, 2022

Conversation

tresat
Copy link
Member

@tresat tresat commented Sep 15, 2022

Fixes #21624

@tresat tresat self-assigned this Sep 15, 2022
@tresat tresat changed the base branch from master to release September 15, 2022 19:07
@tresat tresat added this to the 7.6 RC1 milestone Sep 15, 2022
# Conflicts:
#	subprojects/docs/src/docs/release/notes.md
- The base class tests depend upon CC's eager resolution failing due to a lack of repositories definied.  So if we
define them in the setup method, those builds succeed, when expected to fail, thus failing tests.
- Need to specific repo in every new test then.
@tresat tresat requested a review from a team September 16, 2022 19:48
@tresat tresat marked this pull request as ready for review September 16, 2022 19:48
Copy link
Contributor

@nathan-contino nathan-contino left a comment

Choose a reason for hiding this comment

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

Docs LGTM. Thanks for cleaning up those trailing spaces.

Copy link
Member

@big-guy big-guy left a comment

Choose a reason for hiding this comment

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

Thanks for coming up with something simple for 7.6 for this

@@ -112,7 +112,7 @@ The `init` task now adds compile-time Maven dependencies to Gradle's `api` confi
when converting a Maven project. This sharply reduces the number of compilation errors.
For more information about Maven conversions, see the [Build Init Plugin](userguide/build_init_plugin.html#sec:pom_maven_conversion).

#### Introduced network timeout configuration for wrapper download
#### Introduced network timeout configuration for wrapper download
Copy link
Member

Choose a reason for hiding this comment

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

Can you remove these edits?

Copy link
Member Author

Choose a reason for hiding this comment

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

I can restore the trailing spaces at the ends of lines, but why do we want them? Isn't not having them a good practice? I have a script I automatically run upon commit to make sure I don't allow any of these in the files I've changed.

Comment on lines 203 to 205
if (getEnableExternalDtdLoad().isPresent()) {
spec.getForkOptions().getSystemProperties().put("checkstyle.enableExternalDtdLoad", getEnableExternalDtdLoad().get());
}
Copy link
Member

Choose a reason for hiding this comment

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

I would do this slightly differently. Instead of checking if the property is present, let's just put a convention(false) on enableExternalDtdLoad in the constructor. I would then also drop the @Optional annotation below.

That way if someone uses the Checkstyle task without the Checkstyle plugin, they'll have a value. This is similar to what we're doing with the toolchain.

This is against the usual pattern (conventions should be set in the plugin), but as long as we support Checkstyle tasks to be used outside of the plugin, we have to keep them working.

Copy link
Member Author

Choose a reason for hiding this comment

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

I was trying to avoid setting the convention in the constructor, and also to avoid needlessly setting an extra system property set to false (which means the same as absence) when running the checkstyle process.

Are you sure we shouldn't leave the @Optional and use getOrNull() to match the other fork options (these do NOT create system props, but still)?

@big-guy big-guy added the @core Issue owned by GBT Core label Sep 19, 2022
tresat and others added 6 commits September 20, 2022 14:45
… task constructor; always set the system property when forking the checkstyle process
Co-authored-by: Sterling Greene <big-guy@users.noreply.github.com>
…lugins/quality/checkstyle/CheckstylePluginIntegrationTest.groovy

Co-authored-by: Sterling Greene <big-guy@users.noreply.github.com>
@tresat
Copy link
Member Author

tresat commented Sep 20, 2022

@bot-gradle test this

@gradle gradle deleted a comment from tresat Sep 20, 2022
@bot-gradle
Copy link
Collaborator

OK, I've already triggered the following builds for you:

…ystem-property-npe

* origin/release: (124 commits)
  CompileAllProduction -> CompileAll
  Support skipping all dependency builds
  Disable stacktrace check for MavenPublishS3ErrorsIntegrationTest
  Refline performance.baselines paramater in performance test trigger
  Set docsTest timeout to 45 minutes
  Restore TAPI compatibility with Java 6 and old Gradle versions
  Put back some laziness
  Improve code
  Fix test
  Rename "implementationClass" to "resolverClass"
  Rename "repositories" to "javaRepositories"
  Rename "toUri()" to "resolve()"
  Solve remaining TODOs
  Reduce number of file changes for soak test on macOS
  Update documentation
  Update file system watching link
  Update file system watching link
  Update link to File System Watching
  Add link to file system watching
  Add file system watching page to toc tree
  ...
@big-guy
Copy link
Member

big-guy commented Sep 21, 2022

@bot-gradle test and merge

@gradle gradle deleted a comment from tresat Sep 21, 2022
@bot-gradle
Copy link
Collaborator

OK, I've already triggered a build for you.

@bot-gradle bot-gradle merged commit b1abc7d into release Sep 21, 2022
@blindpirate blindpirate deleted the tt/76/checkstyle-system-property-npe branch September 22, 2022 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@core Issue owned by GBT Core
Projects
None yet
5 participants