feat: fetch openapi.yaml file from release assets#49
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe helper.sh script now dynamically retrieves the OpenAPI specification browser_download_url from the latest GitHub release assets via the GitHub API (curl + jq), validates the result, and uses that URL for all subsequent docker-based generation steps. Changes
Sequence Diagram(s)sequenceDiagram
participant Script as helper.sh
participant GitHub as GitHub API
participant Docker as openapi-generator (docker)
Script->>GitHub: GET latest release assets (curl)
GitHub-->>Script: JSON with assets (includes browser_download_url)
Script->>Script: extract browser_url (jq) and validate
alt browser_url present
Script->>Docker: invoke generator with browser_url (generate,generate-html,generate-ci)
Docker-->>Script: generation output
else missing browser_url
Script-->>Script: exit with error
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@helper.sh`:
- Around line 32-36: The GitHub API call using the curl invocation (the curl ...
"$url" | jq ... pipeline) lacks timeouts and retries; add defensive network
bounds by updating the curl invocation to include options like --fail,
--connect-timeout (e.g., 5s), --max-time (e.g., 30s), and retry flags such as
--retry (e.g., 3), --retry-delay (e.g., 2) and optionally --retry-connrefused so
the call to "$url" will fail fast and retry transient failures before handing
the result to jq.
- Around line 31-36: The curl call that populates browser_url is using an
undefined variable "$url"; change the curl invocation to use the existing
gh_api_release_url variable instead so browser_url is fetched from
gh_api_release_url; update the reference in the browser_url assignment (where
curl is invoked) to pass gh_api_release_url to curl so the subsequent validation
of browser_url succeeds.
Summary by CodeRabbit
Refactor