Conversation
There was a problem hiding this comment.
Code Review
This pull request migrates the repository to a pnpm workspace, updating numerous .gitignore and CONTRIBUTING.md files, adjusting CI scripts, and updating generated protobuf files. Feedback on these changes highlights several improvement opportunities: nested npm scripts in gax/package.json should be updated to pnpm, stubbed tests in pack-n-play should be explicitly skipped using it.skip rather than left empty, and relative file: paths in package dependencies should be replaced with the workspace: protocol. Additionally, the reviewer advises against using 'as any' type assertions in apirequest.ts and hapi.ts, recommending instead that workspace dependency versions be aligned or safer type casting be implemented to preserve TypeScript's type safety.
| .setUrl(urlString) | ||
| .setUserAgent(getSingleHeader(req!.headers['user-agent'])) | ||
| .setReferrer(getSingleHeader(req!.headers.referrer)) | ||
| .setUserAgent(getSingleHeader(req!.headers['user-agent'] as any)) | ||
| .setReferrer(getSingleHeader(req!.headers.referrer as any)) | ||
| .setStatusCode(attemptToExtractStatusCode(req!)) |
There was a problem hiding this comment.
Using as any here discards type safety. If the type mismatch is due to req.headers being typed as IncomingHttpHeaders (where header values can be string | string[] | undefined) and getSingleHeader expecting a specific type, it is safer to cast to the expected type (e.g., string | string[] or string) or handle the undefined case explicitly, rather than using as any.
e6cc561 to
6c89a95
Compare
cb57351 to
0605630
Compare
d6f3a40 to
5ba1875
Compare
…scoding, and configure local gax overrides
Description
Migrate repository to a PNPM workspace with Turborepo caching and CI test sharding.
This modernization speeds up dependency installation, reduces disk space usage, enforces strict dependency boundaries across monorepo packages, and drastically cuts CI turnaround time.
Key Highlights & Changes
PNPM Workspace & Turborepo (
feat(workspace)):pnpm-workspace.yamland rootpnpm-lock.yamlto manage packages acrosscore/*,handwritten/*, andpackages/*.turbo.json) to cachecompiletasks across all packages with proper input tracking (protos/**,src/**,test/**), saving ~20 minutes on CI build steps.package.jsonto enforcepnpmpackage management and set compilation concurrency..npmrcwithlink-workspace-packages=falseto mirror production registry resolution.bin/linter.mjs,.mocharc.cjs,.gitignore).Core Tools & Packages Compatibility (
fix(core)):core/packages/gax/scripts/copy-protos.js) and compilation scripts ingaxandtools.pack-n-playtest fixtures andgapic-generator-typescriptbaselines.Handwritten Package & Build Fixes (
fix(handwritten)):storage,bigtable,spanner, andcloud-profiler.google-storage-controlprotos.Kokoro & Cloud Build Modernization (
ci(scripts)):.kokoro/*.sh) andcloudbuild.yamlscripts across handwritten and core packages to usepnpm.GitHub Actions CI Workflows & Matrix Sharding (
ci(github)):