fix(ci): serve spec readable by nginx and run demo/bench on PRs - #66
Merged
Conversation
The previous fix put openapi.yaml in nginx's web root but kept it a bind-mount, so it retained the host uid/perms. nginx workers run as the unprivileged `nginx` user and still could not read it — Swagger UI kept showing 'Forbidden ./openapi.yaml'. Copy the spec into the container and chmod it instead, and fail fast if it is not fetchable. Both workflows now also run on pull_request when their own inputs change, check out the head branch, and push generated artifacts back to that branch instead of main. Pushes are skipped for fork PRs (read-only token).
Both workflows now push to the same branch, so whichever finishes second hits a non-fast-forward. Rebase onto the branch tip first.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The demo GIF still showed
Failed to load API definition / Forbidden ./openapi.yamlafter #65. That fix movedopenapi.yamlinto nginx's web root but kept it a bind-mount, so the file retained the host uid/perms. nginx workers run as the unprivilegednginxuser and still could not read it — hence the 403.This copies the spec into the container instead and
chmod 644s it, then fails fast if the spec is not actually fetchable.Both workflows also now run on
pull_requestwhen their own inputs change, so CI changes are verifiable before merging to main rather than after.Type of Change
Checklist
cargo fmt --allclean (no Rust changes)cargo clippy --all-targets --all-features -- -D warningsclean (no Rust changes)cargo testpasses locally (no Rust changes)CHANGELOG.mdunder[Unreleased](if user-facing)feat:,fix:,docs:, etc.)Testing
Reproduced the root cause locally and verified the fix:
Confirmed the cause — nginx runs workers as
nginx, not root:Verified the fix with a deliberately
0600spec (the CI failure condition) —docker cp+chmodmakes it readable and it servesHTTP 200.Ran the real
phase3.spec.tsagainst a0600spec: passes, and the recorded video's final frame shows the spec rendered (Test API 1.0.0 OAS 3.0) with no error banner and zero browser console errors.Workflow changes
pull_requesttrigger on both workflows, path-filtered to their own inputscheckoutusesgithub.head_ref || github.ref_name(PR checkouts are otherwise detached HEAD)mainRelated Issues
Follow-up to #65