Repository navigation
feat(firestore): add builder API to FirestoreDatabaseRunner - #1957
Open
mohan-ganesh wants to merge 1 commit into
Open
mohan-ganesh wants to merge 1 commit into
mohan-ganesh wants to merge 1 commit into
Conversation
mohan-ganesh
force-pushed
the
firestore-builder-pattern
branch
2 times, most recently
from
November 29, 2026 23:26
9b459ba to
b6b4d76
Compare
sahuadarsh0
reviewed
Nov 30, 2026
mohan-ganesh
force-pushed
the
firestore-builder-pattern
branch
from
November 30, 2026 15:56
b6b4d76 to
395f3b0
Compare
- Add FirestoreDatabaseRunner.newBuilder() and create(...) factory methods, mirroring the Runner.builder() pattern already established in core ADK - Deprecate legacy constructors (@deprecated + @SuppressWarnings placed to match how Runner deprecated its own constructors) - Default to InMemoryArtifactService with logger.warn when no GCS bucket is configured, replacing the previous startup RuntimeException - Rename property key firebase->firestore with legacy fallback - Improve branch coverage 83%->89% with 99 tests passing - Update README with Quick Start, builder API reference, and migration guide
mohan-ganesh
force-pushed
the
firestore-builder-pattern
branch
from
November 30, 2026 22:57
395f3b0 to
5cf5c3a
Compare
Contributor
Author
|
Hey @glaforge @hemasekhar-p I have had PR#1957 open (adds a builder API to FirestoreDatabaseRunner, mirroring the pattern from Runner.builder()). I would appreciate your help getting the right reviewer's attention. Thanks |
Contributor
|
Hi @mohan-ganesh, We greatly appreciate your contribution and the effort you put into this pull request. It is currently under review by our team. We will notify you if any additional details are needed. |
mohan-ganesh
force-pushed
the
firestore-builder-pattern
branch
2 times, most recently
from
December 4, 2026 22:02
fd27da8 to
5cf5c3a
Compare
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.
FirestoreDatabaseRunnerpreviously requiredgcs.adk.bucket.nameat start up and offered no way to inject services without subclassing. All changes here are confined to the firestore-session-service contrib module and are bundled because they share the same migration path: the builder API, constructor deprecation, the property key rename and documentation all need to land together to give a coherent upgrade experience from constructor-based API.Problem
FirestoreDatabaseRunnerrequiredgcs.adk.bucket.nameto be set in a properties file at startup. If the property was missing, the constructor threw aRuntimeException— even for text-only agents that never produce file artifacts. This made development and testing unnecessarily difficult.Additionally, the constructor-only API had three overloads with no way to inject custom session, memory, or artifact services without subclassing, making it hard to test and impossible to extend cleanly.
Solution
Adds a builder API to FirestoreDatabaseRunner, mirroring the pattern already established by Runner.builder() in core ADK — where the Runner constructors are themselves deprecated in favour of Runner.Builder.
New API
// Minimal — no GCS bucket required for text agents
Runner runner = FirestoreDatabaseRunner.newBuilder()
.agent(agent)
.firestore(FirestoreOptions.getDefaultInstance().getService())
.build();
// With explicit GCS artifact storage
Runner runner = FirestoreDatabaseRunner.newBuilder()
.agent(agent)
.firestore(firestore)
.withGcsArtifacts("my-bucket")
.build();
// Full control — inject any service
Runner runner = FirestoreDatabaseRunner.newBuilder()
.agent(agent)
.firestore(firestore)
.sessionService(customSessionService)
.artifactService(new InMemoryArtifactService())
.instantSource(fixedClock)
.build();
Key design decisions
Artifact service resolution (builder path)
Legacy constructors — deprecated, not removed
The three existing constructors are marked
@Deprecatedwith@deprecated Use {@link #newBuilder()}javadoc, consistent with how Runner deprecated its own constructors. The @SuppressWarnings("deprecation") annotations areplaced correctly:The legacy constructors no longer throw when no GCS bucket is configured — they fall back to
InMemoryArtifactServiceand emit a logger.warn(...) so operators are aware that artifacts will be ephemeral. This is a deliberate behaviour change from the previous fail-fast approach.Testing
Documentation
contrib/firestore-session-service/README.md updated with:
Added unit test for all the incremental changes and here is the test coverage snapshot.
Testing Plan
Ran
mvn -pl contrib/firestore-session-service test(with JaCoCo report generation):Unit Tests:
Please include a summary of passed java test results.
Checklist