Skip to content

Conversation

@hillairet
Copy link
Owner

Summary

Implements the create-comments CLI command as specified in issue #1, enabling bulk creation of comments on existing GitHub issues from CSV data. This feature is designed to support migrations from other systems (like JIRA) to GitHub by preserving comment history.

Key features implemented:
• New create-comments CLI command with dry-run support
• CSV input processing with URL and Comment columns (Author, Date optional)
• Automatic URL parsing to extract owner/repo/issue_number from each row
• Original author attribution included in comment text when provided
• Support for multiple repositories within a single CSV file
• Comprehensive error handling and input validation
• Full integration test coverage with 7 test cases

Test plan

  • All 28 existing tests pass (no regressions)
  • 7 new integration tests covering success, error, and edge cases
  • Manual testing of CLI command with sample data
  • Dry-run mode validation
  • Error handling for invalid URLs and missing columns
  • Code formatting with Black and isort applied

Usage Examples

# Basic usage
python ciftt.py create-comments comments.csv

# Dry run mode  
python ciftt.py create-comments comments.csv --dry-run

# Help
python ciftt.py create-comments --help

CSV Format

URL,Comment,Author,Date
https://github.com/myorg/myrepo/issues/123,"Original comment text","john.doe","2024-01-15"
https://github.com/another/repo/issues/42,"Comment without attribution",,

Technical Implementation

  • GitHub API Integration: Added create_issue_comment method to GitHub client
  • URL Processing: Leverages existing extract_repo_from_issue_url and extract_issue_number utilities
  • Comment Formatting: Intelligent attribution formatting that handles empty/missing author/date fields
  • Error Handling: Follows existing project patterns for graceful error handling and user feedback
  • Testing: Comprehensive integration tests with mocked GitHub API responses

Closes #1

🤖 Generated with Claude Code

hillairet and others added 2 commits August 11, 2025 15:30
Add new CLI command to create comments on existing GitHub issues from CSV data.
This feature supports migrations from other systems (like JIRA) by preserving
comment history with original author attribution.

Features:
- New create-comments CLI command with dry-run support
- CSV input with URL and Comment columns (Author, Date optional)
- Automatic URL parsing to extract owner/repo/issue_number
- Original author attribution in comment text when provided
- Support for multiple repositories in single CSV file
- Comprehensive error handling and validation
- Full integration test coverage

Usage:
  python ciftt.py create-comments comments.csv
  python ciftt.py create-comments comments.csv --dry-run

CSV format:
  URL,Comment,Author,Date
  https://github.com/owner/repo/issues/123,"Comment text","user","2024-01-15"

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Code formatting improvements applied by Black and isort for better
readability and consistency across the codebase.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
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.

Implement create-comments command for bulk comment creation

2 participants