Skip to content

Commit 6053192

Browse files
committed
Attempt to have nested class for realtime pipeline
1 parent cb3991c commit 6053192

File tree

9 files changed

+507
-440
lines changed

9 files changed

+507
-440
lines changed

.github/workflows/firestore_ci_tests.yml

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,85 @@ jobs:
250250
retention-days: 7
251251
if-no-files-found: ignore
252252

253+
firestore_emulator_integ_tests:
254+
name: "System Tests Against Emulator"
255+
runs-on: ubuntu-latest
256+
needs:
257+
- determine_changed
258+
# only run on post submit or PRs not originating from forks.
259+
if: ((github.repository == 'Firebase/firebase-android-sdk' && github.event_name == 'push') || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)) && contains(fromJSON(needs.determine_changed.outputs.modules), ':firebase-firestore')
260+
strategy:
261+
fail-fast: false
262+
263+
steps:
264+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
265+
with:
266+
fetch-depth: 2
267+
submodules: true
268+
269+
- name: Enable KVM
270+
run: |
271+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
272+
sudo udevadm control --reload-rules
273+
sudo udevadm trigger --name-match=kvm
274+
275+
- name: Add google-services.json
276+
env:
277+
INTEG_TESTS_GOOGLE_SERVICES: ${{ secrets.INTEG_TESTS_GOOGLE_SERVICES }}
278+
run: |
279+
echo $INTEG_TESTS_GOOGLE_SERVICES | base64 -d > firebase-firestore/google-services.json
280+
281+
- name: Set up JDK 21
282+
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
283+
with:
284+
java-version: 21
285+
distribution: temurin
286+
cache: gradle
287+
288+
- uses: google-github-actions/setup-gcloud@77e7a554d41e2ee56fc945c52dfd3f33d12def9a # v2.1.4
289+
290+
- name: Start Emulator
291+
env:
292+
EXPERIMENTAL_MODE: true
293+
run: |
294+
gcloud emulators firestore start --host-port=127.0.0.1:8080 --quiet &
295+
296+
- name: Set up JDK 17
297+
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
298+
with:
299+
java-version: 17
300+
distribution: temurin
301+
cache: gradle
302+
303+
- name: Firestore Emulator Integ Tests
304+
uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d #v2.33.0
305+
env:
306+
FIREBASE_CI: 1
307+
FTL_RESULTS_BUCKET: android-ci
308+
FTL_RESULTS_DIR: ${{ github.event_name == 'pull_request' && format('pr-logs/pull/{0}/{1}/{2}/{3}_{4}/artifacts/', github.repository, github.event.pull_request.number, github.job, github.run_id, github.run_attempt) || format('logs/{0}/{1}_{2}/artifacts/', github.workflow, github.run_id, github.run_attempt)}}
309+
FIREBASE_APP_CHECK_DEBUG_SECRET: ${{ secrets.FIREBASE_APP_CHECK_DEBUG_SECRET }}
310+
with:
311+
api-level: 31
312+
arch: x86_64
313+
ram-size: 4096M
314+
heap-size: 4096M
315+
script: |
316+
adb logcat -v time > logcat.txt &
317+
./gradlew firebase-firestore:connectedCheck withErrorProne -PtargetBackend="emulator"
318+
- name: Upload logs
319+
if: failure()
320+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
321+
with:
322+
name: emulator-logcat.txt
323+
path: logcat.txt
324+
retention-days: 7
325+
if-no-files-found: ignore
326+
253327
check-required-tests:
254328
runs-on: ubuntu-latest
255329
if: always()
256330
name: Check all required Firestore tests results
257-
needs: [integ_tests, named_integ_tests]
331+
needs: [firestore_emulator_integ_tests]
258332
steps:
259333
- name: Check test matrix
260334
if: needs.integ_tests.result == 'failure' || needs.named_integ_tests.result == 'failure'

firebase-firestore/api.txt

Lines changed: 54 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -489,42 +489,6 @@ package com.google.firebase.firestore {
489489
property public final com.google.firebase.Timestamp? updateTime;
490490
}
491491

492-
public final class PipelineResultChange {
493-
method public com.google.firebase.firestore.PipelineResult component1();
494-
method public com.google.firebase.firestore.PipelineResultChange.ChangeType component2();
495-
method public Integer? component3();
496-
method public Integer? component4();
497-
method public com.google.firebase.firestore.PipelineResultChange copy(com.google.firebase.firestore.PipelineResult result, com.google.firebase.firestore.PipelineResultChange.ChangeType type, Integer? oldIndex, Integer? newIndex);
498-
method public Integer? getNewIndex();
499-
method public Integer? getOldIndex();
500-
method public com.google.firebase.firestore.PipelineResult getResult();
501-
method public com.google.firebase.firestore.PipelineResultChange.ChangeType getType();
502-
property public final Integer? newIndex;
503-
property public final Integer? oldIndex;
504-
property public final com.google.firebase.firestore.PipelineResult result;
505-
property public final com.google.firebase.firestore.PipelineResultChange.ChangeType type;
506-
field public static final com.google.firebase.firestore.PipelineResultChange.Companion Companion;
507-
}
508-
509-
public enum PipelineResultChange.ChangeType {
510-
enum_constant public static final com.google.firebase.firestore.PipelineResultChange.ChangeType ADDED;
511-
enum_constant public static final com.google.firebase.firestore.PipelineResultChange.ChangeType MODIFIED;
512-
enum_constant public static final com.google.firebase.firestore.PipelineResultChange.ChangeType REMOVED;
513-
}
514-
515-
public static final class PipelineResultChange.Companion {
516-
}
517-
518-
public final class PipelineSnapshotMetadata {
519-
method public boolean component1();
520-
method public boolean component2();
521-
method public com.google.firebase.firestore.PipelineSnapshotMetadata copy(boolean hasPendingWrites, boolean isConsistentBetweenListeners);
522-
method public boolean getHasPendingWrites();
523-
method public boolean isConsistentBetweenListeners();
524-
property public final boolean hasPendingWrites;
525-
property public final boolean isConsistentBetweenListeners;
526-
}
527-
528492
public final class PipelineSource {
529493
method public com.google.firebase.firestore.Pipeline collection(com.google.firebase.firestore.CollectionReference ref);
530494
method public com.google.firebase.firestore.Pipeline collection(com.google.firebase.firestore.CollectionReference ref, com.google.firebase.firestore.pipeline.CollectionSourceOptions options);
@@ -614,37 +578,73 @@ package com.google.firebase.firestore {
614578
}
615579

616580
public final class RealtimePipeline {
617-
method public com.google.firebase.firestore.ListenerRegistration addSnapshotListener(com.google.firebase.firestore.EventListener<com.google.firebase.firestore.RealtimePipelineSnapshot> listener);
618-
method public com.google.firebase.firestore.ListenerRegistration addSnapshotListener(com.google.firebase.firestore.RealtimePipelineOptions options, com.google.firebase.firestore.EventListener<com.google.firebase.firestore.RealtimePipelineSnapshot> listener);
619-
method public com.google.firebase.firestore.ListenerRegistration addSnapshotListener(java.util.concurrent.Executor executor, com.google.firebase.firestore.EventListener<com.google.firebase.firestore.RealtimePipelineSnapshot> listener);
620-
method public com.google.firebase.firestore.ListenerRegistration addSnapshotListener(java.util.concurrent.Executor executor, com.google.firebase.firestore.RealtimePipelineOptions options, com.google.firebase.firestore.EventListener<com.google.firebase.firestore.RealtimePipelineSnapshot> listener);
581+
method public com.google.firebase.firestore.ListenerRegistration addSnapshotListener(com.google.firebase.firestore.EventListener<com.google.firebase.firestore.RealtimePipeline.Snapshot> listener);
582+
method public com.google.firebase.firestore.ListenerRegistration addSnapshotListener(com.google.firebase.firestore.RealtimePipeline.ListenOptions options, com.google.firebase.firestore.EventListener<com.google.firebase.firestore.RealtimePipeline.Snapshot> listener);
583+
method public com.google.firebase.firestore.ListenerRegistration addSnapshotListener(java.util.concurrent.Executor executor, com.google.firebase.firestore.EventListener<com.google.firebase.firestore.RealtimePipeline.Snapshot> listener);
584+
method public com.google.firebase.firestore.ListenerRegistration addSnapshotListener(java.util.concurrent.Executor executor, com.google.firebase.firestore.RealtimePipeline.ListenOptions options, com.google.firebase.firestore.EventListener<com.google.firebase.firestore.RealtimePipeline.Snapshot> listener);
621585
method public com.google.firebase.firestore.RealtimePipeline limit(int limit);
622-
method public kotlinx.coroutines.flow.Flow<com.google.firebase.firestore.RealtimePipelineSnapshot> snapshots();
623-
method public kotlinx.coroutines.flow.Flow<com.google.firebase.firestore.RealtimePipelineSnapshot> snapshots(com.google.firebase.firestore.RealtimePipelineOptions options);
586+
method public kotlinx.coroutines.flow.Flow<com.google.firebase.firestore.RealtimePipeline.Snapshot> snapshots();
587+
method public kotlinx.coroutines.flow.Flow<com.google.firebase.firestore.RealtimePipeline.Snapshot> snapshots(com.google.firebase.firestore.RealtimePipeline.ListenOptions options);
624588
method public com.google.firebase.firestore.RealtimePipeline sort(com.google.firebase.firestore.pipeline.Ordering order, com.google.firebase.firestore.pipeline.Ordering... additionalOrders);
625589
method public com.google.firebase.firestore.RealtimePipeline where(com.google.firebase.firestore.pipeline.BooleanExpression condition);
626590
}
627591

628-
public final class RealtimePipelineOptions {
629-
ctor public RealtimePipelineOptions();
630-
method public com.google.firebase.firestore.RealtimePipelineOptions withMetadataChanges(com.google.firebase.firestore.MetadataChanges metadataChanges);
631-
method public com.google.firebase.firestore.RealtimePipelineOptions withServerTimestampBehavior(com.google.firebase.firestore.DocumentSnapshot.ServerTimestampBehavior serverTimestampBehavior);
632-
method public com.google.firebase.firestore.RealtimePipelineOptions withSource(com.google.firebase.firestore.ListenSource source);
633-
field public static final com.google.firebase.firestore.RealtimePipelineOptions.Companion Companion;
634-
field public static final com.google.firebase.firestore.RealtimePipelineOptions DEFAULT;
592+
public static final class RealtimePipeline.ListenOptions {
593+
ctor public RealtimePipeline.ListenOptions();
594+
method public com.google.firebase.firestore.RealtimePipeline.ListenOptions withMetadataChanges(com.google.firebase.firestore.MetadataChanges metadataChanges);
595+
method public com.google.firebase.firestore.RealtimePipeline.ListenOptions withServerTimestampBehavior(com.google.firebase.firestore.DocumentSnapshot.ServerTimestampBehavior serverTimestampBehavior);
596+
method public com.google.firebase.firestore.RealtimePipeline.ListenOptions withSource(com.google.firebase.firestore.ListenSource source);
597+
field public static final com.google.firebase.firestore.RealtimePipeline.ListenOptions.Companion Companion;
598+
field public static final com.google.firebase.firestore.RealtimePipeline.ListenOptions DEFAULT;
635599
}
636600

637-
public static final class RealtimePipelineOptions.Companion {
601+
public static final class RealtimePipeline.ListenOptions.Companion {
638602
}
639603

640-
public final class RealtimePipelineSnapshot {
641-
method public java.util.List<com.google.firebase.firestore.PipelineResultChange> getChanges(com.google.firebase.firestore.MetadataChanges? metadataChanges = null);
642-
method public com.google.firebase.firestore.PipelineSnapshotMetadata getMetadata();
604+
public static final class RealtimePipeline.Snapshot {
605+
method public java.util.List<com.google.firebase.firestore.RealtimePipeline.Snapshot.ResultChange> getChanges(com.google.firebase.firestore.MetadataChanges? metadataChanges = null);
606+
method public com.google.firebase.firestore.RealtimePipeline.Snapshot.SnapshotMetadata getMetadata();
643607
method public java.util.List<com.google.firebase.firestore.PipelineResult> getResults();
644-
property public final com.google.firebase.firestore.PipelineSnapshotMetadata metadata;
608+
property public final com.google.firebase.firestore.RealtimePipeline.Snapshot.SnapshotMetadata metadata;
645609
property public final java.util.List<com.google.firebase.firestore.PipelineResult> results;
646610
}
647611

612+
public static final class RealtimePipeline.Snapshot.ResultChange {
613+
method public com.google.firebase.firestore.PipelineResult component1();
614+
method public com.google.firebase.firestore.RealtimePipeline.Snapshot.ResultChange.ChangeType component2();
615+
method public Integer? component3();
616+
method public Integer? component4();
617+
method public com.google.firebase.firestore.RealtimePipeline.Snapshot.ResultChange copy(com.google.firebase.firestore.PipelineResult result, com.google.firebase.firestore.RealtimePipeline.Snapshot.ResultChange.ChangeType type, Integer? oldIndex, Integer? newIndex);
618+
method public Integer? getNewIndex();
619+
method public Integer? getOldIndex();
620+
method public com.google.firebase.firestore.PipelineResult getResult();
621+
method public com.google.firebase.firestore.RealtimePipeline.Snapshot.ResultChange.ChangeType getType();
622+
property public final Integer? newIndex;
623+
property public final Integer? oldIndex;
624+
property public final com.google.firebase.firestore.PipelineResult result;
625+
property public final com.google.firebase.firestore.RealtimePipeline.Snapshot.ResultChange.ChangeType type;
626+
field public static final com.google.firebase.firestore.RealtimePipeline.Snapshot.ResultChange.Companion Companion;
627+
}
628+
629+
public enum RealtimePipeline.Snapshot.ResultChange.ChangeType {
630+
enum_constant public static final com.google.firebase.firestore.RealtimePipeline.Snapshot.ResultChange.ChangeType ADDED;
631+
enum_constant public static final com.google.firebase.firestore.RealtimePipeline.Snapshot.ResultChange.ChangeType MODIFIED;
632+
enum_constant public static final com.google.firebase.firestore.RealtimePipeline.Snapshot.ResultChange.ChangeType REMOVED;
633+
}
634+
635+
public static final class RealtimePipeline.Snapshot.ResultChange.Companion {
636+
}
637+
638+
public static final class RealtimePipeline.Snapshot.SnapshotMetadata {
639+
method public boolean component1();
640+
method public boolean component2();
641+
method public com.google.firebase.firestore.RealtimePipeline.Snapshot.SnapshotMetadata copy(boolean hasPendingWrites, boolean isConsistentBetweenListeners);
642+
method public boolean getHasPendingWrites();
643+
method public boolean isConsistentBetweenListeners();
644+
property public final boolean hasPendingWrites;
645+
property public final boolean isConsistentBetweenListeners;
646+
}
647+
648648
public final class RealtimePipelineSource {
649649
method public com.google.firebase.firestore.RealtimePipeline collection(com.google.firebase.firestore.CollectionReference ref);
650650
method public com.google.firebase.firestore.RealtimePipeline collection(String path);
@@ -1681,19 +1681,6 @@ package com.google.firebase.firestore.pipeline {
16811681
enum_constant public static final com.google.firebase.firestore.pipeline.Ordering.Direction DESCENDING;
16821682
}
16831683

1684-
public final class PipelineOptions extends com.google.firebase.firestore.pipeline.AbstractOptions<com.google.firebase.firestore.pipeline.PipelineOptions> {
1685-
ctor public PipelineOptions();
1686-
method public com.google.firebase.firestore.pipeline.PipelineOptions withIndexMode(com.google.firebase.firestore.pipeline.PipelineOptions.IndexMode indexMode);
1687-
}
1688-
1689-
public static final class PipelineOptions.IndexMode {
1690-
field public static final com.google.firebase.firestore.pipeline.PipelineOptions.IndexMode.Companion Companion;
1691-
field public static final com.google.firebase.firestore.pipeline.PipelineOptions.IndexMode RECOMMENDED;
1692-
}
1693-
1694-
public static final class PipelineOptions.IndexMode.Companion {
1695-
}
1696-
16971684
public final class RawOptions extends com.google.firebase.firestore.pipeline.AbstractOptions<com.google.firebase.firestore.pipeline.RawOptions> {
16981685
field public static final com.google.firebase.firestore.pipeline.RawOptions.Companion Companion;
16991686
field public static final com.google.firebase.firestore.pipeline.RawOptions DEFAULT;
@@ -1712,9 +1699,6 @@ package com.google.firebase.firestore.pipeline {
17121699
method public com.google.firebase.firestore.pipeline.RawStage ofName(String name);
17131700
}
17141701

1715-
public final class RealtimePipelineOptions extends com.google.firebase.firestore.pipeline.AbstractOptions<com.google.firebase.firestore.pipeline.RealtimePipelineOptions> {
1716-
}
1717-
17181702
public final class SampleStage extends com.google.firebase.firestore.pipeline.Stage<com.google.firebase.firestore.pipeline.SampleStage> {
17191703
method public static com.google.firebase.firestore.pipeline.SampleStage withDocLimit(int documents);
17201704
method public static com.google.firebase.firestore.pipeline.SampleStage withPercentage(double percentage);

0 commit comments

Comments
 (0)