Repository navigation
Make Java problem matcher opt-in (default problem-matcher to false) - #1326
Merged
Merged
Conversation
Default the problem-matcher input to false so setup-java no longer registers Java compiler and uncaught-exception annotations unless explicitly enabled with problem-matcher: true. Fixes #1322 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the change to opt-in Java problem matcher registration.
No open issues 🎉
What changed in this PR
Makes Java problem matcher registration opt-in, addressing #1322 by reducing unwanted inline annotations. Workflows that rely on these annotations must set problem-matcher: true; compiler output and build failure behavior remain unchanged.
Changes:
- Sets the action input default and runtime fallback to
false. - Documents opt-in behavior and clarifies that existing matchers are not unregistered.
- Updates unit tests and the generated setup bundle.
| File | Description |
|---|---|
src/problem-matcher.ts |
Disables registration by default at runtime. |
README.md |
Updates release highlights and the documented input default. |
docs/advanced-usage.md |
Adds an enabling example and clarifies registration behavior. |
dist/setup/index.js |
Includes the updated runtime default in the shipped bundle. |
action.yml |
Sets the public input default to false and updates its description. |
__tests__/problem-matcher.test.ts |
Covers default-disabled and explicitly enabled registration. |
Review effort: Balanced
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.
Description:
The Java problem matcher turns every
javac/ Maven compiler diagnostic in subsequent steps into an inline annotation. This PR makes registration opt-in.Why opt-in:
mainand latest releasev2.338.2):_maxCountPerIssueType = 10, enforced inAddIssue. Diagnostics beyond the cap are still written to the log but are not annotated.Changes:
problem-matchernow defaults tofalseinaction.yml, and the runtime fallback insrc/problem-matcher.tsmatches.problem-matcher: trueregisters the same.github/java.jsonmatcher as before. Matcher patterns, compiler log output, and build failure behavior are unchanged.turestill fail through the shared boolean parser.docs/advanced-usage.mdnow describe the opt-in behavior with an enabling example.dist/setup/index.jswas regenerated withnpm run build.Note for reviewers: this changes default behavior. Workflows that relied on implicit annotations must add
problem-matcher: trueto keep them. Omitting the input only stops this invocation from registering the matcher. It does not unregister matchers added by other steps.Related issue:
Fixes: #1322
Check list:
npm run checklocally (format, lint, build, test) and all checks pass.npm run format-check: passednpm run lint: passednpm run build: passed (pre-push hook)npm test: passed, 45 suites / 1718 tests (pre-push hook)