Skip to content
This repository was archived by the owner on Mar 11, 2026. It is now read-only.

fix: accept uniqueWriterIdentity in setMetadata#1034

Merged
freelerobot merged 6 commits intomasterfrom
sinkUniqWriter
Apr 15, 2021
Merged

fix: accept uniqueWriterIdentity in setMetadata#1034
freelerobot merged 6 commits intomasterfrom
sinkUniqWriter

Conversation

@freelerobot
Copy link
Copy Markdown
Contributor

@freelerobot freelerobot commented Apr 8, 2021

Final Spec (internal googler link). Fixes: b/183619158

Changes:

  • Users can provide uniqueWriterIdentity boolean in setmetadata
  • Users can change sink into a uniqueWriterIdentity, from a shared identity

@freelerobot freelerobot self-assigned this Apr 8, 2021
@freelerobot freelerobot requested review from a team April 8, 2021 23:11
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Apr 8, 2021
@product-auto-label product-auto-label Bot added the api: logging Issues related to the googleapis/nodejs-logging API. label Apr 8, 2021
@freelerobot freelerobot added priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Apr 8, 2021
Comment thread src/sink.ts
Comment thread src/sink.ts Outdated
/**
* Set the sink's metadata.
*
* Note: If the sink was created with uniqueWriterIdentity = true, then the
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

To me, this reads like the user will have to provide uniqueWriterIdentity = true, but it looks like the code does it for them. Should this say something like "Note: If the sink was created with uniqueWriterIdentity = true, we will automatically apply this option during the setMetadata operation."?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We dont automatically apply this in the setMetadata operation yet. Hence this issue, but I need to double check with logging-eng whether my proposed detection heuristic is reliable. For the scope of this PR, I aim to unblock the user but letting them set the boolean manually.

Will update the comment to be clearer :)

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 13, 2021

Codecov Report

Merging #1034 (9345c05) into master (0b7af34) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1034   +/-   ##
=======================================
  Coverage   97.89%   97.90%           
=======================================
  Files          18       18           
  Lines       13224    13239   +15     
  Branches      410      412    +2     
=======================================
+ Hits        12946    12961   +15     
  Misses        275      275           
  Partials        3        3           
Impacted Files Coverage Δ
src/index.ts 95.52% <100.00%> (ø)
src/sink.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 0b7af34...9345c05. Read the comment docs.

Comment thread src/sink.ts
Comment thread system-test/logging.ts
@freelerobot freelerobot requested a review from simonz130 April 14, 2021 00:43
Comment thread system-test/logging.ts
assert.strictEqual(apiResponse.filter, FILTER);
// Sink must be deleted within this test before any logs are generated
// to avoid topic_permission_denied emails.
await sink.delete();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can you have a finally block to always delete the sink at the end of the test?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have an after block to delete sinks for the other tests. But these uniqueId sinks require a reference to the sink names created within the scope of the tests.

@freelerobot freelerobot added the automerge Merge the pull request once unit tests and other checks pass. label Apr 15, 2021
@freelerobot freelerobot merged commit 02e8bb4 into master Apr 15, 2021
@freelerobot freelerobot deleted the sinkUniqWriter branch April 15, 2021 00:51
@gcf-merge-on-green gcf-merge-on-green Bot removed the automerge Merge the pull request once unit tests and other checks pass. label Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: logging Issues related to the googleapis/nodejs-logging API. cla: yes This human has signed the Contributor License Agreement. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants