Skip to content

fix(scripts): update generate script to use buf and remove obsolete generateTypes - #653

Merged
JakubWorek merged 1 commit into
a2aproject:mainfrom
Varun-S10:fix/issue-648
Aug 20, 2026
Merged

JakubWorek merged 1 commit into
a2aproject:mainfrom
Varun-S10:fix/issue-648

Conversation

@Varun-S10

Copy link
Copy Markdown
Contributor

Description

Thank you for opening a Pull Request!
Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

Fixes #648 🦕.


🔍 Summary of the Issue

When running npm run generate, the command failed because:

  1. 404 Not Found: It attempted to download a2a.json from a URL on main that no longer exists (as the spec transitioned to Protobuf).
  2. Corrupted File: curl saved the error message "404: Not Found" into spec.json.
  3. SyntaxError: scripts/generateTypes.js crashed trying to parse the 404 message as JSON, leaving behind a leftover spec.json file.
  4. Obsolete Workflow: In v1.0, data models were migrated from JSON Schema to Protobuf (src/types/pb/a2a.ts via Buf), making scripts/generateTypes.js obsolete leftover code.

🛠️ Changes Made

  1. package.json:
    • Updated the generate script to run the modern Protobuf code generator:
      "generate": "cd src/types && npx buf generate"
      This matches the official generation workflow documented in src/types/README.md.
    • Hardened generate:compat with -fSL on curl so it fails fast on HTTP/network errors rather than silently saving corrupt files.
  2. scripts/generateTypes.js:
    • Removed the obsolete legacy JSON-schema generation script.

🧪 Verification & Testing

  • npm run generate: Successfully runs Buf generation without network errors (exit code 0).
  • npm run generate:compat: Successfully generates v0.3 compatibility types (exit code 0).
  • Clean Workspace: Verified no temporary spec.json files are left on disk.
  • Unit Tests (npm test): All 68 test suites passed (1,487 unit tests).
  • Linting (npm run lint): Passed with 0 TypeScript/ESLint errors.
  • Build & Bundles (npm run build & npm run test-build): All ESM, CJS, DTS, workers-safe, gRPC, and Express bundles built successfully.

@Varun-S10
Varun-S10 requested a review from a team as a code owner August 14, 2026 04:54
@github-actions

github-actions Bot commented Aug 14, 2026 •

Copy link
Copy Markdown

🧪 Code Coverage

⬇️ Download Full Report

No coverage changes.

Generated by coverage-comment.yml

@JakubWorek
JakubWorek merged commit 8bf3cd3 into a2aproject:main Aug 20, 2026
15 checks passed
This was referenced Aug 20, 2026
bartek-gralewicz added a commit that referenced this pull request Aug 26, 2026
🤖 I have created a release *beep* *boop*
---


## [1.1.0](v1.0.1...v1.1.0)
(2026-08-26)


### Features

* make event bus keep-alive states configurable
([#669](#669))
([f844dad](f844dad)),
closes [#620](#620)


### Bug Fixes

* Add serialization for listTasks input/output parameters.
([#610](#610))
([c863497](c863497))
* clone push notification configs before storing
([#662](#662))
([4d175a0](4d175a0))
* **compat/v0_3/translate:** add null and undefined checks to array and
string fields ([#618](#618))
([108736b](108736b))
* **deps:** replace `uuid` package with `crypto.randomUUID()`
([#665](#665))
([636b060](636b060))
* Do not filter tasks in ListTasks if task state is unspecified
([#622](#622))
([1c6eb32](1c6eb32))
* **errors:** global error branding via Symbol.hasInstance to fix
instanceof checks across bundle entry points
([#612](#612))
([cc33173](cc33173))
* **scripts:** update generate script to use buf and remove obsolete
generateTypes ([#653](#653))
([8bf3cd3](8bf3cd3))
* **server:** send full Task on every v0.3 push trigger
([#658](#658))
([b3afbe4](b3afbe4))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: bartek-gralewicz <[email protected]>
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.

[Bug]: npm run generate fetches a file that no longer exists and dies on the 404 body

2 participants