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

examples: improve package comments #7658

Merged
merged 8 commits into from
Oct 7, 2024

Conversation

eshitachandwani
Copy link
Member

@eshitachandwani eshitachandwani commented Sep 22, 2024

Updated the comments in various example files to provide clearer and more detailed descriptions and to make the code easier to understand for users who are reading through the examples.

Changes:

  • Enhanced comments to better explain the functionality and flow of the examples.
  • Added context where necessary to clarify the use of specific gRPC features.
  • Improved formatting and consistency in comment styles.

RELEASE NOTES: none

@eshitachandwani eshitachandwani added this to the 1.68 Release milestone Sep 22, 2024
@eshitachandwani eshitachandwani added the Type: Documentation Documentation or examples label Sep 22, 2024
Copy link

codecov bot commented Sep 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.00%. Comparing base (8ea3460) to head (d97740d).
Report is 12 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7658      +/-   ##
==========================================
+ Coverage   81.86%   82.00%   +0.14%     
==========================================
  Files         361      361              
  Lines       27821    27822       +1     
==========================================
+ Hits        22775    22815      +40     
+ Misses       3847     3825      -22     
+ Partials     1199     1182      -17     

see 35 files with indirect coverage changes

@eshitachandwani eshitachandwani changed the title Examples/feature : Improving comments for package main examples : Improving comments for package main Sep 24, 2024
@@ -16,7 +16,8 @@
*
*/

// Binary server is an example server.
// Binary server demonstrates how to install and support compressors for
// incoming RPCs.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think its not clear how compressor is supported. Perhaps we can try to be a little bit more clear how support happens. may be at line 30?

// Importing the gzip encoding registers it as an available compressor.
// gRPC will automatically negotiate and use gzip if the client supports it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the current trailing comment on line 30 is clear enough and is more appropriate for a blank import compared to the comment added by this change.

A statement like // gRPC will automatically negotiate and use gzip if the client supports it. feels more appropriate in the README file.

Copy link
Contributor

Choose a reason for hiding this comment

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

oh I meant to modify the package comment to something like Binary server demonstrates importing the gzip encoding to register it as an available compressor

I remember an issue some time back where user was confused how to enable compression even after providing the link to example until I mentioned to them importing is all we need to do and rest is taken care by grpc

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe, we should improve the documentation somewhere (either in the example, or in Documentation/compression.md or in the gzip package) then?

examples/features/load_balancing/server/main.go Outdated Show resolved Hide resolved
examples/features/reflection/server/main.go Show resolved Hide resolved
@purnesh42H purnesh42H changed the title examples : Improving comments for package main examples: improve package comments Sep 29, 2024
examples/features/authz/client/main.go Outdated Show resolved Hide resolved
examples/features/cancellation/client/main.go Outdated Show resolved Hide resolved
@@ -16,7 +16,8 @@
*
*/

// Binary server is an example server.
// Binary server demonstrates how to install and support compressors for
// incoming RPCs.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the current trailing comment on line 30 is clear enough and is more appropriate for a blank import compared to the comment added by this change.

A statement like // gRPC will automatically negotiate and use gzip if the client supports it. feels more appropriate in the README file.

examples/features/deadline/client/main.go Outdated Show resolved Hide resolved
examples/features/deadline/server/main.go Outdated Show resolved Hide resolved
examples/features/metadata_interceptor/client/main.go Outdated Show resolved Hide resolved
examples/features/name_resolving/client/main.go Outdated Show resolved Hide resolved
examples/features/orca/client/main.go Outdated Show resolved Hide resolved
examples/features/orca/server/main.go Outdated Show resolved Hide resolved
examples/features/reflection/server/main.go Show resolved Hide resolved
@easwars easwars assigned eshitachandwani and unassigned purnesh42H Oct 1, 2024
@eshitachandwani eshitachandwani removed the Type: Documentation Documentation or examples label Oct 4, 2024
@eshitachandwani eshitachandwani added Type: Documentation Documentation or examples and removed Type: Documentation Documentation or examples labels Oct 4, 2024
examples/features/metadata/client/main.go Outdated Show resolved Hide resolved
@easwars easwars assigned eshitachandwani and unassigned easwars and purnesh42H Oct 4, 2024
@easwars easwars merged commit 5fd9853 into grpc:master Oct 7, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Documentation Documentation or examples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants