fix: strip component-level servers blocks before OpenAPI merge#1994
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe Justfile adds a ChangesOpenAPI build pipeline preprocessing
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~4 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
Justfile (1)
36-38: ⚡ Quick winConsider adding error handling to the stripping loop.
The for loop will silently continue if
yqfails on any file. Consider addingset -eor checking exit codes to fail fast on errors.♻️ Proposed fix to add error handling
# Strip component-level servers blocks so only base.yaml servers survive the merge strip-servers: prepend-paths - for f in components/*.openapi.yaml; do yq -i 'del(.servers)' "$f"; done + set -e; for f in components/*.openapi.yaml; do yq -i 'del(.servers)' "$f"; done🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Justfile` around lines 36 - 38, The strip-servers recipe's for-loop (task name "strip-servers: prepend-paths") currently runs yq silently and will continue on errors; modify the recipe to fail fast by enabling shell error checking (e.g., set -e or set -euo pipefail at the top of the recipe) or by checking each yq exit status (e.g., after the yq command, exit nonzero on failure) so any yq failure aborts the Justfile task immediately and surfaces the error.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@Justfile`:
- Around line 36-38: The strip-servers recipe's for-loop (task name
"strip-servers: prepend-paths") currently runs yq silently and will continue on
errors; modify the recipe to fail fast by enabling shell error checking (e.g.,
set -e or set -euo pipefail at the top of the recipe) or by checking each yq
exit status (e.g., after the yq command, exit nonzero on failure) so any yq
failure aborts the Justfile task immediately and surfaces the error.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 7a17ddfa-4891-4f0c-8e8d-cb3ed4165213
⛔ Files ignored due to path filters (1)
.speakeasy/workflow.lockis excluded by!**/*.lock,!**/*.lock
📒 Files selected for processing (1)
Justfile
Component specs (auth, ledger, orchestration, wallets, webhooks) declare their own servers block (http://localhost:8080/) which conflicts with base.yaml during the Speakeasy merge. This caused every operation in the generated spec to inherit an operation-level servers block, while the root-level servers from base.yaml were lost. Add a strip-servers step that removes servers from all component specs before the merge, so only base.yaml servers survive at root level. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
776884c to
624de07
Compare
Summary
serversblock (http://localhost:8080/) which conflicts withbase.yamlduring the Speakeasy mergeserversblock while the root-level servers frombase.yamlare loststrip-serversstep in the Justfile that removesserversfrom all component specs before merge, using a glob so any new component is automatically handledTest plan
just build-openapi— root-level servers frombase.yamlnow present, 0/249 operations have operation-level servers🤖 Generated with Claude Code