question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Resilience of the `buildTarget/*` requests

See original GitHub issue

The requests of the form buildTarget/* take a sequence of build target identifiers as paramater and expect a sequence of result items as response, each item corresponding to one of the build target identifier.

For example, the buildTarget/source params are

export interface SourcesParams {
  targets: BuildTargetIdentifier[];
}

and result is:

export interface SourcesResult {
  items: SourcesItem[];
}

But what if the request fails on a single build target:

  1. should the server fails the entire request and returns an error response?
  2. should it returns an incomplete result and ignore the failed build target?

sbt does 1 which is probably not a good idea because we don’t want the entire build import to fail if one build target fails. Bloop does 2 but that’s not fully satisfying either because the build client doesn’t really know why some build targets are missing.

So I propose to augment every buildTarget/* response with a new failedTargets field which must contain the build target failures.

export interface FailedBuildTarget {
  target: BuildTargetIdentifier;
  code: integer;
  message: string;
  data?: string | number | boolean | array | object | null;
}
export interface SourcesResult {
  items: SourcesItem[];
  failedTargets: FailedBuildTarget[];
}

Do you think this is the correct approach for this problem?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
adpi2commented, Jul 30, 2021

Either that or do you think it’d be useful to also have space for an error or message?

Yes of course. I am just saying that code is probably useless but message should be mandatory and we can also have an optional data.

export interface FailedBuildTarget {
  target: BuildTargetIdentifier;
  message: string;
  data?: string | number | boolean | array | object | null;
}

What would IDEs do with the failures? Would they show a message saying that some build targets could not be resolved?

It’s up to them.

Also I agree with @ckipp01 that it’s not a good idea to swallow a failure. In general I think if one of the buildTarget/scalacOptions, buildTarget/dependencySources, buildTarget/sources fails the client should clearly states that the import of some build targets failed.

In Metals, the build target error messages could be displayed in the doctor section.

Build target scalacOptions sources dependencySources message
foo
bar x Error downloading some-library_2.13:1.2.3
fizz x Failed source generation
1reaction
ckipp01commented, Jul 30, 2021

What should code be in FailedBuildTarget?

Probably we don’t need it.

Either that or do you think it’d be useful to also have space for an error or message? Something like:

export interface FailedBuildTarget {
  id: BuildTargetIdentifier;
  message?: String;
}

😆 I someone totally missed that you had an even more robust version up above. Just ignore me, I need to learn how to read fully.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Scripting API: BuildTarget - Unity - Manual
Attributes. OverlayAttribute. UnityEditor.PackageManager. UnityEditor.PackageManager.Requests. Classes. AddAndRemoveRequest.
Read more >
Idempotent APIs — Tips to build resilient apps - ORFIUM
API resiliency refers to the idea that we build APIs which are able to ... Clients should use exponential backoff for all requests...
Read more >
Grid Resilience To Climate Change - Sia Partners
Ensuring employee buy-in in the face of climate change and the need to adapt;; Embarking teams with a co-build target organization to face ......
Read more >
master - platform/external/v4l2_codec2 - Git at Google
The component implementation delegates the request to the driver via the V4L2 ... PRODUCT_SOONG_NAMESPACES += external/v4l2_codec2 # Add the build target.
Read more >
I.I.I. Strategy & Execution - Insurance Information Institute
activity -- catastrophe resilience, economic growth, innovation, and ... Requests fulfilled by ... Build target audiences and influencers to engage with.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found