Skip to content

Conversation

@wcchang1115
Copy link
Collaborator

@wcchang1115 wcchang1115 commented Dec 29, 2025

PR checklist

  • Ensure you have added or ran the appropriate tests for your PR.
  • DCO signed

What type of PR is this?
Feature

What this PR does / why we need it:

  • add metadata delete command for recce-cloud cli

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds delete functionality to the recce-cloud CLI, mirroring the existing download command pattern. The feature supports both platform-specific deletion workflows (GitHub Actions/GitLab CI) and generic session ID-based deletion, with comprehensive test coverage and consistent error handling.

Key changes:

  • Adds recce-cloud delete command with --session-id, --prod, --dry-run, and --force options
  • Implements platform-specific delete methods for GitHub and GitLab APIs
  • Provides comprehensive dry-run tests covering various CI environments

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
recce_cloud/cli.py Adds new delete command with CI environment detection, dry-run mode, confirmation prompts, and workflow routing logic matching the download command pattern
recce_cloud/delete.py Implements helper functions delete_existing_session (generic workflow) and delete_with_platform_apis (CI/CD workflow) following the same structure as download.py
recce_cloud/api/base.py Adds abstract delete_session method to the base platform client interface
recce_cloud/api/client.py Implements delete_session method for the generic RecceCloudClient with proper error handling for 204, 403, and 404 responses
recce_cloud/api/github.py Adds delete_session method for GitHub platform client using DELETE /api/v2/github/{repo}/session endpoint with PR number or base parameter
recce_cloud/api/gitlab.py Adds delete_session method for GitLab platform client using DELETE /api/v2/gitlab/{project}/session endpoint with MR IID or base parameter
tests/recce_cloud/test_client.py Adds unit tests for RecceCloudClient.delete_session covering success (204), not found (404), forbidden (403), and server error (500) cases
tests/recce_cloud/test_platform_clients.py Adds unit tests for GitHub and GitLab platform clients covering CR session deletion, prod session deletion, and parameter handling
tests/recce_cloud/test_cli.py Adds comprehensive dry-run tests for delete command covering GitHub Actions, GitLab CI (both cloud and self-hosted), prod flag, session ID workflow, and warning messages

@wcchang1115 wcchang1115 marked this pull request as ready for review December 29, 2025 14:46
@wcchang1115 wcchang1115 requested a review from even-wei December 30, 2025 08:39
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.

2 participants