Repository navigation
docs: add Google Cloud Bun compatibility matrix and Cloud Run quickstart - #9733
danieljbruce wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive guide (docs/bun.md) for running Google Cloud Node.js client libraries on the Bun runtime, along with a link to it in the main README.md. The guide covers minimum package versions, compatibility matrices, and a Cloud Run quickstart. However, a review comment correctly identifies that the relative links to cloud-run-bun.md and firebase-bun.md at the end of the document point to non-existent files, which will result in broken links for users.
| - **[Google Cloud Run (`Bun.serve()` `idleTimeout` & CPU Throttling)](cloud-run-bun.md)** | ||
| - **[Firebase (`oven/bun` on Cloud Run + Firebase Hosting `rewrites`)](firebase-bun.md)** |
There was a problem hiding this comment.
The relative links to cloud-run-bun.md and firebase-bun.md point to files that are not created in this pull request and do not exist in the repository. This will result in broken links for users reading the documentation. Please update these links to point to the correct existing files or external URLs, or remove them if those guides are not yet available.
| > Node.js idiomatic client libraries for [Google Cloud Platform](https://cloud.google.com/) services. | ||
|
|
||
| * [Node.js on Google Cloud][gcloud-homepage] | ||
| * [Running on the Bun Runtime (Compatibility Matrix & Cloud Run Quickstart)](docs/bun.md) |
There was a problem hiding this comment.
[Generated] Add a Runtime Support (Node.js & Bun) section to the root README.md linking to docs/bun.md, docs/cloud-run-bun.md, and docs/firebase-bun.md.
|
|
||
| - **[Google Cloud Run (`Bun.serve()` `idleTimeout` & CPU Throttling)](cloud-run-bun.md)** | ||
| - **[Firebase (`oven/bun` on Cloud Run + Firebase Hosting `rewrites`)](firebase-bun.md)** | ||
| - **Non-GCP Environments (Local Workstations, On-Premises, External CI):** Upgrade to `gcp-metadata >= 9.2.2` to avoid `MetadataLookupWarning` process warnings, or set `METADATA_SERVER_DETECTION=none` to skip GCE metadata server probing entirely. |
There was a problem hiding this comment.
[Generated] Add docs/bun.md publishing the official Google Cloud Node.js/TypeScript SDK Bun Runtime Guide, GCP Compute Environment Compatibility Matrix (Cloud Run, GKE, GCE, Cloud Functions Gen 2, GAE Flex/Standard, Firebase), minimum package versions table, and Cloud Run Quickstart.
a85c42a to
e26b551
Compare
eabf36c to
25ddf05
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive guide (docs/bun.md) and updates the main README to document support for the Bun runtime across Google Cloud Node.js client libraries. The guide outlines minimum package versions, compatibility matrices, and provides a Cloud Run quickstart with a Dockerfile and a TypeScript server example. Feedback on the quickstart example suggests wrapping the client.getProjectId() call in a try/catch block to gracefully handle potential credential or connection errors and prevent unhandled promise rejections.
| if (url.pathname === '/healthz') { | ||
| const projectId = await client.getProjectId(); | ||
| return Response.json({ | ||
| status: 'ok', | ||
| projectId, | ||
| runtime: `Bun ${Bun.version}`, | ||
| }); | ||
| } |
There was a problem hiding this comment.
In production environments or during local development, client.getProjectId() can throw an error if credentials are not configured or if the metadata server is unreachable. Wrapping this call in a try/catch block ensures that the /healthz endpoint returns a proper 500 status code instead of causing an unhandled promise rejection.
| if (url.pathname === '/healthz') { | |
| const projectId = await client.getProjectId(); | |
| return Response.json({ | |
| status: 'ok', | |
| projectId, | |
| runtime: `Bun ${Bun.version}`, | |
| }); | |
| } | |
| if (url.pathname === '/healthz') { | |
| try { | |
| const projectId = await client.getProjectId(); | |
| return Response.json({ | |
| status: 'ok', | |
| projectId, | |
| runtime: `Bun ${Bun.version}`, | |
| }); | |
| } catch (error) { | |
| return Response.json({ | |
| status: 'error', | |
| message: error instanceof Error ? error.message : String(error), | |
| }, { status: 500 }); | |
| } | |
| } |
Description
Adds official Google Cloud Bun runtime documentation, compatibility matrix, and quickstart.
Impact
Provides unified guidance and minimum package versions across all GCP environments.
Changes
docs/bun.mdproviding the official Google Cloud Node.js Client Libraries Bun Runtime Guide, including:gaxios >= 8.3.1,gcp-metadata >= 9.2.2,google-auth-library >= 11.3.1,teeny-request >= 11.1.1,googleapis-common >= 7.2.0,google-gax >= 6.13.0,@google-cloud/storage >= 8.4.0,@google-cloud/spanner >= 9.1.1,@google-cloud/bigtable >= 7.5.1).@google-cloud/profilerV8 nativepprofaddon limitation and OpenTelemetryAsyncLocalStorageContextManagerconfiguration.oven/bun:1Dockerfile,Bun.serve({ idleTimeout: 120 }),SIGTERMgraceful shutdown,--no-cpu-throttling), Firebase Hostingrewrites+ Cloud Run workflow, and non-GCP workstation configuration.docs/bun.md) from the rootREADME.md.Testing
python3 .agents/skills/cistack/scripts/cistack.py --repo-root . --base-ref fix/b578006723-gcp-metadata-bun-warnings --branches docs/b578006157-gcp-bun-compatibility-matrix --mode preflight-push2andbun --bun bin/run-test.cjs --no-c8 core/packages/gax/build/test/unit/streamArrayParser.js.docs/bun.mdandREADME.md.node ./bin/linter.mjs --strictpasses with zero errors.Alternatives
docs/bun.mdandREADME.md; rejected because developers need a single authoritative compatibility matrix and quickstart.gaxios,gcp-metadata,teeny-request), or@google-cloud/profiler; rejected because partial documentation leaves critical production pitfalls unaddressed.@google-cloud/*on Bun.Fixes b/578006157
Fixes b/574436144
Fixes b/575824782
Fixes b/575826065