Skip to content

hidane 0.7.0

Latest

Choose a tag to compare

@github-actions github-actions released this 10 Nov 10:43
· 25 commits to main since this release
Immutable release. Only release title and notes can be modified.
df96b82

hidane 0.7.0 serves Datastore mode: started with --database-mode datastore-mode, as gcloud emulators firestore start --database-mode=datastore-mode starts the official emulator, it answers the Cloud Datastore client libraries. On an enterprise database, it now runs pipelines and stores the BSON types. It also reports the indexes your queries need.

Verified against the official Cloud Firestore emulator v1.22.0, as firebase-tools 15.33.0 downloads it. Per-client versions are in docs/sdk-certification.md. The tests replay 54,378 recorded answers of the official emulator, from 78 fixtures.

Changes that may affect your tests

These are compatibility fixes (docs/versioning.md). Each makes hidane answer as the official emulator does, so a test written against hidane's earlier answer can start failing.

  • Startup flags (#369).
    • --database-mode takes firestore-native and datastore-mode only, and --database-edition takes standard and enterprise only, written exactly so.
    • Any other value stops hidane with exit code 1 and the official message, Unsupported database mode: X. …. This includes the names --help lists, such as CLOUD_FIRESTORE or ENTERPRISE.
    • --require_indexes in Firestore Native mode no longer stops hidane. It starts, and refuses every RunQuery with "Firestore Native mode does not support index enforcement".
  • The Datastore API in Firestore Native mode (#371). It is now served, and each request is refused with "Database mode not set to Datastore Mode. …", as on the official emulator. Before, it answered gRPC UNIMPLEMENTED or REST 404. Server reflection lists google.datastore.v1.Datastore.
  • Enterprise edition. These apply on a database started with --database-edition enterprise, or set to it with :setDatabaseEdition.
    • Writes (#350):
      • arrays may hold arrays;
      • values and documents have no size limit;
      • maps and arrays count alike toward 20 levels;
      • a problem inside a map is reported as it is at the top level.
    • Listeners (#353) check their query with null and NaN as values, as the official emulator does (D091 is retired).

New

  • Datastore mode (#81, ADR 0009). --database-mode datastore-mode serves google.datastore.v1.Datastore over gRPC and REST, and refuses the Firestore API as the official emulator does.
    • Requests: Lookup, RunQuery and RunAggregationQuery, both structured and in GQL (#358, #360); BeginTransaction, Commit, Rollback, AllocateIds and ReserveIds.
    • Data model: Datastore's values, their order and its key model, with numeric IDs allocated as the official emulator allocates them.
    • Indexes: --require_indexes with --index_file refuses a query that needs a composite index the file does not define (#361).
    • Export and import: :export, :import and --import-data, in the official format of that mode (#368).
    • Protobuf over REST: answered when the Content-Type is application/x-protobuf, as the Java and Python client libraries send it (#367).
    • Client libraries: the Datastore libraries for Node.js, Python, Java and Go are verified against it (#367).
    • Testing: a differential fuzzer and a second round of recordings fixed what still differed (#370–#381).
  • Pipelines on an enterprise database (#80, #347): ExecutePipeline over gRPC and REST.
  • The BSON types on an enterprise database (#352):
    • MinKey and MaxKey, ObjectId, regular expressions, Int32, Decimal128, BSON timestamps and binary data;
    • written, checked, ordered and compared as the official emulator does.
  • POST …/databases/{d}:setDatabaseEdition (#354): sets one database's edition, standard or enterprise.
  • GET /emulator/v1/projects/{p}:indexUsage (#346): the composite indexes the queries run so far would need in production, counted as the official emulator counts them.
  • Verified clients: @google-cloud/firestore 9.4.0 (#423). hidane doctor keeps counting the release verified before the current one as verified (#427).
  • Benchmark scenarios (#355):
    • firebase_startup: the time until the port accepts, through firebase emulators:start;
    • large_dataset: memory after 500,000 documents.
  • Parity records: the production column of docs/parity-exceptions.md records where production Firestore differs from the official emulator (#82), as a nightly replay of the recordings against production finds it. hidane follows the official emulator there.

Breaking changes

None to a stable surface. The changes above are compatibility fixes.

Install

curl -fsSL https://hidane.dev/install.sh | sh
brew install hidane-dev/tap/hidane
npm install --save-dev hidane
cargo binstall hidane   # or cargo install hidane
dart pub global activate hidane
docker run --rm -p 8080:8080 ghcr.io/hidane-dev/hidane:0.7.0

Full changelog: v0.6.0...v0.7.0