Skip to content

docs: add Google Cloud Bun compatibility matrix and Cloud Run quickstart - #9733

Draft
danieljbruce wants to merge 1 commit into
fix/b578006723-gcp-metadata-bun-warningsfrom
docs/b578006157-gcp-bun-compatibility-matrix
Draft

danieljbruce wants to merge 1 commit into
fix/b578006723-gcp-metadata-bun-warningsfrom
docs/b578006157-gcp-bun-compatibility-matrix

Conversation

@danieljbruce

Copy link
Copy Markdown
Contributor

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

  • Add docs/bun.md providing the official Google Cloud Node.js Client Libraries Bun Runtime Guide, including:
    • Minimum required package versions table (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).
    • Full Handwritten, Core, and GAPIC Client Library compatibility matrix, explicitly documenting the @google-cloud/profiler V8 native pprof addon limitation and OpenTelemetry AsyncLocalStorageContextManager configuration.
    • Cloud Run Bun quickstart (oven/bun:1 Dockerfile, Bun.serve({ idleTimeout: 120 }), SIGTERM graceful shutdown, --no-cpu-throttling), Firebase Hosting rewrites + Cloud Run workflow, and non-GCP workstation configuration.
  • Link the Bun Runtime Guide (docs/bun.md) from the root README.md.

Testing

  • Steps to Reproduce (in terminal):
    • Run 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-push2 and bun --bun bin/run-test.cjs --no-c8 core/packages/gax/build/test/unit/streamArrayParser.js.
  • Verified Markdown formatting and table rendering in docs/bun.md and README.md.
  • Verified node ./bin/linter.mjs --strict passes with zero errors.

Alternatives

  • Scatter Bun compatibility notes across individual issue comments without a centralized guide in docs/bun.md and README.md; rejected because developers need a single authoritative compatibility matrix and quickstart.
  • Document only Cloud Run without covering Firebase Hosting rewrites, minimum transitive package versions (gaxios, gcp-metadata, teeny-request), or @google-cloud/profiler; rejected because partial documentation leaves critical production pitfalls unaddressed.
  • Do not publish in-repo documentation, leaving users without official guidance for running @google-cloud/* on Bun.

Fixes b/578006157
Fixes b/574436144
Fixes b/575824782
Fixes b/575826065

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread docs/bun.md
Comment on lines +100 to +101
- **[Google Cloud Run (`Bun.serve()` `idleTimeout` & CPU Throttling)](cloud-run-bun.md)**
- **[Firebase (`oven/bun` on Cloud Run + Firebase Hosting `rewrites`)](firebase-bun.md)**

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

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.

Comment thread README.md
> 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)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

[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.

Comment thread docs/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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

[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.

@danieljbruce
danieljbruce force-pushed the fix/b578006723-gcp-metadata-bun-warnings branch from a85c42a to e26b551 Compare October 27, 2026 16:55
@danieljbruce
danieljbruce force-pushed the docs/b578006157-gcp-bun-compatibility-matrix branch from eabf36c to 25ddf05 Compare October 27, 2026 16:55
@danieljbruce

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread docs/bun.md
Comment on lines +69 to +76
if (url.pathname === '/healthz') {
const projectId = await client.getProjectId();
return Response.json({
status: 'ok',
projectId,
runtime: `Bun ${Bun.version}`,
});
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

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.

Suggested change
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 });
}
}

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant