Expose last build outcome via BuildStateService#2903
Open
jainapurva wants to merge 1 commit into
Open
Conversation
Adds a small, read-only `BuildStateService` that records the result (output, errors, timestamp, success) of the most recent compile or upload. `CoreServiceImpl` writes to it from the existing `compile` and `upload` flows; recording failures are swallowed so the service can never affect a real build. The service is observational and additive. No existing behavior changes; no default UI consumes it yet. The motivation is to let contributions (e.g. a future AI assistant plugin, a "rerun last build" widget, a CI integration test) read the latest build state without re-running the build themselves. Wired as a JSON-RPC service at `/services/build-state` following the same pattern as the other shared backend services in `arduino-ide-backend-module.ts`.
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
There is no in-process way today for an Arduino IDE contribution to read the result of the last
compile/uploadwithout re-running the build. This is a recurring pain point for anything that wants to react to build outcomes — "rerun the last failed build" UI, build-history widgets, CI integration helpers, third-party assistants, etc.What this PR adds
A small, read-only
BuildStateService(underarduino-ide-extension/src/common/protocol/andnode/) that captures the result of the most recent compile or upload:CoreServiceImplwrites to it from the existingcompileanduploadflows. The recording call is wrapped so that failures are swallowed —BuildStateServiceis observational and can never break a real build.Exposed as a JSON-RPC service at
/services/build-statefollowing the samebind/ConnectionHandler/JsonRpcConnectionHandlerpattern as the other shared backend services.Why now
We're building a third-party AI assistant plugin on top of Arduino IDE 2.x and ran into this gap. Rather than fork, we'd like the service upstream so anyone (including future first-party features like a build-history view) can consume it.
The PR is intentionally scoped to just the service:
getLastBuild()Testing
npx tsc --noEmitpasses againstarduino-ide-extensionyarn buildScope
Strictly one enhancement, per the PR guidelines. Happy to split further if reviewers prefer (e.g. service interface in one commit,
CoreServiceImplhook in another), but it's currently a single atomic commit.Related
Part of an RFC we've drafted around small extension points that would let AI assistant plugins exist without forking. Posting that as a Discussion separately; this PR stands on its own merits.