Skip to content

fix(requester pays): Fix requester pays for gRPC and also setup integration tests with gRPC with explicit SA.#4611

Merged
meet2mky merged 7 commits into
masterfrom
mohit-requester-pays-fix
Apr 16, 2026
Merged

fix(requester pays): Fix requester pays for gRPC and also setup integration tests with gRPC with explicit SA.#4611
meet2mky merged 7 commits into
masterfrom
mohit-requester-pays-fix

Conversation

@meet2mky

@meet2mky meet2mky commented Apr 10, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR fixes a bug in gRPC protocol requester pays feature. Where the billing project is not populated correctly causing errors of the following types.

InvalidArgument desc = Bucket is a requester pays bucket but no user project provided.\nerror details: name = BadRequest field =  desc = Bucket is a requester pays bucket but no user project provided."}

Testing

Created separate SA with the required permission to test the requester pays feature correctly. Previously ran tests used overly Privileged account which had resourcemanager.projects.createBillingAssignment permission on the project to which the bucket in test belonged. This causes the the requester pays tests to pass even if the billing project is not provided thus masking the failures.

The SA and relevant permissions have been setup accordingly for the gcs-fuse-test and gcs-fuse-test-ml prjoects.

Tests are passing on GKE as well: https://b.corp.google.com/issues/500550846#comment19

Link to the issue in case of a bug fix.

b/500550846

Testing details

  1. Manual - Yes
  2. Unit tests - NA
  3. Integration tests - Yes

Any backward incompatible change? If so, please explain.

NONE

@meet2mky meet2mky added execute-integration-tests Run only integration tests execute-integration-tests-on-zb To run E2E tests on zonal bucket. labels Apr 10, 2026
@codecov

codecov Bot commented Apr 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.25000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.67%. Comparing base (8a9f498) to head (5b95b0f).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
internal/storage/storage_handle.go 78.57% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4611      +/-   ##
==========================================
+ Coverage   83.64%   83.67%   +0.02%     
==========================================
  Files         164      164              
  Lines       20272    20278       +6     
==========================================
+ Hits        16956    16967      +11     
+ Misses       2676     2672       -4     
+ Partials      640      639       -1     
Flag Coverage Δ
unittests 83.67% <81.25%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@meet2mky meet2mky changed the title fix(requester pays feat): DNR Trying out fix in requester pays. fix(requester pays): Fix requester pays for gRPC and also setup integration tests with gRPC with explicit SA. Apr 14, 2026
@meet2mky meet2mky force-pushed the mohit-requester-pays-fix branch 2 times, most recently from 50e35d9 to fd71118 Compare April 14, 2026 05:20
@meet2mky meet2mky marked this pull request as ready for review April 14, 2026 05:28
@meet2mky meet2mky requested a review from a team as a code owner April 14, 2026 05:28
@github-actions github-actions Bot added the remind-reviewers Auto remind reviewers in attention set for review post 24hrs of inactivity on PR. label Apr 14, 2026
@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 addresses a bug in the gRPC protocol implementation where the billing project was not correctly propagated, leading to failures in requester pays scenarios. Additionally, it enhances the integration testing suite by introducing a dedicated service account and improved credential management, ensuring that tests correctly validate requester pays behavior by avoiding reliance on overly privileged accounts that previously masked potential issues.

Highlights

  • gRPC Requester Pays Fix: Correctly populates the billing project in gRPC requests to resolve 'Bucket is a requester pays bucket but no user project provided' errors.
  • Integration Test Improvements: Updated integration tests to use a dedicated service account with appropriate permissions, ensuring requester pays functionality is tested accurately without relying on overly privileged accounts.
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 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 counter productive. 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.

@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 introduces support for requester-pays buckets by allowing a billing project to be specified and propagated through the storage and bucket handles. Key changes include the addition of a billingProject field, manual metadata injection for gRPC ListObjects calls, and updated integration tests that handle service account credentials. A review comment points out a high-severity issue where using option.WithQuotaProject on a shared gRPC client could lead to incorrect billing attribution across different buckets, recommending that this configuration be handled at the bucket level instead.

Comment thread internal/storage/storage_handle.go Outdated
Comment thread internal/storage/bucket_handle.go
Comment thread tools/integration_tests/requester_pays_bucket/setup_test.go
Comment thread tools/integration_tests/util/creds_tests/creds.go

@raj-prince raj-prince left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good overall.

Added couple of minor comments.

@meet2mky meet2mky force-pushed the mohit-requester-pays-fix branch from 1460fb2 to 5b95b0f Compare April 16, 2026 07:26
@meet2mky meet2mky merged commit 070dc75 into master Apr 16, 2026
14 checks passed
@meet2mky meet2mky deleted the mohit-requester-pays-fix branch April 16, 2026 11:03
@meet2mky meet2mky restored the mohit-requester-pays-fix branch April 16, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

execute-integration-tests Run only integration tests execute-integration-tests-on-zb To run E2E tests on zonal bucket. remind-reviewers Auto remind reviewers in attention set for review post 24hrs of inactivity on PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants