Skip to content

test(client): cover decryption key option in AbstractReadStrategy - #459

Merged
gcs-analytics-core-robot merged 1 commit into
GoogleCloudPlatform:mainfrom
gcs-analytics-core-robot:sil/read-strategy-decryption-key
Nov 3, 2026
Merged

gcs-analytics-core-robot merged 1 commit into
GoogleCloudPlatform:mainfrom
gcs-analytics-core-robot:sil/read-strategy-decryption-key

Conversation

@gcs-analytics-core-robot

Copy link
Copy Markdown
Collaborator

Summary

Exercising channel initialization with decryptionKey configured verifies BlobSourceOption.decryptionKey propagation to Storage.reader and closes the unexercised path in AbstractReadStrategy.

Hypothesis: Exercising channel initialization with decryptionKey configured verifies BlobSourceOption.decryptionKey propagation to Storage.reader and closes the unexercised path in AbstractReadStrategy.

Hard gates

Overall: PASS · base f425f8883d · change type test

Gate Status Time Summary
build ✅ PASS 34s ok
lint ✅ PASS 3s ok
unit ✅ PASS 35s 1542 tests, 0 skipped
coverage ✅ PASS 0s line 85.96% -> 85.96% (+0.00), branch 71.31% -> 71.36% (+0.05)
integration ⏭️ SKIP 0s missing env ['SIL_GCS_TEST_BUCKET'] (configure to enable this gate)
perf ⏭️ SKIP 0s not run for change_type=test
hygiene ✅ PASS 0s 1 files, 105 lines, 1 commit(s)

Coverage: line 85.96% → 85.96% (+0.00), branch 71.31% → 71.36% (+0.05)

⚠️ Integration tests were skipped: missing env ['SIL_GCS_TEST_BUCKET'] (configure to enable this gate). Run them before merging.

Critic review

Verdict: APPROVE (model: sil-critic)


Generated by the Self-Improving Loop · iteration 20261103-040045-read-strategy-decryption-key. Draft PR: human review required.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on improving test coverage for the GcsReadChannel component. By adding new test scenarios, it ensures that decryption keys are properly passed through to the underlying storage reader, validating both successful propagation and error handling behavior.

Highlights

  • Test Coverage Expansion: Added comprehensive unit tests to verify that the decryption key option is correctly propagated to the GCS Storage reader.
  • Error Handling Verification: Introduced a test case to ensure that invalid decryption keys provided to the storage layer are correctly handled and result in a StorageException.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@codecov

codecov Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.45%. Comparing base (1f4e76f) to head (d863950).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #459      +/-   ##
==========================================
+ Coverage   98.43%   98.45%   +0.02%     
==========================================
  Files          79       79              
  Lines        3957     3957              
  Branches      462      462              
==========================================
+ Hits         3895     3896       +1     
  Misses         32       32              
+ Partials       30       29       -1     

see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request adds unit tests to GcsReadChannelTest to verify that customer-supplied decryption keys are correctly propagated to the storage reader and bounded channel, and that invalid keys are handled properly. The reviewer feedback correctly points out that the mock decryption key used in the tests is only 19 bytes, whereas Google Cloud Storage requires a 256-bit (32-byte) key. Updating this to a valid 32-byte key is recommended to prevent potential test failures in environments with stricter validation.

@gcs-analytics-core-robot

gcs-analytics-core-robot commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator Author

📊 Hermetic JMH Benchmark Summary (PR vs Main)

PR: #459 · Commit: d863950f9539 · Kokoro Build: 7026cf2f-5c15-4455-bf7d-43eb75216e9b

Published Assets: 🌐 Interactive HTML Report | 📄 Markdown Report | 📦 Raw JMH JSON | 🔬 Kokoro / Sponge Artifacts

Suite-Level Executive Summary

Suite Cases GeoMean Latency Δ Latency Δ Range GCS I/O Counters (opens/op, bytes/op)
FooterPrefetchBenchmark 4 -2.43% -3.26% to -1.61% 0 Δ (invariants held)
GcsReadChannelOpenBenchmark 2 -0.32% -3.37% to +2.82% 0 Δ (invariants held)
HermeticInputStreamBenchmark 8 -3.07% -10.87% to +19.54% 0 Δ (invariants held)
ReadStrategyBenchmark 12 +0.69% -4.66% to +5.69% 0 Δ (invariants held)
SmallObjectCacheBenchmark 2 +6.71% +5.46% to +7.97% 0 Δ (invariants held)
TelemetryOverheadBenchmark 8 +1.45% -2.69% to +11.34% CPU-only
VectoredRangeCoalescingBenchmark 9 -4.20% -14.40% to +1.52% CPU-only
📋 Full Hermetic Benchmark Breakdown (45 cases)
Benchmark Params Unit Main PR Latency Δ Opens/op Bytes/op Alloc (B/op)
FooterPrefetchBenchmark.readFooterUnknownSize prefetchEnabled=true us/op 47.496 46.730 -1.61% 1 128.0 KiB 395128
FooterPrefetchBenchmark.readFooterUnknownSize prefetchEnabled=false us/op 3.268 3.161 -3.26% 2 64.0 KiB 1856
FooterPrefetchBenchmark.readTail prefetchEnabled=true us/op 19.382 18.820 -2.90% 1 128 KiB 133624
FooterPrefetchBenchmark.readTail prefetchEnabled=false us/op 3.247 3.184 -1.96% 1 64 KiB 2216
GcsReadChannelOpenBenchmark.openAndReadOneByte_withFileInfo - us/op 0.257 0.248 -3.37% 1 1 B 744
GcsReadChannelOpenBenchmark.openAndReadOneByte_withItemId - us/op 0.657 0.676 +2.82% 1 1 B 1416
HermeticInputStreamBenchmark.positionedReads objectSize=1048576 us/op 136.280 125.898 -7.62% 64 1.47 MiB 716569
HermeticInputStreamBenchmark.positionedReads objectSize=16777216 us/op 66.462 62.516 -5.94% 64 508 KiB 326624
HermeticInputStreamBenchmark.readTailWithFooterPrefetch objectSize=1048576 us/op 18.558 17.060 -8.07% 1 128 KiB 133631
HermeticInputStreamBenchmark.readTailWithFooterPrefetch objectSize=16777216 us/op 21.021 18.736 -10.87% 1 128 KiB 133640
HermeticInputStreamBenchmark.readVectored objectSize=1048576 us/op 212.951 194.502 -8.66% 1 1 MiB 1053360
HermeticInputStreamBenchmark.readVectored objectSize=16777216 us/op 128.102 140.374 +9.58% 16 1 MiB 1060215
HermeticInputStreamBenchmark.sequentialRead objectSize=1048576 us/op 57.150 52.289 -8.50% 1 1 MiB 134333
HermeticInputStreamBenchmark.sequentialRead objectSize=16777216 us/op 888.286 1061.839 +19.54% 1 16 MiB 149491
ReadStrategyBenchmark.seekAndRead forwardGapBytes=0, strategy=SEQUENTIAL us/op 0.985 0.967 -1.82% 1 8 KiB 1496
ReadStrategyBenchmark.seekAndRead forwardGapBytes=0, strategy=RANDOM us/op 0.944 0.955 +1.15% 1 8 KiB 1528
ReadStrategyBenchmark.seekAndRead forwardGapBytes=0, strategy=ADAPTIVE us/op 0.995 0.949 -4.66% 1 8 KiB 1496
ReadStrategyBenchmark.seekAndRead forwardGapBytes=4096, strategy=SEQUENTIAL us/op 1.131 1.196 +5.69% 1 12 KiB 1544
ReadStrategyBenchmark.seekAndRead forwardGapBytes=4096, strategy=RANDOM us/op 1.125 1.189 +5.67% 1 12 KiB 1560
ReadStrategyBenchmark.seekAndRead forwardGapBytes=4096, strategy=ADAPTIVE us/op 1.203 1.200 -0.25% 1 12 KiB 1496
ReadStrategyBenchmark.seekAndRead forwardGapBytes=65536, strategy=SEQUENTIAL us/op 3.424 3.494 +2.06% 1 72 KiB 1472
ReadStrategyBenchmark.seekAndRead forwardGapBytes=65536, strategy=RANDOM us/op 3.488 3.582 +2.70% 1 72 KiB 1480
ReadStrategyBenchmark.seekAndRead forwardGapBytes=65536, strategy=ADAPTIVE us/op 3.391 3.515 +3.63% 1 72 KiB 1448
ReadStrategyBenchmark.seekAndRead forwardGapBytes=1048576, strategy=SEQUENTIAL us/op 0.988 0.951 -3.72% 2 8 KiB 1448
ReadStrategyBenchmark.seekAndRead forwardGapBytes=1048576, strategy=RANDOM us/op 1.058 1.040 -1.67% 2 8 KiB 1664
ReadStrategyBenchmark.seekAndRead forwardGapBytes=1048576, strategy=ADAPTIVE us/op 1.136 1.138 +0.13% 2 8 KiB 1864
SmallObjectCacheBenchmark.coldRead - us/op 51.890 54.726 +5.46% 1 256 KiB 263644
SmallObjectCacheBenchmark.warmRead - us/op 9.767 10.546 +7.97% 0 0 B 1208
TelemetryOverheadBenchmark.caffeineCacheHit - ns/op 16.719 18.616 +11.34% - - 16
TelemetryOverheadBenchmark.measureOperation listenerCount=0 ns/op 3.003 2.986 -0.59% - - 0
TelemetryOverheadBenchmark.measureOperation listenerCount=1 ns/op 161.335 156.988 -2.69% - - 392
TelemetryOverheadBenchmark.measureOperation listenerCount=8 ns/op 199.888 199.006 -0.44% - - 392
TelemetryOverheadBenchmark.noOpCacheLookup - ns/op 3.237 3.241 +0.14% - - 0
TelemetryOverheadBenchmark.recordMetric listenerCount=0 ns/op 3.205 3.197 -0.23% - - 0
TelemetryOverheadBenchmark.recordMetric listenerCount=1 ns/op 25.273 25.373 +0.39% - - 24
TelemetryOverheadBenchmark.recordMetric listenerCount=8 ns/op 39.666 41.387 +4.34% - - 24
VectoredRangeCoalescingBenchmark.mergeRanges gapBytes=0, ranges=16 ns/op 217.056 213.702 -1.55% - - 528
VectoredRangeCoalescingBenchmark.mergeRanges gapBytes=0, ranges=256 ns/op 3270.892 3158.531 -3.44% - - 6768
VectoredRangeCoalescingBenchmark.mergeRanges gapBytes=0, ranges=4096 ns/op 36652.247 31372.979 -14.40% - - 92176
VectoredRangeCoalescingBenchmark.mergeRanges gapBytes=1024, ranges=16 ns/op 221.417 218.671 -1.24% - - 528
VectoredRangeCoalescingBenchmark.mergeRanges gapBytes=1024, ranges=256 ns/op 3150.273 3095.092 -1.75% - - 6768
VectoredRangeCoalescingBenchmark.mergeRanges gapBytes=1024, ranges=4096 ns/op 33844.704 31740.319 -6.22% - - 105184
VectoredRangeCoalescingBenchmark.mergeRanges gapBytes=1048576, ranges=16 ns/op 249.505 240.911 -3.44% - - 1176
VectoredRangeCoalescingBenchmark.mergeRanges gapBytes=1048576, ranges=256 ns/op 3723.732 3780.328 +1.52% - - 18920
VectoredRangeCoalescingBenchmark.mergeRanges gapBytes=1048576, ranges=4096 ns/op 51513.880 48235.357 -6.36% - - 295640

@gcs-analytics-core-robot
gcs-analytics-core-robot force-pushed the sil/read-strategy-decryption-key branch from 88053e0 to 46bae09 Compare November 3, 2026 04:31
@gcs-analytics-core-robot
gcs-analytics-core-robot force-pushed the sil/read-strategy-decryption-key branch 2 times, most recently from efc9293 to 4807eb6 Compare November 3, 2026 10:43
Hypothesis: Exercising channel initialization and bounded read with decryptionKey configured verifies BlobSourceOption.decryptionKey propagation to Storage.reader and closes unexercised paths in AbstractReadStrategy.

Verified locally:
- ./mvnw -B -q -pl client test -Dtest=GcsReadChannelTest -Dsurefire.failIfNoSpecifiedTests=false
- ./mvnw -B -q spotless:check
@gcs-analytics-core-robot
gcs-analytics-core-robot force-pushed the sil/read-strategy-decryption-key branch from 4807eb6 to d863950 Compare November 3, 2026 11:02
@gcs-analytics-core-robot
gcs-analytics-core-robot merged commit c081a1b into GoogleCloudPlatform:main Nov 3, 2026
22 checks passed
@gcs-analytics-core-robot
gcs-analytics-core-robot deleted the sil/read-strategy-decryption-key branch November 3, 2026 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants