Skip to content

Conversation

donat
Copy link
Member

@donat donat commented Dec 20, 2024

In other words, the definition of ProblemId is moved from ProblemSpec to a method argument of ProblemReporter members.

Context

Reviewing cheatsheet

Before merging the PR, comments starting with

  • ❌ ❓must be fixed
  • 🤔 💅 should be fixed
  • 💭 may be fixed
  • 🎉 celebrate happy things

@donat

This comment has been minimized.

@bot-gradle

This comment has been minimized.

@donat

This comment has been minimized.

@bot-gradle

This comment has been minimized.

@bot-gradle

This comment has been minimized.

@bot-gradle

This comment has been minimized.

@donat donat force-pushed the donat/problems/stabilization-step5 branch from 1bcb568 to ef71a9d Compare December 20, 2024 14:49
@donat

This comment has been minimized.

@bot-gradle

This comment has been minimized.

@donat

This comment has been minimized.

@bot-gradle

This comment has been minimized.

@donat donat changed the base branch from master to donat/problems/stabilization-step4 December 20, 2024 15:18
@donat donat changed the title Donat/problems/stabilization step5 ProblemReporter methods take all mandatory info as arguments Dec 20, 2024
@bot-gradle

This comment has been minimized.

@donat donat force-pushed the donat/problems/stabilization-step4 branch 2 times, most recently from e2cc233 to 11eac63 Compare December 23, 2024 13:38
@donat donat marked this pull request as ready for review December 24, 2024 09:26
@donat donat requested review from a team as code owners December 24, 2024 09:26
@donat donat requested a review from a team December 24, 2024 09:26
@donat donat requested review from a team as code owners December 24, 2024 09:26
@donat donat requested review from a team, hegyibalint and jvandort and removed request for a team December 24, 2024 09:26
Copy link
Member

@hegyibalint hegyibalint left a comment

Choose a reason for hiding this comment

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

Replied to comments, PTAL.
No blockers from my side anymore: can be merged!

public void execute() {
Exception wrappedException = new Exception("Wrapped cause");
getProblems().getReporter().throwing(${targetVersion >= GradleVersion.version('8.13') ? 'new RuntimeException("Exception message", wrappedException), ' : ''}problem -> problem
getProblems().getReporter().throwing(${targetVersion >= GradleVersion.version('8.13') ? 'new RuntimeException("Exception message", wrappedException), ' + ProblemsApiGroovyScriptUtils.createIdExpression() + ', ' : ''}problem -> problem
Copy link
Member

Choose a reason for hiding this comment

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

💭 This is not exactly what I meant – if your change is based on my feedback. My idea is to create completely separate, even if repetitive, methods for reporting a problem. In this case, that would be from L140:144.

What you did is also fine; I'm just expressing that this wasn't my exact idea.

String contextualMessage = String.format("The 'tools.jar' cannot be found in the JDK '%s'.", jvm.getJavaHome());
throw problemReporter.throwing(new IllegalStateException(contextualMessage), problemSpec -> problemSpec
.id(ProblemId.create("groovy-daemon-compiler", "Missing tools.jar", GradleCoreProblemGroup.compilation().groovy()))
ProblemId problemId = ProblemId.create("groovy-daemon-compiler", "Missing tools.jar", GradleCoreProblemGroup.compilation().groovy());
Copy link
Member

Choose a reason for hiding this comment

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

As I said, I have no strong preferences over here. I still think this is a sort of infrastructure problem, and this doesn't communicate that well. OTOH the importance of this is really low.

It's more about thinking and establishing best practices, which we could document for the larger community.

// This needs to be Java 6 compatible, as we are in a worker
getProblems().getReporter().report(problem -> problem
.id(org.gradle.api.problems.ProblemId.create("type", "label", org.gradle.api.problems.ProblemGroup.create("generic", "Generic")))
getProblems().getReporter().report(org.gradle.api.problems.ProblemId.create("type", "label", org.gradle.api.problems.ProblemGroup.create("generic", "Generic")), problem -> problem
Copy link
Member

Choose a reason for hiding this comment

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

You gave a 👍 but I don't see any change related to this. Can you confirm?

@bot-gradle

This comment has been minimized.

@donat

This comment has been minimized.

@bot-gradle bot-gradle added this pull request to the merge queue Jan 2, 2025
@bot-gradle bot-gradle added this to the 8.13 RC1 milestone Jan 2, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 2, 2025
@donat

This comment has been minimized.

@bot-gradle bot-gradle added this pull request to the merge queue Jan 2, 2025
@donat donat removed this pull request from the merge queue due to a manual request Jan 2, 2025
@donat donat force-pushed the donat/problems/stabilization-step5 branch from c793ec2 to 22718a4 Compare January 2, 2025 15:25
@donat

This comment has been minimized.

@bot-gradle bot-gradle added this pull request to the merge queue Jan 2, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 2, 2025
@donat donat force-pushed the donat/problems/stabilization-step5 branch from 22718a4 to 265a6dd Compare January 2, 2025 15:45
@donat

This comment has been minimized.

@bot-gradle bot-gradle added this pull request to the merge queue Jan 2, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 2, 2025
@donat donat force-pushed the donat/problems/stabilization-step5 branch from 265a6dd to 979cf3e Compare January 2, 2025 16:27
@donat

This comment has been minimized.

@bot-gradle

This comment has been minimized.

@bot-gradle
Copy link
Collaborator

The following builds have failed:

@gradle gradle deleted a comment from MrG9090 Jan 3, 2025
@donat donat force-pushed the donat/problems/stabilization-step5 branch from 979cf3e to 7d156fb Compare January 3, 2025 08:33
@donat
Copy link
Member Author

donat commented Jan 3, 2025

@bot-gradle merge

@bot-gradle bot-gradle added this pull request to the merge queue Jan 3, 2025
Merged via the queue into master with commit 902f50a Jan 3, 2025
22 checks passed
@bot-gradle bot-gradle deleted the donat/problems/stabilization-step5 branch January 3, 2025 10:30
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.

3 participants