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

AggregatingProblemConsumer causes problems to be reported twice #28215

Closed
Arthurm1 opened this issue Feb 23, 2024 · 1 comment · Fixed by #28396
Closed

AggregatingProblemConsumer causes problems to be reported twice #28215

Arthurm1 opened this issue Feb 23, 2024 · 1 comment · Fixed by #28396
Assignees
Labels
Milestone

Comments

@Arthurm1
Copy link

Current Behavior

Not sure if this is by design, and I realise the API is incubating, but if you have a java file with a single warning at compile time then a ProgressListener with type OperationType.PROBLEMS will receive a single ProgressEvent with descriptor of type ProblemDescriptor containing the warning info. That's all as expected.

If there is more than 1 java warning in the file then the ProgressListener will receive the same single ProgressEvent with type ProblemDescriptor but then will receive no more ProblemDescriptor types but instead will receive a single event with a ProblemAggregationDescriptor descriptor. This will contain all the warnings but will also include the already reported warning.

Is the aggregated descriptor supposed to contain the warning that's already been reported on? If so, can I always assume that the first in the list of aggregated problems will have already been reported and I can ignore it? If not, then can it be not be added to the aggregated problems?

Expected Behavior

For the aggregation to not contain any problems already passed on to the listener.

Context (optional)

I'm trying to report on compiler warnings/errors and I don't really want to have to record all the events I receive and make sure they're not duplicates. If I can always ignore the first aggregated problem then that's fine.

Steps to Reproduce

Create a basic java project with a single java class and ensure there are multiple warnings in the code.

Run the :classes task with a ProgressListener of type OperationType.PROBLEMS. I use the Tooling API for this.

Note the ProgressEvents with descriptors of type ProblemAggregationDescriptor and ProblemDescriptor.

The code appears to be here

Gradle version

8.7-rc-1

Build scan URL (optional)

No response

Your Environment (optional)

No response

@ov7a
Copy link
Member

ov7a commented Feb 28, 2024

This issue needs a decision from the team responsible for that area. They have been informed. Response time may vary.

@ov7a ov7a added in:problems problems api 👋 team-triage Issues that need to be triaged by a specific team and removed to-triage labels Feb 28, 2024
@donat donat removed the 👋 team-triage Issues that need to be triaged by a specific team label Mar 4, 2024
@reinsch82 reinsch82 linked a pull request Mar 8, 2024 that will close this issue
@bot-gradle bot-gradle added this to the 8.8 RC1 milestone Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants