-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add docker build with all formatting tools #82
Conversation
5914a3c
to
108c343
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but maybe @svix-jplatte should have the final say
@svix-onelson indeed, I want @svix-jplatte to have the final say here |
b025af1
to
20234f7
Compare
Co-authored-by: Jonas Platte <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some more nitpicks, but overall LGTM!
|
||
- name: Export digest | ||
# we create empty files with the sha256 digest of the docker image as the filename | ||
# since we did not push with a tag, the only way to identify the image is with the digest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Down the line we should probably do releases for openapi-codegen
and its Docker image, but for now this seems like a good start 👍
src/generator.rs
Outdated
if !self.output_dir.exists() { | ||
fs::create_dir_all(self.output_dir)?; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we actually have to check whether the dir exists first? I would expect that calling create_dir_all
on an already-existing directory is a no-op.
Also can't this happen further up the call tree? So we run it once per invocation, rather than once per template invocation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we actually have to check whether the dir exists first? I would expect that calling
create_dir_all
on an already-existing directory is a no-op.
Just tested it and you are right, not sure why the docs mention this If this function returns an error, some of the parent components might have been created already.
Also can't this happen further up the call tree? So we run it once per invocation, rather than once per template invocation?
Good call, let me move it up the call tree
Co-authored-by: Jonas Platte <[email protected]>
Using the docker image from svix/openapi-codegen#82 This results in the identical code. I replaced the `regen_openapi.sh` with a multi-threaded python script
This PR adds a arm64/amd64 docker image that include
openapi-codegen
rustfmt +nightly
(Rust)biome
(JS/TS)ruff
(Python)google-java-format
(Java)ktfmt
(Kotlin)rubyfmt
(Ruby)goimports
(Go)gofmt
(Go)csharpier
(C#)The
docker-release.yml
workflow builds and releases a new image on every push to mainThe images are pushed to
ghcr.io/svix/openapi-codegen
with taglatest
and<date>-<git rev-parse --short>
(20250228-ffac537
)I build the
arm64
image usingubuntu-24.04-arm
runnersThere is a little bit of a hack I have to do to get 2 separate builds for
arm64
/amd64
published under the same tagBut this is way faster then using QEMU!
Once the arm64 github runner is stable I want to use it in our svix-webhooks docker releases (instead of QEMU)