Skip to content

Use worker api and toolchains for checkstyle#20069

Merged
bot-gradle merged 38 commits intomasterfrom
asodja/checkstyle-worker-api
Mar 14, 2022
Merged

Use worker api and toolchains for checkstyle#20069
bot-gradle merged 38 commits intomasterfrom
asodja/checkstyle-worker-api

Conversation

@asodja
Copy link
Copy Markdown
Member

@asodja asodja commented Mar 2, 2022

It brings 5-10% benefit vs master for gradle/gradle running:
gradle clean checkstyleMain checkstyleTest --no-build-cache --no-configuration-cache --info
performance-tests.zip

Also, there is an even bigger benefit when there are multiple source sets reported by @breskeby in #19361 (comment).

Before:
Screenshot 2022-02-28 at 11 00 46

After:
Screenshot 2022-02-28 at 11 00 35

@asodja asodja requested a review from pioterj as a code owner March 2, 2022 13:08
@bot-gradle bot-gradle added this to the 7.5 RC1 milestone Mar 2, 2022
@asodja asodja force-pushed the asodja/checkstyle-worker-api branch from 5dddc42 to d639f7c Compare March 2, 2022 14:15
@asodja asodja self-assigned this Mar 2, 2022
@asodja asodja force-pushed the asodja/checkstyle-worker-api branch from ea7a428 to 349dafa Compare March 4, 2022 16:49
@asodja asodja requested review from big-guy and wolfs March 4, 2022 17:06
Copy link
Copy Markdown
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.

Other than the XSLT output, this LGTM.


protected abstract String getActionName();

protected abstract Closure<Object> getAntClosure();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this like what you tried? This passes for me:
9f230ae

def stylesheet = stylesheetString.isPresent()
? stylesheetString.get()
: Checkstyle.getClassLoader().getResourceAsStream('checkstyle-noframes-sorted.xsl').text
ant.xslt(in: xmlOutputLocation, out: htmlOutputLocation) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Something seems to be different with this change... I'm seeing this output all the time with this change:

[ant:xslt] Warning: org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser: Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized
[ant:xslt] Warning: org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized.

https://ge.gradle.org/s/dlizegkowms2c/console-log#L615

This doesn't happen on current master.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Hmm, good catch. I will check

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It seems that the culprit is having xerces:xercesImplon the classpath. It's brought in by the nekohtml dependency. I removed both dependencies. It doesn't seem we need them, since xerces seems to be integrated into the JDK.

Any thoughts on that?

Copy link
Copy Markdown
Member Author

@asodja asodja Mar 10, 2022

Choose a reason for hiding this comment

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

I see now why we used nekohtml in some places... Since default SaxParser is very strict and html is not that strict. Hmm...

I will try to use Jsoup instead of the nekohtml.

@gradle gradle deleted a comment from asodja Mar 10, 2022
@asodja asodja force-pushed the asodja/checkstyle-worker-api branch from a6fa4f7 to fa8bdbf Compare March 11, 2022 09:43
@gradle gradle deleted a comment from asodja Mar 11, 2022
@gradle gradle deleted a comment from asodja Mar 11, 2022
@asodja
Copy link
Copy Markdown
Member Author

asodja commented Mar 11, 2022

@bot-gradle test this

@gradle gradle deleted a comment from asodja Mar 11, 2022
@bot-gradle
Copy link
Copy Markdown
Collaborator

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

@asodja asodja requested a review from big-guy March 11, 2022 12:46
@asodja
Copy link
Copy Markdown
Member Author

asodja commented Mar 14, 2022

@bot-gradle test and merge

@gradle gradle deleted a comment from asodja Mar 14, 2022
@bot-gradle
Copy link
Copy Markdown
Collaborator

Your PR is queued. See the queue page for details.

@bot-gradle
Copy link
Copy Markdown
Collaborator

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

@bot-gradle bot-gradle merged commit 34405b3 into master Mar 14, 2022
@asodja asodja deleted the asodja/checkstyle-worker-api branch March 14, 2022 14:17
@breskeby breskeby mentioned this pull request Mar 17, 2022
13 tasks
yogurtearl added a commit to yogurtearl/gradle that referenced this pull request Jun 1, 2022
Moving it out of test only per gradle#20069

See also: gradle#20884 (comment)

Signed-off-by: Michael J Bailey <Michael.J.Bailey@aexp.com>
@jvandort jvandort mentioned this pull request Aug 2, 2022
4 tasks
bot-gradle added a commit that referenced this pull request Aug 15, 2022
Runs CodeNarc in a Worker. Based off of [previous work done for checkstyle](#20069)

- [x] Write tests
- [x] Figure out how to configure logging for worker
- [x] Link toolchain with that set in java plugin
- [ ] Update release notes

Co-authored-by: Justin Van Dort <jvandort@gradle.com>
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.

6 participants