sigstore-js icon indicating copy to clipboard operation
sigstore-js copied to clipboard

set-up codegen from sigstore bundle protobufs

Open bdehamer opened this issue 1 year ago • 2 comments

Signed-off-by: Brian DeHamer [email protected]

Summary

Adds some plumbing to automatically codegen types for the sigstore bundle format from the published protobufs.

Types can be re-generated by executing the following:

npm run codegen:bundle

The generated types are written to src/bundle/__generated__.

Release Note

  • New script in package.json for re-generating bundle types from their protobufs

bdehamer avatar Aug 26 '22 18:08 bdehamer

cc @kommendorkapten @patflynn generating TypeScript types from the protobufs in https://github.com/sigstore/cosign/pull/2204

bdehamer avatar Aug 28 '22 00:08 bdehamer

@bdehamer just force pushed as I forgot to add sig-off info on the commits.

feelepxyz avatar Sep 01 '22 11:09 feelepxyz

@eddiezane 👋 gentle bump, did you have any ideas for improvements here?

feelepxyz avatar Sep 12 '22 14:09 feelepxyz

@feelepxyz thanks for working on this. I took what you did and refactored a bit:

  • Moved the script and Dockerfile into a new hack directory (I think this was one of the things @eddiezane had suggested)
  • That bit where the same script was being used to initiate the docker build and also served as the entrypoint of the container was a bit too 🤯 for my simple brain. I split these two responsibilities into separate scripts that I think are a bit easier to grok.
  • I moved the retrieval of the cosign proto files out of the Dockerfile and back into the generate-bundle-types script. This way, the image we're building becomes a general-purpose protoc wrapper that we can re-use if we find that we need to do more protobuf codegen in the future.

bdehamer avatar Sep 14 '22 18:09 bdehamer