estuary icon indicating copy to clipboard operation
estuary copied to clipboard

Create pipeline to automatically sync swagger client code

Open 10d9e opened this issue 3 years ago • 4 comments

Since we are using swagger to define Estuary's API ( ie. https://github.com/application-research/estuary/blob/master/docs/swagger.yaml ), we should be using a pipeline to keep the multiple SDKs up to date automatically. Current swagger-based SDKs are:

  • https://github.com/application-research/estuary-java-sdk
  • https://github.com/application-research/estuary-csharp-sdk
  • https://github.com/application-research/estuary-js-sdk
  • https://github.com/application-research/estuary-rust-sdk

Each can be generated with the openapi-generator docker image as follows (see also the openapi-generator docker README):

docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli generate \
    -i https://raw.githubusercontent.com/application-research/estuary/master/docs/swagger.yaml \
    -g rust \
    -o /local/out/estuary-rust-sdk

Ideally, a pipeline step could be added to the existing release workflow to perform these updates.

Risk: figure out if github actions allow for code checkins/updates to other repos

Postscript:

It would also be ideal to have the main pipeline sync the swagger docs via make generate-swagger before performing the code generation.

10d9e avatar Jun 09 '22 14:06 10d9e

PR for docs generation -- https://github.com/application-research/estuary/pull/269/files

anjor avatar Jun 10 '22 14:06 anjor

We should be able to use https://github.com/marketplace/actions/push-to-a-repo for the SDKs

anjor avatar Jun 10 '22 14:06 anjor

@anjor nicely done sir! Do you think we should to the SDK sync-ing on each merge/checkin to master or each release cut?

10d9e avatar Jun 10 '22 19:06 10d9e

I think we should do it on release cuts. That way there is a sense of confidence/stability in the sdk.

anjor avatar Jun 20 '22 13:06 anjor

@snissn is this functionality already completed?

10d9e avatar Dec 01 '22 13:12 10d9e

Lmao yup!! I was confused just now reading this 😂

snissn avatar Dec 01 '22 13:12 snissn

Yeah I think we can close this.

anjor avatar Dec 01 '22 14:12 anjor