Weblate outbound POST JSON schema + schema-driven bats#58
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 (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe PR adds a JSON Schema for Weblate add-or-update requests, documents request and response contracts, bootstraps pinned schema-validation tooling, and updates CI and Bats tests to validate payloads and response fields. ChangesWeblate schema validation
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant CI
participant lint.sh
participant ensure_check_jsonschema
participant check-jsonschema
participant schema
CI->>lint.sh: run lint job
lint.sh->>ensure_check_jsonschema: initialize pinned validator
ensure_check_jsonschema->>check-jsonschema: reuse or install validator
lint.sh->>check-jsonschema: validate schemas and fixture
check-jsonschema->>schema: check metaschema and request payload
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: 2
🤖 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 `@scripts/ensure_check_jsonschema.sh`:
- Around line 14-18: Validate CHECK_JSONSCHEMA_VERSION immediately after
assigning version and before constructing venv_dir, rejecting path separators
and .. segments so it cannot escape cache_dir. Keep the existing cache paths and
cleanup behavior unchanged for valid version values.
In `@tests/helpers/schema.bash`:
- Around line 38-46: Replace the manual brace-counting extraction loop in the
schema helper with JSON-aware parsing using json.JSONDecoder.raw_decode or an
equivalent parser, so braces inside quoted strings are ignored and valid objects
such as task identifiers containing braces are extracted correctly. Preserve the
existing candidate collection behavior for multiple JSON values and malformed
text.
🪄 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: ba0fd8b5-3a70-4824-bccf-b108a7de80c6
📒 Files selected for processing (10)
.github/workflows/lint.ymldocs/endpoint-contract.mddocs/schemas/weblate-add-or-update.request.schema.jsonscripts/ensure_check_jsonschema.shscripts/lint.shscripts/test.shtests/helpers/fixtures/weblate-add-or-update-request-valid.jsontests/helpers/schema.bashtests/helpers/test_helper.bashtests/test_trigger_weblate.bats
henry0816191
left a comment
There was a problem hiding this comment.
update CHANGELOG.md with changes
Close #57.
Summary by CodeRabbit
task_id) and HTTP 200 (status: "ok"), and clarified request/response payload expectations.