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

feat: CommitStats in CommitResponse #1254

Merged
merged 8 commits into from
Feb 4, 2021

Conversation

skuruppu
Copy link
Contributor

@skuruppu skuruppu commented Oct 13, 2020

If returnCommitStats = true in the CommitRequest, then CommitResponse will contain CommitStats.

@skuruppu skuruppu added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Oct 13, 2020
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Oct 13, 2020
src/transaction.ts Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Oct 13, 2020

Codecov Report

Merging #1254 (277002c) into master (a6d1aa2) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1254   +/-   ##
=======================================
  Coverage   98.58%   98.58%           
=======================================
  Files          23       23           
  Lines       21633    21658   +25     
  Branches     1210     1213    +3     
=======================================
+ Hits        21327    21352   +25     
  Misses        297      297           
  Partials        9        9           
Impacted Files Coverage Δ
src/table.ts 100.00% <100.00%> (ø)
src/transaction.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a6d1aa2...c31cdfb. Read the comment docs.

@skuruppu skuruppu force-pushed the spanner-commit-stats branch from dc46e7a to a429ef5 Compare October 14, 2020 10:43
@skuruppu skuruppu changed the title feat!: support CommitStats in CommitResponse feat: support CommitStats in CommitResponse Oct 14, 2020
@skuruppu skuruppu changed the title feat: support CommitStats in CommitResponse feat: CommitStats in CommitResponse Oct 14, 2020
@skuruppu skuruppu marked this pull request as ready for review October 14, 2020 10:48
@skuruppu skuruppu requested review from a team as code owners October 14, 2020 10:48
@skuruppu skuruppu force-pushed the spanner-commit-stats branch 2 times, most recently from 78abaca to 795de3a Compare October 15, 2020 05:15
@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/nodejs-spanner API. label Oct 15, 2020
@skuruppu skuruppu force-pushed the spanner-commit-stats branch from 795de3a to 733c051 Compare October 15, 2020 10:10
@skuruppu skuruppu changed the title feat: CommitStats in CommitResponse feat!: CommitStats in CommitResponse Oct 15, 2020
samples/get-commit-stats.js Outdated Show resolved Hide resolved
src/transaction.ts Outdated Show resolved Hide resolved
@AVaksman
Copy link
Contributor

Do we need unit tests for Table functions to confirm that returnCommitStats is accepted?

@skuruppu skuruppu force-pushed the spanner-commit-stats branch from 733c051 to ee57d7a Compare October 22, 2020 10:29
@skuruppu
Copy link
Contributor Author

Do we need unit tests for Table functions to confirm that returnCommitStats is accepted?

I was curious about this. CodeCov gave 100% coverage for table.js so I wasn't sure. But I've now added tests to set returnCommitStats.

@skuruppu
Copy link
Contributor Author

@olavloite @AVaksman I've been asked to not make this a breaking change. So the options for implementations are:

  1. Make CommitOptions extend CallSettings.
  2. Introduce a second method like commitWithOptions, insertWithOptions, etc. for all methods that needs to take in this option.

Could you advice me on which one of these is preferable?

@olavloite
Copy link
Contributor

@olavloite @AVaksman I've been asked to not make this a breaking change. So the options for implementations are:

  1. Make CommitOptions extend CallSettings.
  2. Introduce a second method like commitWithOptions, insertWithOptions, etc. for all methods that needs to take in this option.

Could you advice me on which one of these is preferable?

Purely from a (Spanner) API perspective, I would prefer option 1 to prevent the API from being cluttered with a large number of ...WithOptions methods. I however don't know what has been agreed on a general level for all Google Cloud NodeJS API's regarding this, and therefore don't know what weight should be given to the argument given by @AVaksman that this would break the common practice.

@skuruppu skuruppu force-pushed the spanner-commit-stats branch from ee57d7a to 7a050ed Compare November 17, 2020 05:38
@snippet-bot
Copy link

snippet-bot bot commented Nov 17, 2020

Here is the summary of changes.

You added 1 region tag.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@skuruppu skuruppu force-pushed the spanner-commit-stats branch 2 times, most recently from 8d8234b to 47bd940 Compare November 19, 2020 03:56
@skuruppu skuruppu force-pushed the spanner-commit-stats branch from 47bd940 to ddab71e Compare December 10, 2020 04:12
@skuruppu skuruppu added the semver: major Hint for users that this is an API breaking change. label Dec 10, 2020
@skuruppu skuruppu force-pushed the spanner-commit-stats branch from ddab71e to 7bd46a5 Compare January 7, 2021 01:21
@skuruppu skuruppu changed the title feat!: CommitStats in CommitResponse feat: CommitStats in CommitResponse Jan 7, 2021
@skuruppu skuruppu force-pushed the spanner-commit-stats branch from 7bd46a5 to 64e83c6 Compare January 7, 2021 01:26
@skuruppu
Copy link
Contributor Author

skuruppu commented Jan 7, 2021

Based on the discussion in #1282 (comment), I reverted this to make it a non-breaking change.

@skuruppu skuruppu force-pushed the spanner-commit-stats branch 2 times, most recently from c3971e7 to 2a74a0e Compare January 7, 2021 01:58
@skuruppu skuruppu force-pushed the spanner-commit-stats branch from 2a74a0e to 23b5b75 Compare January 27, 2021 23:35
@skuruppu skuruppu removed semver: major Hint for users that this is an API breaking change. do not merge Indicates a pull request not ready for merge, due to either quality or timing. labels Feb 4, 2021
@skuruppu skuruppu merged commit e3730d2 into googleapis:master Feb 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/nodejs-spanner API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants