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

Add Problems to GradleEnterprisePluginEndOfBuildListener.BuildResult #28854

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

reinsch82
Copy link
Contributor

Reviewing cheatsheet

Before merging the PR, comments starting with

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

@reinsch82 reinsch82 self-assigned this Apr 17, 2024
@reinsch82 reinsch82 force-pushed the reinhold/problems/get-problems-for-exceptions-in-other-buildresult branch from 9b8d83e to b912930 Compare April 17, 2024 12:04
@gradle gradle deleted a comment from reinsch82 Apr 17, 2024
@reinsch82 reinsch82 force-pushed the reinhold/problems/get-problems-for-exceptions-in-other-buildresult branch from 9eccbde to cecb334 Compare April 18, 2024 10:19
@gradle gradle deleted a comment from reinsch82 Apr 18, 2024
@reinsch82 reinsch82 force-pushed the reinhold/problems/get-problems-for-exceptions-in-other-buildresult branch from cecb334 to cb8dd3f Compare April 18, 2024 12:05
@gradle gradle deleted a comment from reinsch82 Apr 18, 2024
@reinsch82 reinsch82 force-pushed the reinhold/problems/get-problems-for-exceptions-in-other-buildresult branch 2 times, most recently from 9b3fad8 to 946ae11 Compare April 18, 2024 13:16
@reinsch82 reinsch82 marked this pull request as ready for review April 18, 2024 13:16
@reinsch82 reinsch82 requested review from a team and ldaley as code owners April 18, 2024 13:16
@reinsch82 reinsch82 requested review from bamboo and abstratt and removed request for a team April 18, 2024 13:17
@reinsch82 reinsch82 force-pushed the reinhold/problems/get-problems-for-exceptions-in-other-buildresult branch from 946ae11 to da1ba3f Compare April 18, 2024 13:20
@gradle gradle deleted a comment from reinsch82 Apr 18, 2024
@reinsch82 reinsch82 force-pushed the reinhold/problems/get-problems-for-exceptions-in-other-buildresult branch from 07efcb0 to be7a6b7 Compare April 19, 2024 05:48
@gradle gradle deleted a comment from reinsch82 Apr 19, 2024
@ldaley ldaley removed their request for review April 19, 2024 06:21
@donat donat closed this Apr 19, 2024
@donat donat reopened this Apr 19, 2024
gradle.properties Show resolved Hide resolved
gradle.properties Show resolved Hide resolved
@@ -31,6 +34,8 @@ public interface GradleEnterprisePluginEndOfBuildListener {
interface BuildResult {
@Nullable
Throwable getFailure();

Collection<Problem> getProblems();
Copy link
Member

Choose a reason for hiding this comment

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

🤔 I'd still expect here that the Collection<Problem> is for each individual failure. The getFailure() method often returns a MultiCauseException that needs to be converted to a list of individual failures by the Develocity plugin. Each of those failures needs to be associated to problems.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean a Map of the Failures associated with the value returned by getFailure to the Problems of these individual Failures?

Copy link
Member

Choose a reason for hiding this comment

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

I think I want an actual new Failuretype here that wraps the problems/causes/stacktraces. Like I said, I can do that as long as I can query something.
Maybe having a method getProblemsFor(Throwable failure) would be better for now and I can take it from there.

@@ -57,14 +63,16 @@ public DefaultGradleEnterprisePluginAdapter(
DefaultGradleEnterprisePluginRequiredServices requiredServices,
GradleEnterprisePluginBuildState buildState,
DefaultGradleEnterprisePluginServiceRef pluginServiceRef,
BuildOperationNotificationListenerRegistrar buildOperationNotificationListenerRegistrar
BuildOperationNotificationListenerRegistrar buildOperationNotificationListenerRegistrar,
Multimap<Throwable, Problem> problemsMapping
Copy link
Member

Choose a reason for hiding this comment

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

❌ We should provide our own service here, instead of directly exposing Multimap.

while(buildFailure != null) {
Collection<Problem> problems = problemsMapping.get(buildFailure);
builder.addAll(problems);
buildFailure = buildFailure.getCause();
Copy link
Member

Choose a reason for hiding this comment

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

❌ I don't think this works for a MultiCauseException, where you'd have multiple causes.

@@ -95,14 +103,28 @@ public void buildFinished(@Nullable Throwable buildFailure) {
public Throwable getFailure() {
return buildFailure;
}

@Override
public Collection<Problem> getProblems() {
Copy link
Member

Choose a reason for hiding this comment

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

🤔 It would be very good to be able to obtain the problems for each cause of the failure individually. That is something I can build on top of the infrastructure you provide here.

@@ -16,44 +16,55 @@

package org.gradle.internal.enterprise


Copy link
Member

Choose a reason for hiding this comment

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

💅 Extra newline.

@@ -57,30 +65,25 @@ public RuntimeException throwing(Action<ProblemSpec> spec) {

public RuntimeException throwError(RuntimeException exception, Problem problem) {
report(problem);
problems.put(exception, problem);
Copy link
Member

Choose a reason for hiding this comment

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

❓ Why do we only associate the exception to the problem when we throw the exception via the Problem API? I think every time we report a problem that has an exception we should associate it, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

makes sense, yes.

reinsch82 added a commit that referenced this pull request Apr 23, 2024
reinsch82 added a commit that referenced this pull request Apr 23, 2024
@reinsch82 reinsch82 force-pushed the reinhold/problems/get-problems-for-exceptions-in-other-buildresult branch from 19d8b1b to 5b3f540 Compare April 23, 2024 12:18
@reinsch82 reinsch82 requested a review from wolfs April 23, 2024 12:34
@gradle gradle deleted a comment from reinsch82 Apr 23, 2024
reinsch82 added a commit that referenced this pull request Apr 24, 2024
@reinsch82 reinsch82 force-pushed the reinhold/problems/get-problems-for-exceptions-in-other-buildresult branch from 5b3f540 to ca782b9 Compare April 24, 2024 11:34
@gradle gradle deleted a comment from reinsch82 Apr 24, 2024
@reinsch82 reinsch82 force-pushed the reinhold/problems/get-problems-for-exceptions-in-other-buildresult branch from ca782b9 to e077238 Compare April 26, 2024 11:11
@reinsch82
Copy link
Contributor Author

@bot-gradle PRF

@gradle gradle deleted a comment from reinsch82 Apr 26, 2024
@bot-gradle
Copy link
Collaborator

Sorry I don't understand what you said.
Currently, the following commands are supported:

@bot-gradle test <BuildTrigger1> <BuildTrigger2> ... <BuildTriggerN> [without PTS]

Add without PTS to run the build with full test coverage.

  • A trigger is a special build for this PR on TeamCity, common triggers are:
    • SanityCheck/CompileAll/QuickFeedbackLinux/QuickFeedback/PullRequestFeedback/ReadyForNightly/ReadyForRelease
    • Shortcuts: SC/CA/QFL/QF/PRF/RFN/RFR
    • Specific builds:
      • BD: BuildDistributions/BuildDocs so that you can preview the generated docs/distribution.
      • PT: PerformanceTest, all performance tests for Ready For Nightly stage.
      • APT: AllPerformanceTest, all performance tests, including slow performance tests.
      • AST: AllSmokeTestsPullRequestFeedback
      • AFT: AllFunctionalTestsPullRequestFeedback
      • ASB: AllSpecificBuildsPullRequestFeedback
      • ACC: AllConfigCacheTestsPullRequestFeedback
      • ACT: AllCrossVersionTestsReadyForNightly
      • AFTN: AllFunctionalTestsReadyForNightly
      • ACTR: AllCrossVersionTestsReadyForRelease
      • AFTR: AllFunctionalTestsReadyForRelease

@bot-gradle squash

  • Squash the current pull request into a single commit. The squash message will come from the pull request body, with:
    • All Signed-off-by: lines kept.
    • All authors being Co-Authored-By:

@bot-gradle merge

  • Enqueue this PR into GitHub merge queue for merging.
    • GitHub will create a merge commit from your PR branch HEAD and the target branch
    • A GitHub Merge Queue Check Pass build will be triggered on the merge commit
    • When the build passes, the target branch will be fast-forwarded to this merge commit (i.e. merge the PR)

@bot-gradle squash and merge

  • Squash the current pull request into a single commit as described in squash command above,
    then enqueue this PR into GitHub merge queue as described in merge command above.

@bot-gradle cherrypick to <branch>

  • Cherrypicks the current PR to another branch.
    A new PR will be created and a build will triggered automatically if there is no conflict.

@bot-gradle cancel

  • cancel a running build in GitHub merge queue and remove the PR from the queue

@bot-gradle clean

  • clear the conversation history

@bot-gradle help

  • display this message

To run a command, simply submit a comment. For detailed instructions see here.

@reinsch82
Copy link
Contributor Author

@bot-gradle test PRF

@gradle gradle deleted a comment from reinsch82 Apr 26, 2024
@bot-gradle
Copy link
Collaborator

I've triggered the following builds for you. Click here to see all build failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants