driver: propagate feature detection errors - #4085
Conversation
39d95b3 to
8ee4cac
Compare
Return feature detection errors through the driver interface and cache only successful Docker worker probes so transient failures can be retried. Resolve features before constructing build options and reuse that result for capability checks. This prevents failed probes from silently disabling default provenance before a later successful probe allows the build to proceed. Report detection failures in debug inspection and cover retries, caching, and provenance preservation. Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
8ee4cac to
4b5e0a2
Compare
jsternberg
left a comment
There was a problem hiding this comment.
One comment to just assess my understanding of the PR but LGTM if my understanding is correct.
| }, nil | ||
| }) | ||
| return d.features.list | ||
| } |
There was a problem hiding this comment.
So the main thing here is changing this specific driver to make a new request each time the method is called rather than using once to only call it once and then changing the places that call this to avoid treating this as a "free" call because it no longer caches the result.
I think this is fine I just wanted to confirm that I was understanding the intent correctly.
There was a problem hiding this comment.
Yes almost 😅 Features still caches a successful ListWorkers result, so later calls don't make another request. The change is that a failed probe returns an error without caching "unsupported"; a subsequent call can retry. Build option setup uses one successful result for its capability checks, including provenance, so those decisions stay consistent.
needs #4082fixes #3266
Address the Docker driver
ListWorkersfeature cache. Return detection errors through the driver interface and cache only successful results, so transient failures can be retried without being mistaken for unsupported capabilities.This was deferred from #4082 because safely retrying failed probes requires updating the driver interface and its callers. Without error propagation, an early failure could disable default provenance while a later successful probe allows the build to proceed without it. Resolve features before constructing build options and reuse the successful result for capability checks, ensuring detection failures stop the build instead of silently changing its output.