fix: [BUG] Bundled PMD 7.25.0 cannot load custom rulesets referencing PMD 7.26.0 rules — one unresolvable ref disables the whole ruleset (#2065)#480
Closed
nikhil-mittal-165 wants to merge 1 commit into
Conversation
Upgrades bundled PMD version to 7.26.0 so that custom rulesets referencing rules added in PMD 7.26.0 (e.g. InvocableClassNoArgConstructor) can be loaded without RuleSetLoadException. Updates version references in constants.ts, libs.versions.toml, and package.json. Adds InvocableClassNoArgConstructor to RULE_MAPPINGS and apex goldfile.
|
Git2Gus App is installed but the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes forcedotcom/code-analyzer#2065
Root Cause
The @salesforce/code-analyzer-pmd-engine package bundles PMD 7.25.0 (defined in packages/code-analyzer-pmd-engine/src/constants.ts and packages/code-analyzer-pmd-engine/gradle/libs.versions.toml). When a user's custom ruleset references a rule that only exists in PMD 7.26.0 (e.g. InvocableClassNoArgConstructor added 2026-06-29), PMD throws a RuleSetLoadException because the rule cannot be resolved against the bundled 7.25.0 jars. PMD's all-or-nothing ruleset loading semantics mean the entire custom ruleset fails to load, disabling every rule in it. The fix is to bump the bundled PMD version from 7.25.0 to 7.26.0 in the 3 files that changed in the previous upgrade (commit abccdd0): constants.ts, libs.versions.toml, and package.json. This is a well-established upgrade pattern the team performs monthly.
Fix
Bumped bundled PMD from 7.25.0 to 7.26.0 and added new InvocableClassNoArgConstructor rule to RULE_MAPPINGS and goldfile. All 127 tests pass.
Testing
Functional Testing Evidence
Tested on Dreamhouse project:
Overall Status: PASS ✅
Files Changed