{{ message }}
Fix some aspects of endpoint#105
Merged
Merged
Conversation
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 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 @.env.example:
- Line 50: There is a duplicate environment variable definition for
WEBLATE_REGISTRATION_OPEN; remove the redundant entry so the variable is defined
only once (keep the intended value and delete the other line), ensuring the
single remaining WEBLATE_REGISTRATION_OPEN entry reflects the correct
boolean/value used by the application.
In `@src/boost_weblate/endpoint/serializers.py`:
- Around line 87-115: The _flatten_field_errors function in
AddOrUpdateRequestSerializer currently stringifies DRF ErrorDetail objects which
breaks stable error-code mapping; modify _flatten_field_errors to propagate each
error's drf_code (use getattr(err, "code", None)) and return tuples like
(subfield, message, drf_code) instead of just (subfield, message), update any
call sites (including _code_for_drf_error) to accept the new triplet shape, and
change _code_for_drf_error to map DRF codes directly (e.g., ListField codes
"not_a_list" and "empty" → INVALID_SUBMODULE_LIST, missing field "required" →
REQUIRED_FIELD) rather than doing substring matching on message text. Ensure
nested branches (lists, dicts, ErrorDetail instances) preserve and propagate the
drf_code and adjust tests/consumers to handle the new tuple form.
In `@src/boost_weblate/endpoint/services.py`:
- Around line 131-138: The code currently runs subprocess.run(...) and uses
git_status.stdout without checking git_status.returncode, so add an explicit
check after the subprocess call (inspect git_status.returncode) and treat any
non-zero return code as a failure: log the error including git_status.stderr and
git_status.returncode (using the existing logger), and abort/raise (do not
proceed with DB deletion) when returncode != 0; update the block around the
subprocess.run invocation and the git_status variable usage to enforce this
explicit failure path (reference: git_status, subprocess.run call that uses
["git", "-C", base_path, "status", "--porcelain"]).
- Around line 146-156: The git commit call in subprocess.run (the one building
args with "git", "-C", base_path, "commit", "-m", f"Remove translation files for
deleted component: {name}", "--author", author) is not path-scoped and may
include unrelated staged changes; change the command to explicitly limit the
commit to the removed translation file paths by appending "--" followed by the
list of removed file paths (e.g., a variable like removed_paths or
removed_files) to the args passed to subprocess.run so only those files are
committed (ensure you pass the exact relative paths as arguments after the
"--").
🪄 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: 29945e07-71dd-402e-89f4-18b3aa1b5a2c
📒 Files selected for processing (10)
.env.examplesrc/boost_weblate/endpoint/errors.pysrc/boost_weblate/endpoint/serializers.pysrc/boost_weblate/endpoint/services.pysrc/boost_weblate/endpoint/tasks.pysrc/boost_weblate/endpoint/views.pytests/endpoint/test_errors.pytests/endpoint/test_serializers.pytests/endpoint/test_services.pytests/endpoint/test_views.py
henry0816191
approved these changes
Jun 9, 2026
henry0816191
left a comment
Collaborator
There was a problem hiding this comment.
docs/boost-endpoint-api.md still documents the old error shapes
Collaborator
Author
|
@coderabbitai, resume |
wpak-ai
approved these changes
Jun 10, 2026
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.

Close #99, close #103, close #102.
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Documentation
Chores