feat(generator): generate quickstart scaffold#7676
Conversation
Modify the generator to also create a scaffold for the quickstart program. Then I used the generator to create the scaffold for the `logging`, `pubsublite`, `secretmanager`, and `tasks` libraries. The generated code requires some editing, but these are fairly small. These quickstarts are compiled in the `cmake-install` build, where we can compile them in parallel. This was very useful, it found several bugs in the generated CMake files.
|
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
Codecov Report
@@ Coverage Diff @@
## main #7676 +/- ##
==========================================
- Coverage 95.28% 95.28% -0.01%
==========================================
Files 1254 1254
Lines 113312 113414 +102
==========================================
+ Hits 107972 108067 +95
- Misses 5340 5347 +7
Continue to review full report at Codecov.
|
|
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
|
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
dbolduc
left a comment
There was a problem hiding this comment.
all nits. nothing functional.
| ### Setting up your repo | ||
|
|
||
| In order to use the $title$ C++ client library from your own code, | ||
| you'll need to configure your build system how to fetch and compile the Cloud |
|
|
||
| In order to use the $title$ C++ client library from your own code, | ||
| you'll need to configure your build system how to fetch and compile the Cloud | ||
| C++ client libraries. The Cloud C++ client libraries natively supports the |
|
|
||
| - `GOOGLE_CLOUD_CPP_ENABLE_TRACING=rpc` turns on tracing for most gRPC | ||
| calls. The library injects an additional Stub decorator that prints each gRPC | ||
| request and response. Unless you have configured you own logging backend, |
| including whether messages will be output on multiple lines, or whether | ||
| string/bytes fields will be truncated. | ||
|
|
||
| - `GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes` turns on logging in the library, basically |
|
|
||
| - `GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes` turns on logging in the library, basically | ||
| the library always "logs" but the logging infrastructure has no backend to | ||
| actually print anything until the application sets a backend or they set this |
| [`StatusOr<T>`][status-or-header] if an error is possible. This is an "outcome" | ||
| type, when the operation is successful a `StatusOr<T>` converts to `true` in | ||
| boolean context (and its `.ok()` member function returns `true`), the | ||
| application can then use `operator->` or `operator*` to access then `T` value. |
| boolean context (and its `.ok()` member function returns `true`), the | ||
| application can then use `operator->` or `operator*` to access then `T` value. | ||
| When the operation fails a `StatusOr<T>` converts to `false` (and `.ok()` | ||
| returns false). It is undefined behavior to use the value in this case. |
| [github-link]: https://github.com/googleapis/google-cloud-cpp 'GitHub Repository' | ||
| <!-- The ugly %2E disables auto-linking in Doxygen --> | ||
| [github-readme]: https://github.com/googleapis/google-cloud-cpp/blob/main/google/cloud/$library$/README%2Emd | ||
| [github-install]: https://github.com/googleapis/google-cloud-cpp/blob/main/doc/packagin%2Emd |
| load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
|
|
||
| # Fetch the Google Cloud C++ libraries. | ||
| # NOTE: Update this version and SHA256 as needed. |
There was a problem hiding this comment.
hm. this is a little weird. but I think renovate-bot would update it.
There was a problem hiding this comment.
Yeah, I figured that the benefit of trying to generate a perfect WORKSPACE file was not worth it since it will get updated anyway.
|
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
|
PTAL |
Modify the generator to also create a scaffold for the quickstart
program. Then I used the generator to create the scaffold for the
logging,pubsublite,secretmanager, andtaskslibraries.The generated code requires some editing, but these are fairly small.
These quickstarts are compiled in the
cmake-installbuild, where wecan compile them in parallel. This was very useful, it found several
bugs in the generated CMake files.
Sorry for the gigantic PR. Most of it is generated code, I think you
should pay attention to:
generator/google/cloud/*/doc/main.doxhad some light editinggoogle/cloud/*/quickstart/README.mdhas some light editinggoogle/cloud/*/quickstart/quickstart.cchas some significant editinggoogle/cloud/*/quickstart/*are generatedThis change is