Skip to content

[core] Render config errors#519

Merged
adangel merged 3 commits into
pmd:masterfrom
jsotuyod:render-config-errors
Aug 2, 2017
Merged

[core] Render config errors#519
adangel merged 3 commits into
pmd:masterfrom
jsotuyod:render-config-errors

Conversation

@jsotuyod

@jsotuyod jsotuyod commented Jul 25, 2017

Copy link
Copy Markdown
Member

Before submitting a PR, please check that:

  • The PR is submitted against master. The PMD team will merge back to support branches as needed.
  • mvn test passes.
  • mvn checkstyle:check passes. Check this for more info

PR Description:

  • All renderers previously including processing errors now also include configuration errors.
  • I take the chance to fix a couple of issues with VBHTMLRenderer, that was rendering processing errors using toString() (which has a default implementation)
  • Notice that renderers that didn't previously include processing errors are unmodified
  • This resolves part 1 of [core] Render config errors #194

jsotuyod added 2 commits July 25, 2017 12:52
 - All renderers preivously including processing errors now also include
configuration errors.
 - I take the chance to fix a couple of issues with `VBHTMLRenderer`,
that was rendering processing errors using `toString()` (which has a
default implementation)
 - Notice that renderers that didn't previously include processing
errors are unmodified
@jsotuyod jsotuyod added the an:enhancement An improvement on existing features / rules label Jul 25, 2017
@jsotuyod jsotuyod added this to the 6.0.0 milestone Jul 25, 2017
@jsotuyod jsotuyod added the in:pmd-internals Affects PMD's internals label Jul 25, 2017
@jsotuyod jsotuyod mentioned this pull request Aug 1, 2017
3 tasks

@adangel adangel left a comment

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.

Looks good. Maybe we should for now just mention in the changelog, that the XML renderer has now a new element. WDYT?

// config errors
for (final Report.ConfigurationError ce : configErrors) {
buf.setLength(0);
buf.append("<configerror ").append("rule=\"");

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.

I'm wondering whether we have documented the XML report format somewhere.... We are adding now a new element, which might break other tools. I think maven-pmd-plugin is safe, since it doesn't rely on that renderer, but maybe the Jenkins plugin does?

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.

yes, tools such as jenkins are possibly going to break, but that's why this change is ok for 6.0.0.

We should probably create an XML Schema for this report and expose it...

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.

Yes, I'm fine with breaking compatibility. We just need to be aware of that.
Creating a schema probably makes sense.

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.

I did include a notice in the release changes, but feel free to edit it if you don't consider it explicit enough: https://github.com/pmd/pmd/pull/519/files#diff-b7709f07439de5204938d714fe93ed84

I'll get to the XML Schema on a separate PR / task

@adangel adangel merged commit 1b71861 into pmd:master Aug 2, 2017
@adangel

adangel commented Aug 2, 2017

Copy link
Copy Markdown
Member

Merged! Thanks again!

@jsotuyod jsotuyod deleted the render-config-errors branch August 2, 2017 14:55
jsotuyod added a commit to jsotuyod/pmd that referenced this pull request Sep 12, 2017
  Under multi-thread runs, each thread parsed it's own copy of the
ruleset, and removed dysfunctional rules. This meant 1 `ConfigError` per
thread was being generated.
  Since pmd#519, we now log `ConfigErrors`, meaning multiple identical
logs in reports and noise for the user.
  Therefore, we change our approach. RuleSets are parsed only once.
Dysfunctional rules are filtered and reported early on, before
dispathing actual file analysis. Each analysis thread can then produce
their own copy of the ruleset by taking advantage of the `deepCopy`
support for rules, ruleset and rulesets introduced in pmd#464.
  The result is not only more concise reports, but the analysis thread
actually perform less work. Rulesets XMLs are parsed exactly once,
instead of 1 + 1 per thread as before, and rule configuration is
validated only once.

  During this process an issue with how property descriptors where
copied has arised and was fixed. A new unit test to validate this
scenario has been introduced.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

an:enhancement An improvement on existing features / rules in:pmd-internals Affects PMD's internals

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants