[Feature] TH Project Config Editor - #112
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
|
Tick the box to add this pull request to the merge queue (same as
|
|
@antonio-amjr Please also update the user guide accordingly. |
Fix: project-chip/certification-tool#1094
Description
th-cli project edit --id <ID>, which opens the project's config JSON in the user's $EDITOR/$VISUAL (via click.edit()), validates it on save, and persists it through the existing PUT /api/v1/projects/{id} endpoint — closing the gap where patching a single field required a full export/edit/re-import cycle or the execution-only run-tests --prompt-timeout override.Changes
th_cli/commands/project.py: new edit command and _edit_project() implementation, plus helpers_collect_dotted_keys,_strip_error_banner,_build_json_error_banner/_build_backend_error_banner,_format_422_detail(handles both the string-detail and list-of-errors detail shapes the 422 response can take).tests/test_project_commands.py: 16 new tests covering the happy path, abort paths (no save / no changes), retry exhaustion for both invalid JSON and repeated 422s, the new-key confirmation prompt (accept/decline, top-level and nested), 422 formatting for both body shapes, non-retryable errors (404), and help/argument validation.Test plan
th-cli project edit --id <id>, confirm the editor opens pre-filled with the current config, make a valid change and save, confirm it persists