Skip to content

feat(firestore): add DML stages, literals source, and atomic execution option to iOS SDK pipelines - #16859

Merged
ncooke3 merged 7 commits into
mainfrom
feat-ios-pipeline-dml
Oct 15, 2026
Merged

ncooke3 merged 7 commits into
mainfrom
feat-ios-pipeline-dml

Conversation

@wu-hui

@wu-hui wu-hui commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Supersedes #16500 (migrated from fork branch wu-hui:feat-ios-pipeline-dml to firebase:feat-ios-pipeline-dml so xcodetest_prod and xcodetest_nightly integration tests run in CI; public API previously approved by @ncooke3 in #16500).

Summary

Adds complete DML stages (DeleteStage, UpdateStage, InsertStage, UpsertStage), Literals source (LiteralsSourceStage), and atomic execution option (ExecuteOptions(isAtomic:)) to the iOS SDK (firebase-ios-sdk) Firestore Pipelines subsystem across the 3-layer architecture (C++ Core, Objective-C++ Bridge, Swift Public API).

Key Changes

  • Layer 3 — C++ Core (Firestore/core/src/api/ & remote/):
    • Implemented DeleteStage, UpdateStage, InsertStage, UpsertStage, and LiteralsSource classes in stages.h / stages.cc.
    • Added atomic execution flag support to Pipeline in pipeline.h / pipeline.cc and configured transaction options (new_transaction with ConcurrencyMode::OPTIMISTIC + auto_commit_transaction = true) in remote_objc_bridge.cc.
    • Regenerated Nanopb and C++ protobuf descriptors for google/firestore/v1/common.proto and firestore.proto.
  • Layer 2 — Objective-C++ Bridge (Firestore/Source/API/):
    • Declared __DeleteStageBridge, __UpdateStageBridge, __InsertStageBridge, __UpsertStageBridge, and __LiteralsSourceStageBridge classes in FIRPipelineBridge.h and implemented in FIRPipelineBridge.mm.
    • Updated __FIRPipelineBridge initializer to pass the atomic execution flag down to C++ Core.
  • Layer 1 — Swift Public API (Firestore/Swift/Source/):
    • Added Swift Stage class definitions in Stages.swift.
    • Added literals(...) entry point methods to PipelineSource.swift.
    • Added delete(), update(...), insert(...), upsert(...), and Pipeline.ExecuteOptions(isAtomic:) to Pipeline.swift.
  • Verification & Unit/Integration Test Suites:
    • Added C++ serializer unit tests (EncodesExecutePipelineRequestWithAtomic, EncodesExecutePipelineRequestSetAtomic) in Firestore/core/test/unit/remote/serializer_test.cc.
    • Implemented 25-test DML integration suite in Firestore/Swift/Tests/Integration/PipelineDmlTests.swift matching Web, Node, and Android test coverage.

Testing

  • Local CMake/Ninja unit test suite (ctest --output-on-failure in build/): 15/15 test suites passed (100%), including firestore_remote_test (236/236 passed).
  • Local style & lint verification: ./scripts/style.sh test-only origin/main, ./scripts/check_lint.py, ./scripts/check_whitespace.sh, ./scripts/check_copyright.sh, ./scripts/check_test_inclusion.py, and swift ./scripts/check_imports.swift passed with 0 errors.

Breaking Changes

None (additive public API on PipelineSource and Pipeline).

Buganizer Ticket

Fixes http://b/545234002 (under umbrella http://b/500350942)

@gemini-code-assist

Copy link
Copy Markdown
Contributor
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

…n option to iOS SDK pipelines

BUG=b/545234002
TAG=agy
cherylEnkidu and others added 3 commits October 8, 2026 20:06
The upsert docs said an existing document has its fields updated. The
backend replaces the whole document, so fields missing from the input are
removed. The in-place overloads write to the path in each input document's
`__name__` field and fail for inputs without one; the target-collection
overload reuses the input document's ID or generates one.

The in-place array example now upserts an existing document.
@dlarocque
dlarocque self-requested a review October 9, 2026 19:40
Comment thread Firestore/Swift/Source/SwiftAPI/Pipeline/Pipeline.swift Outdated
Comment thread Firestore/Source/Public/FirebaseFirestore/FIRPipelineBridge.h
@dlarocque
dlarocque requested a review from ncooke3 October 14, 2026 18:52

@ncooke3 ncooke3 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM on in-progress spm-binary update and resulting green CI.

Comment thread Firestore/Swift/Source/SwiftAPI/Pipeline/Pipeline.swift
Comment thread Firestore/Swift/Source/SwiftAPI/Pipeline/Pipeline.swift Outdated
Comment thread Firestore/core/src/api/pipeline.h
@ncooke3 ncooke3 assigned ncooke3 and unassigned cherylEnkidu Oct 14, 2026
@ncooke3
ncooke3 merged commit 89f0174 into main Oct 15, 2026
99 of 108 checks passed
@ncooke3
ncooke3 deleted the feat-ios-pipeline-dml branch October 15, 2026 02:03
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.

4 participants