Weblate HTTP error handling: structured parsing for POST response errors#45
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds structured Weblate POST failure classification in ChangesWeblate error classification
Estimated code review effort: 2 (Simple) | ~15 minutes Sequence Diagram(s)sequenceDiagram
participant trigger_weblate
participant curl
participant report_weblate_post_error
trigger_weblate->>curl: POST request to Weblate
curl-->>trigger_weblate: exit code / HTTP status
alt curl fails
trigger_weblate->>report_weblate_post_error: curl_exit, resp_file
else unexpected HTTP status
trigger_weblate->>report_weblate_post_error: http_code, resp_file
end
report_weblate_post_error-->>trigger_weblate: classified message + remediation hint
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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.
Inline comments:
In @.github/workflows/assets/translation.sh:
- Around line 169-181: The HTTP status handling in the Weblate response `case`
treats many 4xx errors as server/network failures because they fall through to
the default branch. Add an explicit catch-all 4xx branch in the same `case` so
any unhandled 4xx is labeled as a client/payload error with a remediation that
tells the user to inspect the request. Keep the `5??` branch for true
server/network failures, and make the `*)` default distinct rather than
duplicating the 5xx message.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 20f93930-093f-46e0-8599-4408bb4b0d33
📒 Files selected for processing (3)
.github/workflows/assets/translation.shtests/helpers/http_mock.bashtests/test_trigger_weblate.bats
Close #39.
Summary by CodeRabbit