-
Notifications
You must be signed in to change notification settings - Fork 52
add readme file #1387
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
base: main
Are you sure you want to change the base?
add readme file #1387
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
This change is really useful, thanks! Please sign the CLA and let us know, we cannot accept the change until then. Do you think we should refactor this to a chapter in the User Guide (see |
yes I do think we need documentation in tutorial style. And if you support I could try to contribute more in this way |
I cannot find a place where either of us can file a bug or otherwise troubleshoot the problem. Best advice I can give you is to try again in a few hours or something. |
I just sigh. @coryan |
One thing of note, the PR includes contributions using two different emails: Could you create a new PR with whatever email you used to sign the CLA (assuming you are able to sign the CLA at all). If that does not work, we should close the PR. I think your idea would be valuable as a chapter in the book. Happy to do it ourselves. |
I will retry this weekend ( Paris time zone). I hope that solves the issue. If not, you could add yourself directly. I will be more than happy to add more tutorial-style docs. |
@coryan, I updated my CLA signature. Please recheck. If the issue is still present, please add it yourself the way that you prefer. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1387 +/- ##
=======================================
Coverage 95.96% 95.96%
=======================================
Files 37 37
Lines 1462 1462
=======================================
Hits 1403 1403
Misses 59 59 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move this file to guide/src/
. I think we will need to break this down, you are covering too much ground for a single document.
First, the initialization of a simple client is already covered in "Setting up your development environment". We can probably skip that.
Second, the long running operations are already covered too, we can skip that.
We should use your example of how to initialize using service account credentials into a new chapter titled "Using service account credentials" (or something similar).
We should break the section on error handling to its own chapter also.
You will need to use mdformat
to fix a number of formatting issues:
https://github.com/googleapis/google-cloud-rust/actions/runs/13572960728/job/38427364311?pr=1387
And need to rebase to get the latest build scripts going.
#### Listing secrets | ||
|
||
```rust | ||
use google_cloud_secretmanager_v1::client::SecretManagerServiceClient; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the client name is simply SecretManagerService
. This is why we write the code samples as actual code in guide/samples/*
and embed the code using {{#include }}
to ensure the code actually compiles.
Please refactor all the code compilable code samples.
## Troubleshooting | ||
|
||
### Common issues | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a really good idea.
2. **API not enabled** | ||
- Enable the required APIs in your project: | ||
```bash | ||
gcloud services enable secretmanager.googleapis.com |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are missing some APIs used above, like speech.googleapis.com
. Keeping the tutorial focused on one topic makes it easier to catch these problems.
.await?; | ||
|
||
// Wait for completion | ||
let result = operation.await_complete().await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think this would compile.
Some Google Cloud operations may take a long time to complete. Here's how to handle them: | ||
|
||
```rust | ||
use google_cloud_speech_v2::client::SpeechClient; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name of this client is incorrect again.
} | ||
``` | ||
|
||
### Working with long-running operations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have two tutorials dedicated to this:
https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
https://googleapis.github.io/google-cloud-rust/configuring_polling_policies.html
This seems redundant.
Ok(()) | ||
} | ||
Err(e) => { | ||
if let Some(status) = e.downcast_ref::<ServiceError>() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type of status
would be ServiceError
, but you are using it as if it was Status
.... does this code compile?
Pull Request: Refactor Tutorial to Google Cloud Style Documentation
Description
This PR refactors the existing web tutorial to follow Google Cloud's documentation style guidelines, improving readability and usability for developers.
Changes Made
Key Features
Authentication Examples
Error Handling
Long-running Operations
Troubleshooting Guide
Testing Done
Screenshots
N/A (Documentation changes only)
Related Issues
Closes #[issue_number] - Add Google Cloud style documentation
Checklist
Notes for Reviewers
Please pay special attention to: