Skip to content

[CLI] Add delete command for test run execution - #120

Merged
rquidute merged 1 commit into
project-chip:v2.16-cli-developfrom
rquidute:feature/1112-cli-delete-test-run-execution
Sep 15, 2026
Merged

rquidute merged 1 commit into
project-chip:v2.16-cli-developfrom
rquidute:feature/1112-cli-delete-test-run-execution

Conversation

@rquidute

@rquidute rquidute commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Summary

The backend exposes DELETE /api/v1/test_run_executions/{id} to remove a test run execution, but the CLI had no command that called it.

Changes

  • Add a delete subcommand to the test_run_execution command group (th_cli/commands/test_run_execution.py), mirroring the existing project delete command's confirmation pattern (--id, --yes to skip confirmation).
  • Calls remove_test_run_execution_api_v1_test_run_executions__id__delete (already present in the autogenerated API client).
  • Add unit tests covering success (with --yes and with interactive confirmation), cancel-on-decline, API error surfacing, missing --id, and --help output.

Usage

th_cli test-run-execution delete --id 1
th_cli test-run-execution delete --id 1 --yes

Closes #1112

The backend exposes DELETE /api/v1/test_run_executions/{id} to remove
a test run execution, but no CLI command called it.

Adds `test-run-execution delete --id <id>`, mirroring `project delete`'s
confirmation pattern: prompts for confirmation unless --yes is passed,
then calls remove_test_run_execution_api_v1_test_run_executions__id__delete
and reports success or surfaces the API error.
@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 2b246247-8525-43a6-8922-68d9ba0b5a25

📥 Commits

Reviewing files that changed from the base of the PR and between 974b18e and 1fbc186.

📒 Files selected for processing (2)
  • tests/test_test_run_execution_delete.py
  • th_cli/commands/test_run_execution.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The test-run-execution group now includes a delete command with required --id and optional --yes options. Without --yes, the command requests confirmation and cancels when declined. After confirmation, it calls the test run execution delete API and prints success output. API errors use the existing error handler. New tests cover success, cancellation, API errors, validation, and help output.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant CLI
  participant Confirmation
  participant API
  User->>CLI: Run test-run-execution delete
  CLI->>Confirmation: Request confirmation when --yes is absent
  Confirmation-->>CLI: Return confirmation result
  CLI->>API: Delete execution by id when confirmed
  API-->>CLI: Return success or API error
  CLI-->>User: Print result
Loading

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 1fbc1

The delete command preserves confirmation behavior and reports API errors through the established CLI path. No actionable merge risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 70.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The description accurately explains the new delete subcommand, its confirmation behavior, API call, usage, and tests.
Title check ✅ Passed The title clearly and concisely identifies the main change: adding a CLI delete command for test run executions.
  • Fix all pre-merge checks with AI

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mergify

mergify Bot commented Sep 14, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@rquidute rquidute self-assigned this Sep 14, 2026
@rquidute
rquidute merged commit fccdfe6 into project-chip:v2.16-cli-develop Sep 15, 2026
5 checks passed
@rquidute
rquidute deleted the feature/1112-cli-delete-test-run-execution branch September 15, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants