Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: googleapis/nodejs-datastore
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v8.1.0
Choose a base ref
...
head repository: googleapis/nodejs-datastore
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v8.2.0
Choose a head ref
  • 10 commits
  • 15 files changed
  • 5 contributors

Commits on Sep 21, 2023

  1. chore(deps): update dependency gapic-tools to ^0.2.0 (#1152)

    [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)
    
    This PR contains the following updates:
    
    | Package | Change | Age | Adoption | Passing | Confidence |
    |---|---|---|---|---|---|
    | [gapic-tools](https://togithub.com/googleapis/gax-nodejs) | [`^0.1.8` -> `^0.2.0`](https://renovatebot.com/diffs/npm/gapic-tools/0.1.8/0.2.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/gapic-tools/0.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/gapic-tools/0.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/gapic-tools/0.1.8/0.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/gapic-tools/0.1.8/0.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |
    
    ---
    
    ### Release Notes
    
    <details>
    <summary>googleapis/gax-nodejs (gapic-tools)</summary>
    
    ### [`v0.2.0`](https://togithub.com/googleapis/gax-nodejs/releases/tag/gapic-tools-v0.2.0): gapic-tools: v0.2.0
    
    ##### Features
    
    -   add ESM tools in gax ([#&#8203;1459](https://togithub.com/googleapis/gax-nodejs/issues/1459)) ([0fb1cf9](https://togithub.com/googleapis/gax-nodejs/commit/0fb1cf9acd32dc1ae03a33279eca9449a7d3fca7))
    
    ##### Bug Fixes
    
    -   **deps:** update dependency google-proto-files to v4 ([#&#8203;1490](https://togithub.com/googleapis/gax-nodejs/issues/1490)) ([4748c9f](https://togithub.com/googleapis/gax-nodejs/commit/4748c9fc3a8cfe31e5abb3e35a6ee0d9a6f0e560))
    -   **deps:** update dependency protobufjs-cli to v1.1.2 ([#&#8203;1495](https://togithub.com/googleapis/gax-nodejs/issues/1495)) ([762591e](https://togithub.com/googleapis/gax-nodejs/commit/762591ed28801e5311ab737b04185781a41752e6))
    -   make gapic-tools depend on gax-nodejs ([#&#8203;1480](https://togithub.com/googleapis/gax-nodejs/issues/1480)) ([d0f410d](https://togithub.com/googleapis/gax-nodejs/commit/d0f410d2e08f393f2661c8c92568a0b518fddf99))
    -   release new version of gapic-tools ([#&#8203;1483](https://togithub.com/googleapis/gax-nodejs/issues/1483)) ([e4f5482](https://togithub.com/googleapis/gax-nodejs/commit/e4f548254bfce3daa3b02ae81764bb3394fc4f23))
    
    </details>
    
    ---
    
    ### Configuration
    
    📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined).
    
    🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.
    
    ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
    
    🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
    
    ---
    
     - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
    
    ---
    
    This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/nodejs-datastore).
    <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi45Ny4xIiwidXBkYXRlZEluVmVyIjoiMzYuOTcuMSIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->
    renovate-bot authored Sep 21, 2023
    Configuration menu
    Copy the full SHA
    4977ed1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0d8b715 View commit details
    Browse the repository at this point in the history

Commits on Sep 26, 2023

  1. chore: call non-hermetic functions since we're installing node_module…

    …s directly from the library (#1159)
    
    * chore: call non-hermetic functions since we're installing node_modules directly from the library
    
    Source-Link: googleapis/synthtool@4c4063f
    Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:8b6a07a38d1583d96b6e251ba208bd4ef0bc2a0cc37471ffc518841651d15bd6
    
    Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
    gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Sep 26, 2023
    Configuration menu
    Copy the full SHA
    11ffe3a View commit details
    Browse the repository at this point in the history

Commits on Sep 27, 2023

  1. chore(deps): update dependency @types/is to v0.0.23 (#1162)

    [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)
    
    This PR contains the following updates:
    
    | Package | Change | Age | Adoption | Passing | Confidence |
    |---|---|---|---|---|---|
    | [@types/is](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/is) ([source](https://togithub.com/DefinitelyTyped/DefinitelyTyped)) | [`0.0.22` -> `0.0.23`](https://renovatebot.com/diffs/npm/@types%2fis/0.0.22/0.0.23) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@types%2fis/0.0.23?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@types%2fis/0.0.23?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@types%2fis/0.0.22/0.0.23?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@types%2fis/0.0.22/0.0.23?slim=true)](https://docs.renovatebot.com/merge-confidence/) |
    
    ---
    
    ### Configuration
    
    📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined).
    
    🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.
    
    ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
    
    🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
    
    ---
    
     - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
    
    ---
    
    This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/nodejs-datastore).
    <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4xMDcuMiIsInVwZGF0ZWRJblZlciI6IjM2LjEwNy4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->
    renovate-bot authored Sep 27, 2023
    Configuration menu
    Copy the full SHA
    6f6acfd View commit details
    Browse the repository at this point in the history

Commits on Sep 29, 2023

  1. feat: Support for using multiple databases in datastore (#1090)

    * A simple test with multidb support
    
    * A simple test with multidb support
    
    Adds databaseId to the request options, client options and code for carrying over the client options to the request options as well as a test to make sure it actually works.
    
    * Add additional checks with get
    
    The test should include additional checks to ensure get is running the way it is supposed to.
    
    * Add a test for saving with another database
    
    * other datastore should delete the entity
    
    Since we are saving things to another datastore we need to delete the data from that datastore.
    
    * Add a test for the getDatastore method
    
    The user needs a way to get the database Id from the client so that they can keep track of their clients more easily.
    
    * Add a unit test for database id
    
    Ensure that the database id gets passed all the way down to the generated layer and gets included in the request.
    
    * Do an additional check for the sake of tests
    
    We should check for the existance of datastore.options so that the code doesn’t fail if they are not provided at all.
    
    * initialize generated client so it can be mocked
    
    The test on kokoro is failing because in that environment a project id isn’t defined. The solution is to eliminate the get request so that a call never reaches the backend and initialize the gapic client so it can be mocked out and then catch any call that reaches the mock.
    
    * comments and setDatabaseId
    
    Add docs comments for newly added functions and add a test that ensures setDatabaseId works correctly.
    
    * Refactor of database name
    
    Don’t use the same string multiple times. When the database name we are using for testing changes then we should only have to make that change in one place.
    
    * correction to test against old database
    
    This was a typo. We want to test against the database we were using before
    
    * getRequestWithDatabaseId function
    
    Add the getRequestWithDatabaseId function and change it so that it can easily be used in multiple places and the tests still pass.
    
    * Change function name to addDatabaseIdToRequest
    
    The request options should contain databaseId so rename the function as appropriate.
    
    * Comments in all the places to add reqOpts
    
    This commit contains a comment in all the places we want to add the reqOpts change.
    
    * Add a warning to a certain test for easier debug
    
    Add a warning because the way the assert checking was done before, the test suite was not receiving any indication of which test was failing which makes debugging really hard.
    
    * This fixed the bug for the save operation
    
    * datastore request id
    
    Add request ids back in all the places they are required
    
    * addDatabaseIdToRequest
    
    Add addDatabaseIdToRequest to the transaction test framework so that it can be used in the tests.
    
    * Solve all the test errors for createReadStream
    
    Mock out add database id for the tests in createReadStream that correspond to createReadStream.
    
    * addDatabaseIdToRequest mock for runQueryStream
    
    Add the addDatabaseIdToRequest mock to the tests for every runQueryStream test so that the tests pass.
    
    * By default, mock out addDatabaseIdToRequest
    
    addDatabaseIdToRequest should be a default function in datastore object of request so that we don’t have to mock it out in many different places.
    
    * Revert "addDatabaseIdToRequest mock for runQueryStream"
    
    This reverts commit a3bdb92.
    
    * Revert "Solve all the test errors for createReadStream"
    
    This reverts commit 7b5f902.
    
    * linting
    
    lint an import
    
    * Revert "datastore request id"
    
    This reverts commit f167ce3.
    
    * Revert "This fixed the bug for the save operation"
    
    This reverts commit dd7b06c.
    
    * Revert "Comments in all the places to add reqOpts"
    
    This reverts commit 8ba512a.
    
    * Introduce addDatabaseIdRequest in request
    
    Introduce adding the databaseId in request layer again.
    
    * Declare a constant so that tests don’t run
    
    Importing test into the system-test folder causes the system-test command to also run the tests. Eliminate this import.
    
    * Remove setDatabaseId
    
    Remove setDatabaseId as it provides a way for the user to get confused about the current state of the client.
    
    * Add comment for addDatabaseIdToRequest function
    
    The function needs a comment to be consistent with docs.
    
    * Address header issue
    
    The new util file needs a header
    
    * Add databaseId for encoding and decoding keys
    
    The databaseId should be encoded on keys so that the user can write on a record by record basis
    
    * Revert "Add databaseId for encoding and decoding keys"
    
    This reverts commit 0ebabd5.
    
    * Try a test with the namespace
    
    Try out a new test that looks at data details
    
    * Use the other datastore in the test
    
    Use another datastore with key
    
    * Create a test that looks at specific details
    
    The test should look at specific details in the key and should return the data with the right author.
    
    * Add additional checks to existing test
    
    Add additional checks to existing test to show default database is unaffected.
    
    * Revert "Revert "Add databaseId for encoding and decoding keys""
    
    This reverts commit 6449d10.
    
    * Revert "Revert "Revert "Add databaseId for encoding and decoding keys"""
    
    This reverts commit e694341.
    
    * Rename the second database to secondDatabase
    
    * Use the database called multidb-test
    
    multidb-test is the name of the database set up on the project used in Github automation so we need to change this name in code to use that new database.
    
    * Eliminate function on index that adds the id
    
    Currently a function is used as a passthrough to the function on the util file. This unnecessarily exposes a function to the user that they shouldn’t be concerned with.
    
    * Fix the test so that the assertion error bubbles
    
    The assertion error should bubble up to the user if we send it through the callback.
    
    * Add types so that purpose of function is clear
    
    Types currently set to any should be more specific. This will help clarify the purpose of the function that is used.
    
    * Add types and names so that the function works
    
    The types should be more specific and the names should be more explicit and clear.
    
    * Eliminate repeated code fragments
    
    The test case has the same lines for each secondary database key and these lines should not be repeated so we regroup them into better data structures for the job
    
    * Better names and code organization
    
    The names of some variables were changed to align with others and code was moved so that code pertaining to the same function is grouped together
    
    * Change the variable name of the default key
    
    There is only one default key so we change the variable name so that it doesn’t mention 1
    
    * Refactor the post key hierarchy out
    
    Refactor the hierarchy out for a cleaner test
    
    * Add only to the test we are interested in
    
    * Revert "Add only to the test we are interested in"
    
    This reverts commit 0378dea.
    
    * Add second database id
    
    In the transaction tests we add the databaseId parameter. The databaseId parameter will run tests against the secondary database.
    
    * Remove unnecessary mocks
    
    The mocks for addDatabaseIdToRequest are not necessary for these two files since they were only useful for the way the code was written before so should be removed.
    
    * Remove unused imports
    
    Imports that were used in old mocks no longer exist in the file so should be removed.
    
    * Add parameterized testing to the test/index file
    
    Parameterized testing can be added to the test/index file to test to see how the tests behave with databaseId set to the second database and without this setting too.
    
    * Add parameterized testing to test/transaction.ts
    
    Parameterized testing should be used on transaction.ts. This commit adds the testing with async.
    
    * This ensures that the tests still run on the deft
    
    Tests need to run on the default database as well as the secondary database. This commit ensures that they do.
    
    * Add parameterized testing for the system tests
    
    Parameterized testing for the system tests will ensure that tests run with the default database as well as with the secondary database.
    
    * Use default datastore variable in new tests
    
    The intent of the datastore variable in the new tests is to be the default database so that we are able to see if reads/writes affect the default or secondary database in these tests. They should not use the parameterized version of datastore.
    
    * inline add database id
    
    Now that the tests don’t need to mock out adding database id function, we can inline the code that adds the database id to the request options.
    
    * Modify the namespace in parameterized tests
    
    Parameterized tests should have a different namespace for the second set of tests for sure so we add this prefix.
    
    * Move databaseId to SharedQueryOptions for alignme
    
    The databaseId should be moved to shared query options as discussed.
    
    * Run the linter
    
    Linting was broken so that the PR could be read. Ran the linter again.
    danieljbruce authored Sep 29, 2023
    Configuration menu
    Copy the full SHA
    10ce563 View commit details
    Browse the repository at this point in the history
  2. fix: Allow users to set environment variable to connect to emulator r…

    …unning on docker (#1164)
    
    * Check if DATASTORE_EMULATOR_HOST is set
    
    Instead of checking to see if the endpoint is local, we should check to see if the datastore emulator variable is set. This is because there is an edge case where the user is using an emulator, but the emulator is not listening from local host and in this case we want to use insecure credentials.
    
    * Add tests for combinations of emulator / custom
    
    Add unit tests for evaluating value of ssl credentials. Tests evaluate what happens when the user uses remote custom endpoints or local custom endpoints in combination with different values for the DATASTORE_EMULATOR_HOST variable.
    
    * Revert "Check if DATASTORE_EMULATOR_HOST is set"
    
    This reverts commit dea1706.
    
    * Revert "Revert "Check if DATASTORE_EMULATOR_HOST is set""
    
    This reverts commit a3b50df.
    
    * Clean up the tests
    
    The tests should use a concise apiEndpoint variable and they should set the host for the remote case to be the same as the apiEndpoint variable.
    
    * Add more test cases describing all behaviour
    
    More test cases are needed to describe what happens when the DATASTORE_EMULATOR_HOST variable is not set both in a remote and in a localhost environment because those behaviors should be different. Setting the apiEndpoint to localhost means the user wants to use the emulator without specifying the environment variable so insecure credentials should be provided. Setting the apiEndpoint to remote means the user likely wishes to use regional endpoints so should not be using insecure credentials to skip authentication.
    
    * Allows test cases to pass from previous commit
    
    If the user uses localhost as the endpoint or they provide DATASTORE_EMULATOR_HOST then it is assumed that the user is using the emulator and authentication is skipped. Otherwise, authentication is not skipped.
    
    * Change old test title back to the way it was
    
    The old test title should be what it was before. setHost is now only needed in one place.
    
    * Add comments to each test
    
    The comments need to be added to explain why the test is written the way that it is written so that we know the motivation behind each test.
    danieljbruce authored Sep 29, 2023
    Configuration menu
    Copy the full SHA
    a41741b View commit details
    Browse the repository at this point in the history
  3. fix: Check property existence for exclude from indexes with wildcard (#…

    …1114)
    
    * Add a test for testing without mocks
    
    Testing without mocks allows us to look at the code how it is functioning right now so that we can evaluate the intended behavior.
    
    * Do a refactor on the test
    
    Objects shared by both tests should be moved into the outer block so that they can be shared.
    
    * improve the test so that the error bubbles up
    
    Now the test fails properly and passes properly by introducing callbacks
    
    * isolate the latter test right now
    
    The failure should be visible to the user and in the current state it is so now by isolating the test it becomes easier to explore solutions that work.
    
    * test fixes
    
    indent a describe block, modify tests to make sure they pass and refactor a function out that easily allows for testing modified parameters.
    
    * Add two more tests for excludeFromIndexes on array
    
    Add two more tests that address the array case for excludeIndexesFromPath. Also ensure that the conditions which check for these test cases properly ignore exclude from indexes when an array is used
    
    * Move the tests over to the index file
    
    We should not create a nomocks file because we can just group the tests under a unique describe block of test/index.ts.
    
    * PR update
    
    Remove typeof and remove check for string ‘undefined’
    
    * Create a function to refactor the tests
    
    Refactor the tests so that they are more readable. There is a lot of repeated code in each test which makes comparisons hard.
    
    * All tests for this feature now use same script
    
    Replace all tests exercising the feature so that they all use the same test script. This will make the tests way easier to read.
    
    * Add parameterized testing
    
    Add parameterized testing to eliminate repeated code. These tests need to be easier to read for the sake of the reviewer.
    
    * Eliminate function and inline code
    
    This function is only used once now. We should inline this code in the test.
    
    * Add JSON stringify to test title
    
    In the test title include the properties passed in so that it is easy to track what passed/failed.
    
    * Organize code so that similar variables are used
    
    Similar variables should be used together. Organize the code so that there is less confusion about which variables are related.
    
    * inline getExpectedConfig function
    
    The getExpectedConfig does not need to be used anymore because its code can just be inlined in the one place it is used.
    
    * Separate tests into blocks and inline code
    
    Separate the test into blocks and inline some parameters for better test readability.
    
    * Add types to parameters passed into async
    
    Stronger typing makes the code easier to read.
    
    * Eliminate unnecessary variable assignment
    
    Don’t assign to the Datastore variable. This is not necessary. Just use the OriginalDatastore variable directly.
    
    * Ran linter and simplified source changes
    
    The diff will be easier to read if we do not add a nested if statement and instead apply a condition on the if and change the else to else if.
    
    * Add blank line back for easier diff reading
    
    * Try again, eliminate the blank line
    
    * Additional adjustment to entity first path part
    
    Apply the first suggestion in the PR to all examples
    
    * Define isFirstPathPartUndefined
    
    There is a repeated code fragment for checking if the first path part is undefined that we should refactor.
    
    * Rename the variable to align with what it does
    
    * run linter
    
    * Revert "run linter"
    
    This reverts commit a101f27.
    
    * Revert "Rename the variable to align with what it does"
    
    This reverts commit 4f54d94.
    
    * Revert "Define isFirstPathPartUndefined"
    
    This reverts commit df3f376.
    
    * Refactor check out for seeing if defined
    
    We do four checks to see if the first path part is defined. We should refactor these checks out.
    
    * Move comment to more appropriate place
    
    The comment should reflect the next line of code.
    
    * Replace comments with description
    
    Replace comments with description property so that the tests will report the description when running the tests instead of the properties in the description.
    
    * Eliminate prefix. Only use description
    
    * fix typo
    
    * lowercase convention
    danieljbruce authored Sep 29, 2023
    Configuration menu
    Copy the full SHA
    e6b8ef7 View commit details
    Browse the repository at this point in the history
  4. test: Extend the sleep time to allow save to work (#1142)

    * Extend the sleep time to allow save to work
    
    The sleep time should be increased to allow the save time to vary significantly from the variable savedTime so that any time different between the client and the server’s  clock is negligible compared to the sleep time.
    
    * test: Extend the sleep time to allow save to work
    
    * run linter
    
    * Reapply sleep commit that was there first
    danieljbruce authored Sep 29, 2023
    Configuration menu
    Copy the full SHA
    f326cd1 View commit details
    Browse the repository at this point in the history

Commits on Oct 2, 2023

  1. Configuration menu
    Copy the full SHA
    c7e862e View commit details
    Browse the repository at this point in the history
  2. chore(main): release 8.2.0 (#1153)

    Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
    release-please[bot] authored Oct 2, 2023
    Configuration menu
    Copy the full SHA
    93999d2 View commit details
    Browse the repository at this point in the history
Loading