oxidecomputer / third-party-api-clients

A place for keeping all our generated third party API clients.
https://docs.rs/octorust
MIT License
132 stars 55 forks source link

[github] update API to support rerun-failed-jobs #61

Closed chantra closed 1 year ago

chantra commented 1 year ago

Cherry-picked the rerun-failed-jobs action from an up-to-date spec. I did not include the enable_debug_logging parameter has it was not currently present with the existing re_run_workflow endpoint.

re-run on failed job doc: https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#re-run-failed-jobs-from-a-workflow-run Generated diff after make github: https://gist.github.com/chantra/c30751e00fe6034a4ace4ac73646afc6#file-gist-diff-L702

chantra commented 1 year ago

I did not include the generated libs as for some reason my toochain still introduce those &var.to_string() changes.

Also, I am not able to actually sync the spec as a whole currently so took this shortcut.

augustuswm commented 1 year ago

Cool thanks! I generally pull and build these changes to check them, so no need to include the generated files.

You are correct that the generator won't build against the current API spec, for a number of reasons. That is something I'm working on. The &var.to_string() lines come from how the generator is implemented. They can be cleaned up with clippy, but that takes a long time to run.

chantra commented 1 year ago

That is something I'm working on.

Great. I gave it a look, but it was quite complicated :grin:

The &var.to_string() lines come from how the generator is implemented. They can be cleaned up with clippy, but that takes a long time to run.

I believe we can nip it in the bud here: https://github.com/oxidecomputer/third-party-api-clients/blob/5480bb899ba9e36a43ced97303ed81e171f180e1/generator/src/template.rs#L148-L153

chantra commented 1 year ago

@augustuswm let me know if there is anything that looks off in this PR. Happy to iterate.

augustuswm commented 1 year ago

Looks good. Merging this and I'll get a release put together.