From 6692fdb183b3efe24222996c09b0318dae14a1f0 Mon Sep 17 00:00:00 2001 From: Ian Duffy Date: Thu, 30 Jul 2026 22:28:07 +0100 Subject: [PATCH] fix: run swagger-codegen as the invoking user and stop masking build failures The scheduled "Update API bindings" workflow failed with exit code 127. Two separate defects combined to produce that: 1. Codegen output was root-owned. `docker container run` writes into the bind-mounted `bindings//src` directory as root, so on Linux the generated files end up owned by root. `scripts/fix-ruby-escaping.sh` uses `ruby -i` (in-place edit), which must unlink the original file and therefore needs write permission on the containing directory. That unlink failed with "Can't remove ...: Permission denied, skipping file", the apostrophe fix was silently skipped, and the following `ruby -c` reported the expected syntax error. The same wall would have been hit by the `uvx ruff check --fix` pass. This never reproduced locally because macOS bind mounts map container-root writes back to the host user. Fixed by running the codegen container as the invoking user. 2. The real error was then masked. `scripts/build.sh` dispatched languages via `test -z "$language" && { for ...; } || { build_language $language; }`. When a per-language build failed, the loop returned non-zero and the `||` branch ran with an empty `$language`, invoking `bindings//build.sh` and replacing the genuine exit status with 127. Fixed by using a plain if/else so a failing language build propagates. Co-Authored-By: Claude Opus 5 (1M context) --- bindings/java/build.sh | 2 +- bindings/python/build.sh | 2 +- bindings/ruby/build.sh | 2 +- scripts/build.sh | 6 +++--- scripts/common.sh | 6 ++++++ 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/bindings/java/build.sh b/bindings/java/build.sh index 684c4943..371e7327 100755 --- a/bindings/java/build.sh +++ b/bindings/java/build.sh @@ -45,7 +45,7 @@ cat > $build_json < $build_json < $build_json <