Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move sum&avg composite index tests to composite_index_query.test.ts #7713

Merged
merged 5 commits into from
Oct 25, 2023

Conversation

milaGGL
Copy link
Contributor

@milaGGL milaGGL commented Oct 20, 2023

  • update terraform to accept collection group index and array membership query
  • add new composite indexes required for testing
  • move sum&avg composite index tests to composite_index_query.test.ts

@milaGGL milaGGL requested review from a team as code owners October 20, 2023 19:01
@changeset-bot
Copy link

changeset-bot bot commented Oct 20, 2023

⚠️ No Changeset found

Latest commit: aa62105

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@milaGGL milaGGL self-assigned this Oct 20, 2023
@google-oss-bot
Copy link
Contributor

google-oss-bot commented Oct 20, 2023

Size Report 1

Affected Products

  • @firebase/auth

    TypeBase (bd073b2)Merge (b76f58e)Diff
    browser175 kB176 kB+386 B (+0.2%)
    cordova203 kB204 kB+386 B (+0.2%)
    esm5228 kB229 kB+386 B (+0.2%)
    main173 kB173 kB+386 B (+0.2%)
    module175 kB176 kB+386 B (+0.2%)
    react-native188 kB188 kB+386 B (+0.2%)
  • @firebase/auth/cordova

    TypeBase (bd073b2)Merge (b76f58e)Diff
    browser203 kB204 kB+386 B (+0.2%)
    module203 kB204 kB+386 B (+0.2%)
  • @firebase/auth/internal

    TypeBase (bd073b2)Merge (b76f58e)Diff
    browser186 kB187 kB+386 B (+0.2%)
    esm5242 kB242 kB+386 B (+0.2%)
    main209 kB210 kB+386 B (+0.2%)
    module186 kB187 kB+386 B (+0.2%)
  • bundle

    TypeBase (bd073b2)Merge (b76f58e)Diff
    auth (Anonymous)72.7 kB73.1 kB+386 B (+0.5%)
    auth (EmailAndPassword)80.5 kB80.9 kB+386 B (+0.5%)
    auth (GoogleFBTwitterGitHubPopup)99.3 kB99.7 kB+386 B (+0.4%)
    auth (GooglePopup)96.6 kB97.0 kB+386 B (+0.4%)
    auth (GoogleRedirect)96.8 kB97.2 kB+386 B (+0.4%)
    auth (Phone)83.0 kB83.3 kB+386 B (+0.5%)
  • firebase

    TypeBase (bd073b2)Merge (b76f58e)Diff
    firebase-auth-compat.js136 kB136 kB+314 B (+0.2%)
    firebase-auth-cordova.js173 kB173 kB+314 B (+0.2%)
    firebase-auth.js146 kB146 kB+314 B (+0.2%)
    firebase-compat.js777 kB778 kB+314 B (+0.0%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/kFbmthtfDe.html

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Oct 20, 2023

Size Analysis Report 1

Affected Products

  • @firebase/auth

    • ActionCodeOperation

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size36.9 kB37.3 kB+386 B (+1.0%)
      size-with-ext-deps57.7 kB58.0 kB+386 B (+0.7%)
    • ActionCodeURL

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size37.7 kB38.1 kB+386 B (+1.0%)
      size-with-ext-deps58.8 kB59.1 kB+386 B (+0.7%)
    • AuthCredential

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size36.9 kB37.3 kB+386 B (+1.0%)
      size-with-ext-deps57.7 kB58.1 kB+386 B (+0.7%)
    • AuthErrorCodes

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size41.7 kB42.1 kB+386 B (+0.9%)
      size-with-ext-deps62.5 kB62.9 kB+386 B (+0.6%)
    • EmailAuthCredential

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size42.2 kB42.6 kB+386 B (+0.9%)
      size-with-ext-deps63.0 kB63.4 kB+386 B (+0.6%)
    • EmailAuthProvider

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size43.6 kB44.0 kB+386 B (+0.9%)
      size-with-ext-deps64.7 kB65.0 kB+386 B (+0.6%)
    • FacebookAuthProvider

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size41.7 kB42.1 kB+386 B (+0.9%)
      size-with-ext-deps62.5 kB62.9 kB+386 B (+0.6%)
    • FactorId

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size36.7 kB37.1 kB+386 B (+1.1%)
      size-with-ext-deps57.4 kB57.8 kB+386 B (+0.7%)
    • GithubAuthProvider

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size41.7 kB42.1 kB+386 B (+0.9%)
      size-with-ext-deps62.5 kB62.9 kB+386 B (+0.6%)
    • GoogleAuthProvider

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size41.7 kB42.1 kB+386 B (+0.9%)
      size-with-ext-deps62.5 kB62.9 kB+386 B (+0.6%)
    • OAuthCredential

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size38.8 kB39.2 kB+386 B (+1.0%)
      size-with-ext-deps59.6 kB60.0 kB+386 B (+0.6%)
    • OAuthProvider

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size42.6 kB43.0 kB+386 B (+0.9%)
      size-with-ext-deps63.4 kB63.8 kB+386 B (+0.6%)
    • OperationType

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size36.7 kB37.1 kB+386 B (+1.1%)
      size-with-ext-deps57.5 kB57.9 kB+386 B (+0.7%)
    • PhoneAuthCredential

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size38.8 kB39.2 kB+386 B (+1.0%)
      size-with-ext-deps59.6 kB60.0 kB+386 B (+0.6%)
    • PhoneAuthProvider

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size40.5 kB40.9 kB+386 B (+1.0%)
      size-with-ext-deps61.3 kB61.7 kB+386 B (+0.6%)
    • PhoneMultiFactorGenerator

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size37.5 kB37.9 kB+386 B (+1.0%)
      size-with-ext-deps58.3 kB58.7 kB+386 B (+0.7%)
    • ProviderId

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size36.8 kB37.2 kB+386 B (+1.0%)
      size-with-ext-deps57.5 kB57.9 kB+386 B (+0.7%)
    • RecaptchaVerifier

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size43.2 kB43.6 kB+386 B (+0.9%)
      size-with-ext-deps64.0 kB64.4 kB+386 B (+0.6%)
    • SAMLAuthProvider

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size43.0 kB43.4 kB+386 B (+0.9%)
      size-with-ext-deps63.8 kB64.1 kB+386 B (+0.6%)
    • SignInMethod

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size36.8 kB37.2 kB+386 B (+1.0%)
      size-with-ext-deps57.6 kB58.0 kB+386 B (+0.7%)
    • TotpMultiFactorGenerator

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size39.2 kB39.5 kB+386 B (+1.0%)
      size-with-ext-deps59.9 kB60.3 kB+386 B (+0.6%)
    • TotpSecret

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size37.6 kB38.0 kB+386 B (+1.0%)
      size-with-ext-deps58.4 kB58.8 kB+386 B (+0.7%)
    • TwitterAuthProvider

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size41.7 kB42.1 kB+386 B (+0.9%)
      size-with-ext-deps62.5 kB62.9 kB+386 B (+0.6%)
    • applyActionCode

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size36.8 kB37.1 kB+386 B (+1.0%)
      size-with-ext-deps57.5 kB57.9 kB+386 B (+0.7%)
    • beforeAuthStateChanged

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size36.7 kB37.1 kB+386 B (+1.1%)
      size-with-ext-deps57.5 kB57.9 kB+386 B (+0.7%)
    • browserLocalPersistence

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size40.1 kB40.5 kB+386 B (+1.0%)
      size-with-ext-deps60.9 kB61.3 kB+386 B (+0.6%)
    • browserPopupRedirectResolver

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size61.1 kB61.5 kB+386 B (+0.6%)
      size-with-ext-deps82.1 kB82.5 kB+386 B (+0.5%)
    • browserSessionPersistence

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size40.1 kB40.5 kB+386 B (+1.0%)
      size-with-ext-deps60.9 kB61.3 kB+386 B (+0.6%)
    • checkActionCode

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size37.9 kB38.3 kB+386 B (+1.0%)
      size-with-ext-deps58.7 kB59.0 kB+386 B (+0.7%)
    • confirmPasswordReset

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size37.0 kB37.4 kB+386 B (+1.0%)
      size-with-ext-deps57.8 kB58.2 kB+386 B (+0.7%)
    • connectAuthEmulator

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size38.4 kB38.8 kB+386 B (+1.0%)
      size-with-ext-deps59.2 kB59.5 kB+386 B (+0.7%)
    • createUserWithEmailAndPassword

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size41.4 kB41.8 kB+386 B (+0.9%)
      size-with-ext-deps62.2 kB62.5 kB+386 B (+0.6%)
    • debugErrorMap

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size48.9 kB49.2 kB+386 B (+0.8%)
      size-with-ext-deps69.6 kB70.0 kB+386 B (+0.6%)
    • deleteUser

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size36.7 kB37.1 kB+386 B (+1.1%)
      size-with-ext-deps57.5 kB57.8 kB+386 B (+0.7%)
    • fetchSignInMethodsForEmail

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size37.0 kB37.4 kB+386 B (+1.0%)
      size-with-ext-deps57.8 kB58.2 kB+386 B (+0.7%)
    • getAdditionalUserInfo

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size38.0 kB38.4 kB+386 B (+1.0%)
      size-with-ext-deps58.8 kB59.1 kB+386 B (+0.7%)
    • getAuth

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size71.2 kB71.5 kB+386 B (+0.5%)
      size-with-ext-deps98.6 kB99.0 kB+386 B (+0.4%)
    • getIdToken

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size36.7 kB37.1 kB+386 B (+1.1%)
      size-with-ext-deps57.5 kB57.8 kB+386 B (+0.7%)
    • getIdTokenResult

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size36.6 kB37.0 kB+386 B (+1.1%)
      size-with-ext-deps57.4 kB57.8 kB+386 B (+0.7%)
    • getMultiFactorResolver

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size39.6 kB39.9 kB+386 B (+1.0%)
      size-with-ext-deps60.3 kB60.7 kB+386 B (+0.6%)
    • getRedirectResult

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size44.2 kB44.6 kB+386 B (+0.9%)
      size-with-ext-deps65.0 kB65.4 kB+386 B (+0.6%)
    • inMemoryPersistence

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size36.6 kB37.0 kB+386 B (+1.1%)
      size-with-ext-deps57.4 kB57.8 kB+386 B (+0.7%)
    • indexedDBLocalPersistence

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size44.1 kB44.5 kB+386 B (+0.9%)
      size-with-ext-deps64.9 kB65.2 kB+386 B (+0.6%)
    • initializeAuth

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size36.9 kB37.3 kB+386 B (+1.0%)
      size-with-ext-deps58.2 kB58.5 kB+386 B (+0.7%)
    • initializeRecaptchaConfig

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size39.6 kB40.0 kB+386 B (+1.0%)
      size-with-ext-deps60.4 kB60.7 kB+386 B (+0.6%)
    • isSignInWithEmailLink

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size37.8 kB38.2 kB+386 B (+1.0%)
      size-with-ext-deps58.9 kB59.3 kB+386 B (+0.7%)
    • linkWithCredential

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size37.7 kB38.1 kB+386 B (+1.0%)
      size-with-ext-deps58.5 kB58.8 kB+386 B (+0.7%)
    • linkWithPhoneNumber

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size41.2 kB41.6 kB+386 B (+0.9%)
      size-with-ext-deps62.0 kB62.4 kB+386 B (+0.6%)
    • linkWithPopup

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size47.8 kB48.1 kB+386 B (+0.8%)
      size-with-ext-deps68.6 kB69.0 kB+386 B (+0.6%)
    • linkWithRedirect

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size43.0 kB43.4 kB+386 B (+0.9%)
      size-with-ext-deps63.8 kB64.2 kB+386 B (+0.6%)
    • multiFactor

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size38.9 kB39.3 kB+386 B (+1.0%)
      size-with-ext-deps59.6 kB60.0 kB+386 B (+0.6%)
    • onAuthStateChanged

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size36.7 kB37.1 kB+386 B (+1.1%)
      size-with-ext-deps57.5 kB57.9 kB+386 B (+0.7%)
    • onIdTokenChanged

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size36.7 kB37.1 kB+386 B (+1.1%)
      size-with-ext-deps57.5 kB57.9 kB+386 B (+0.7%)
    • parseActionCodeURL

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size37.8 kB38.2 kB+386 B (+1.0%)
      size-with-ext-deps58.8 kB59.2 kB+386 B (+0.7%)
    • prodErrorMap

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size36.6 kB37.0 kB+386 B (+1.1%)
      size-with-ext-deps57.4 kB57.8 kB+386 B (+0.7%)
    • reauthenticateWithCredential

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size38.2 kB38.6 kB+386 B (+1.0%)
      size-with-ext-deps59.0 kB59.4 kB+386 B (+0.7%)
    • reauthenticateWithPhoneNumber

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size41.8 kB42.2 kB+386 B (+0.9%)
      size-with-ext-deps62.6 kB63.0 kB+386 B (+0.6%)
    • reauthenticateWithPopup

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size47.8 kB48.2 kB+386 B (+0.8%)
      size-with-ext-deps68.6 kB69.0 kB+386 B (+0.6%)
    • reauthenticateWithRedirect

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size42.7 kB43.1 kB+386 B (+0.9%)
      size-with-ext-deps63.5 kB63.9 kB+386 B (+0.6%)
    • reload

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size36.6 kB37.0 kB+386 B (+1.1%)
      size-with-ext-deps57.4 kB57.8 kB+386 B (+0.7%)
    • sendEmailVerification

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size37.6 kB38.0 kB+386 B (+1.0%)
      size-with-ext-deps58.4 kB58.7 kB+386 B (+0.7%)
    • sendPasswordResetEmail

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size41.0 kB41.4 kB+386 B (+0.9%)
      size-with-ext-deps61.8 kB62.1 kB+386 B (+0.6%)
    • sendSignInLinkToEmail

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size41.0 kB41.4 kB+386 B (+0.9%)
      size-with-ext-deps61.8 kB62.2 kB+386 B (+0.6%)
    • setPersistence

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size36.7 kB37.1 kB+386 B (+1.1%)
      size-with-ext-deps57.5 kB57.9 kB+386 B (+0.7%)
    • signInAnonymously

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size37.8 kB38.2 kB+386 B (+1.0%)
      size-with-ext-deps58.6 kB59.0 kB+386 B (+0.7%)
    • signInWithCredential

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size38.0 kB38.4 kB+386 B (+1.0%)
      size-with-ext-deps58.8 kB59.2 kB+386 B (+0.7%)
    • signInWithCustomToken

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size37.7 kB38.1 kB+386 B (+1.0%)
      size-with-ext-deps58.4 kB58.8 kB+386 B (+0.7%)
    • signInWithEmailAndPassword

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size45.3 kB45.7 kB+386 B (+0.9%)
      size-with-ext-deps66.3 kB66.7 kB+386 B (+0.6%)
    • signInWithEmailLink

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size45.3 kB45.7 kB+386 B (+0.9%)
      size-with-ext-deps66.3 kB66.7 kB+386 B (+0.6%)
    • signInWithPhoneNumber

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size41.6 kB41.9 kB+386 B (+0.9%)
      size-with-ext-deps62.4 kB62.7 kB+386 B (+0.6%)
    • signInWithPopup

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size47.8 kB48.1 kB+386 B (+0.8%)
      size-with-ext-deps68.6 kB68.9 kB+386 B (+0.6%)
    • signInWithRedirect

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size42.5 kB42.8 kB+386 B (+0.9%)
      size-with-ext-deps63.2 kB63.6 kB+386 B (+0.6%)
    • signOut

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size36.7 kB37.1 kB+386 B (+1.1%)
      size-with-ext-deps57.4 kB57.8 kB+386 B (+0.7%)
    • unlink

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size37.2 kB37.6 kB+386 B (+1.0%)
      size-with-ext-deps58.0 kB58.4 kB+386 B (+0.7%)
    • updateCurrentUser

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size36.7 kB37.1 kB+386 B (+1.1%)
      size-with-ext-deps57.5 kB57.9 kB+386 B (+0.7%)
    • updateEmail

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size37.0 kB37.3 kB+386 B (+1.0%)
      size-with-ext-deps57.7 kB58.1 kB+386 B (+0.7%)
    • updatePassword

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size37.0 kB37.3 kB+386 B (+1.0%)
      size-with-ext-deps57.7 kB58.1 kB+386 B (+0.7%)
    • updatePhoneNumber

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size37.4 kB37.8 kB+386 B (+1.0%)
      size-with-ext-deps58.2 kB58.6 kB+386 B (+0.7%)
    • updateProfile

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size37.2 kB37.5 kB+386 B (+1.0%)
      size-with-ext-deps57.9 kB58.3 kB+386 B (+0.7%)
    • useDeviceLanguage

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size36.7 kB37.1 kB+386 B (+1.1%)
      size-with-ext-deps57.5 kB57.8 kB+386 B (+0.7%)
    • validatePassword

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size36.7 kB37.1 kB+386 B (+1.1%)
      size-with-ext-deps57.5 kB57.9 kB+386 B (+0.7%)
    • verifyBeforeUpdateEmail

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size37.6 kB38.0 kB+386 B (+1.0%)
      size-with-ext-deps58.4 kB58.8 kB+386 B (+0.7%)
    • verifyPasswordResetCode

      Size

      TypeBase (bd073b2)Merge (b76f58e)Diff
      size38.0 kB38.3 kB+386 B (+1.0%)
      size-with-ext-deps58.7 kB59.1 kB+386 B (+0.7%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/6cz8QREmNn.html

@milaGGL milaGGL requested a review from ehsannas October 20, 2023 21:57
@milaGGL milaGGL assigned ehsannas and unassigned milaGGL Oct 20, 2023
});
});

it('performs aggregations on documents with all aggregated fields using getAggregationFromServer', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

The tests below and all new supporting indexes look good.

For your consideration, we could also change field names in these tests to re-use existing indexes instead of creating three new indexes. In the long run this practice would reduce the size of our TF files. Perhaps also extend the amount of time before we hit index limits: https://firebase.google.com/docs/firestore/quotas#indexes

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, I see that you even mention this in your notes at the top of this file. Do you want my help making these changes since they are aggregate tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have changed the field name from "x" to "a", so no new fields introduced.
But since this is a CollectionGroup query, a new index is required after all. As long as any new tests on collection group query will keep using field "a", then we have achieved the re-use and limit index numbers.

Copy link
Contributor

Choose a reason for hiding this comment

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

I was thinking about the non-collection-group indexes. But after comparing the new indexes to the existing ones, what you said still applies, we'd still have to create new indexes even if we changed field names.

`abc/123/zzz${collectionGroupId}/cg-doc4`,
`abc/123/zzz/${collectionGroupId}`
];
const batch = writeBatch(db);
Copy link
Contributor

Choose a reason for hiding this comment

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

Does writeBatch work with the test helper library you created for composite index queries? If not, perhaps we should migrate this code over to use the addDoc(...) method that will add TTL fields and more?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I used testHelper.addTestSpecificFieldsToDoc to add the TTL and testID fields, with minimal change to the existing code:

batch.set(
    doc(db, docPath), 
    testHelper.addTestSpecificFieldsToDoc({ a: 2 }) // original: { a: 2 }
);

If there is no preference between write Batch and addDoc(), I can refactor the code. @MarkDuckworth

Copy link
Contributor

Choose a reason for hiding this comment

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

Right. I see what you did now. Thanks. I don't have a strong preference between batch and adding single docs.

@milaGGL milaGGL requested a review from MarkDuckworth October 25, 2023 14:45
`abc/123/zzz${collectionGroupId}/cg-doc4`,
`abc/123/zzz/${collectionGroupId}`
];
const batch = writeBatch(db);
Copy link
Contributor

Choose a reason for hiding this comment

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

Right. I see what you did now. Thanks. I don't have a strong preference between batch and adding single docs.

});
});

it('performs aggregations on documents with all aggregated fields using getAggregationFromServer', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I was thinking about the non-collection-group indexes. But after comparing the new indexes to the existing ones, what you said still applies, we'd still have to create new indexes even if we changed field names.

@milaGGL milaGGL merged commit cac9165 into master Oct 25, 2023
41 checks passed
@milaGGL milaGGL deleted the mila/sum&avg-composite-index-tests branch October 25, 2023 19:25
@firebase firebase locked and limited conversation to collaborators Nov 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants