Rust CLI for tangled

TODO - Tech Debt#

Pull Request Support#

Branch-Based PR Merge#

  • Implement branch-based PR merge support in CLI
    • Issue: Currently only patch-based PRs can be merged via tangled pr merge
    • Location: crates/tangled-api/src/client.rs:1250-1253
    • Current behavior: Returns error: "Cannot merge branch-based PR via CLI. Please use the web interface."
    • Required: Add support for merging PRs that have a source field with SHA/branch info instead of a patch field
    • Related: Server-side merge API may need updates to support branch merges

PR Comments Display#

  • Implement --comments flag functionality in pr show command
    • Issue: Flag is defined but not implemented
    • Location: crates/tangled-cli/src/commands/pr.rs:145-180
    • Current behavior: tangled pr show <id> --comments doesn't display any comments
    • Required:
      • Fetch comments from the API
      • Display comment author, timestamp, and content
      • Handle threaded/nested comments if supported
    • API: Need to determine correct endpoint for fetching PR comments

PR Format Compatibility#

  • Support both patch-based and branch-based PR formats
    • Completed: Added PullSource struct and made patch field optional
    • Location: crates/tangled-api/src/client.rs:1392-1413
    • Details: PRs can now have either:
      • patch: String (legacy format)
      • source: { sha, repo?, branch? } (new format)
  • Consider adding --format json output for programmatic access to PR data
  • Add better error messages when operations aren't supported for certain PR types
  • Document the differences between patch-based and branch-based PRs in user docs