Skip to content

feat(force-dp-check): adding test to validate the force-dp using proxy server#4500

Merged
raj-prince merged 6 commits intomasterfrom
emulator_test_for_dp_check
Mar 24, 2026
Merged

feat(force-dp-check): adding test to validate the force-dp using proxy server#4500
raj-prince merged 6 commits intomasterfrom
emulator_test_for_dp_check

Conversation

@raj-prince
Copy link
Copy Markdown
Collaborator

@raj-prince raj-prince commented Mar 19, 2026

Description

  1. Update emulator.sh to start gRPC emulator server.
  2. Implemented gRPC proxy server to accept gRPC traffic from GCSFuse and pass it on emulator service (although right now not needed but useful in future for gRPC related emulator based test). Added header validation check in proxy server.
  3. Added test to confirm gRPC traffic contains the required header - (a) force_direct_connectivity & (b) direct_connectivity_diagnostic

Link to the issue in case of a bug fix.

b/493748028

Testing details

  1. Manual - Yes.
  2. Unit tests - NA
  3. Integration tests - Yes (tested manually).

Any backward incompatible change? If so, please explain.

@raj-prince raj-prince force-pushed the emulator_test_for_dp_check branch from 7bd82f6 to 0aec727 Compare March 19, 2026 12:40
@raj-prince raj-prince marked this pull request as ready for review March 19, 2026 12:43
@raj-prince raj-prince requested review from a team and Tulsishah as code owners March 19, 2026 12:43
@raj-prince raj-prince requested a review from ashmeenkaur March 19, 2026 12:43
@github-actions github-actions Bot added the remind-reviewers Auto remind reviewers in attention set for review post 24hrs of inactivity on PR. label Mar 19, 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 significantly enhances the integration testing capabilities by introducing a gRPC proxy server. This proxy is designed to intercept and validate gRPC request headers, specifically ensuring that GCSFuse clients correctly transmit DirectPath connectivity metadata. This addition is crucial for verifying the proper functioning of gRPC-based interactions with the storage emulator, providing a robust mechanism to confirm expected header behavior during various file operations.

Highlights

  • gRPC Proxy Server Implementation: A new gRPC proxy server has been implemented, capable of intercepting and forwarding gRPC traffic to a target host.
  • gRPC Header Validation: Header validation logic was added to the gRPC proxy, allowing it to check for specific headers and expected patterns in incoming gRPC requests. This is configurable via a YAML file.
  • Integration Tests for DirectPath Connectivity: New integration tests were introduced to validate that GCSFuse clients send the required DirectPath connectivity metadata (e.g., 'force_direct_connectivity=ENFORCED') in gRPC request headers when interacting with the storage emulator through the proxy.
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.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (f156c3e) to head (4563a4d).
⚠️ Report is 19 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #4500       +/-   ##
==========================================
- Coverage   83.73%       0   -83.74%     
==========================================
  Files         163       0      -163     
  Lines       20021       0    -20021     
==========================================
- Hits        16764       0    -16764     
+ Misses       2640       0     -2640     
+ Partials      617       0      -617     
Flag Coverage Δ
unittests ?

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.

Copy link
Copy Markdown
Contributor

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

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 a gRPC proxy server and a new integration test to validate that gRPC calls contain specific headers when force-dp is enabled. The implementation of the gRPC proxy using a raw codec and an unknown service handler is a solid approach for transparently forwarding requests. The new test suite effectively verifies the header presence for various file system operations.

I've found one issue in the gRPC server's shutdown handling that would cause it to crash during a normal shutdown. A fix is suggested. Overall, this is a great addition for ensuring DirectPath connectivity behavior.

Comment thread tools/proxy_server/main.go Outdated
@raj-prince raj-prince requested review from meet2mky and vadlakondaswetha and removed request for ashmeenkaur March 19, 2026 12:49
@github-actions
Copy link
Copy Markdown

Hi @Tulsishah, @meet2mky, @vadlakondaswetha, your feedback is needed to move this pull request forward. This automated reminder was triggered because there has been no activity for over 24 hours. Please provide your input when you have a moment. Thank you!

Copy link
Copy Markdown
Collaborator

@meet2mky meet2mky left a comment

Choose a reason for hiding this comment

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

Overall looks good. Few minor comments.

Comment thread tools/proxy_server/grpc_proxy.go
Comment thread tools/proxy_server/main.go
Comment thread tools/proxy_server/main.go Outdated
@raj-prince raj-prince requested a review from meet2mky March 24, 2026 07:15
Copy link
Copy Markdown
Collaborator

@meet2mky meet2mky left a comment

Choose a reason for hiding this comment

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

LGTM

@raj-prince raj-prince merged commit f04ca31 into master Mar 24, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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