Skip to content

nodejs: packages/google-cloud-compute/protos/protos.js exceeding GitHub's 100 MB limit #8889

Description

@suztomo

Originally this issue is found in googleapis/librarian#6638.

suztomo@suztomo:~/librarian-2026/google-cloud-node$ git add . && git commit -m "chore: generation diff as of July 6th"
...
suztomo@suztomo:~/librarian-2026/google-cloud-node$ gh pr create --draft
? Where should we push the 'generation-diff-july-6th' branch? suztomo/google-cloud-node

Creating draft pull request for suztomo:generation-diff-july-6th into main in googleapis/google-cloud-node

? Title (required) chore: generation diff as of July 6th
? Choose a template PULL_REQUEST_TEMPLATE.md
? Body <Received>
? What's next? Submit as draft
remote: warning: File packages/google-cloud-aiplatform/protos/protos.js is 60.58 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB        
remote: error: Trace: 5d11ea147b4f5e0c2de65ae57df0821cd99c10947e820974ff17ef788628b340        
remote: error: See https://gh.io/lfs for more information.        
remote: error: File packages/google-cloud-compute/protos/protos.js is 102.10 MB; this exceeds GitHub's file size limit of 100.00 MB        
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.        
To https://github.com/suztomo/google-cloud-node.git
 ! [remote rejected]       HEAD -> generation-diff-july-6th (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/suztomo/google-cloud-node.git'
failed to run git: exit status 1

https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/protos/protos.js (as of today) has 98 MB.

Changing the push destination to the upstream (https://github.com/googleapis/google-cloud-node.git) didn't help:

remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.        
To https://github.com/googleapis/google-cloud-node.git
 ! [remote rejected]       HEAD -> generation-diff-july-6th (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/googleapis/google-cloud-node.git'
failed to run git: exit status 1

Ran command: (cd librarian && echo "librarian: $(git rev-parse HEAD)") && (cd google-cloud-node && echo "google-cloud-node: $(git rev-parse HEAD)")
Ran command: cd google-cloud-node && git ls-files | grep -i compileprotos
Viewed compileProtos.ts:1-466

How this big file is generated

Step-by-Step Generation Pipeline

graph TD
    A["librarian generate<br/>google-cloud-compute"] --> B["1. gapic-generator-typescript<br/>(Generates TypeScript &<br/>src/*/*_proto_list.json)"]
    B --> C["2. gapic-node-processing<br/>(combine-library)<br/>(Moves from owl-bot-staging<br/>to package output)"]
    C --> D["3. copyMissingProtos()<br/>(Copies referenced proto<br/>files to protos/)"]
    D --> E["4. compileProtos (gapic-tools)<br/>(Executes compileProtos.ts)"]
    E --> F["5. pbjs (protobufjs-cli)<br/>(Compiles protos into<br/>protos/protos.js &<br/>protos/protos.json)"]
    F --> G["6. fixJsFile()<br/>(Re-exports from google-gax<br/>& adds Apache 2.0 header)"]
    G --> H["7. pbts (protobufjs-cli)<br/>(Generates protos/protos.d.ts<br/>from protos.js)"]
Loading

Detailed Step Breakdown

1. Librarian Entrypoint & GAPIC Generation

  • Source: internal/librarian/nodejs/generate.go:L50-L83 (Generate())
  • Actions:
    • Librarian resolves the library target (packages/google-cloud-compute) and iterates over API versions (google/cloud/compute/v1, v1beta, etc.).
    • Runs gapic-generator-typescript on each API version.
    • Output: Generates TypeScript client code and a manifest of required .proto files at src/<version>/<api>_proto_list.json in owl-bot-staging/.

2. Staging & Package Assembly

3. Proto File Collection

4. Executing compileProtos

5. Proto Compilation with pbjs (The 99 MB File Generation)

  • Source: core/packages/tools/src/compileProtos.ts:L259-L352 (compileProtos())
  • Actions:
    • findProtoJsonFiles('src') finds all *_proto_list.json files in src/.
    • pbjsMain() executes protobufjs-cli/pbjs:
      pbjs -r google_cloud_compute_protos --target static-module -p protos -o protos/protos.js <proto_files...>
    • pbjs generates a single, static JavaScript module containing object definitions and serialization/deserialization logic for every Google Compute Engine proto message and enum across v1 and v1beta. Because Compute Engine has an unusually massive API surface, this unminified JS file reaches ~99 MB.

6. Post-Processing & Header Injection

7. TypeScript Declaration Generation (protos.d.ts)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions