doc: updates to library generation guide - #16305
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the contributor guide for adding generated libraries by simplifying the instructions on updating the googleapis SHA and refining the shell command used to find .proto files. The review feedback points out that the sed pattern in the updated shell command fails to match the directory path containing a + character, and suggests a robust regex pattern to handle both Bzlmod and legacy workspace layouts.
| ```shell | ||
| find "${bazel_output_base}/external/googleapis+/${subdir}" -name '*.proto' -print0 | | ||
| xargs -0 grep -l '^service' | ||
| xargs -0 grep -l '^service' | sed 's|.*/external/googleapis/||' | sort |
There was a problem hiding this comment.
The sed pattern .*/external/googleapis/ will not match the paths generated by the find command because the directory name contains a + (i.e., external/googleapis+). As a result, the prefix will not be stripped.
Using googleapis[^/]*/ instead will robustly handle both Bzlmod (googleapis+ or googleapis~) and legacy workspace layouts.
| xargs -0 grep -l '^service' | sed 's|.*/external/googleapis/||' | sort | |
| xargs -0 grep -l '^service' | sed 's|.*/external/googleapis[^/]*/||' | sort |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #16305 +/- ##
==========================================
- Coverage 92.30% 92.30% -0.01%
==========================================
Files 2223 2223
Lines 208177 208177
==========================================
- Hits 192165 192158 -7
- Misses 16012 16019 +7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
colinmoy
left a comment
There was a problem hiding this comment.
See the gemini bot's suggestion
No description provided.