Skip to content

Conversation

@jordanpartridge
Copy link
Contributor

Closes #22

Summary

Implements a comprehensive comment and timeline management system with fluent API patterns for creating, updating, deleting comments, managing reactions, and querying issue timelines.

Changes

New Services

  • CommentManager - Fluent API for comment CRUD operations

    • all() - Get all comments for an issue
    • find(int $commentId) - Get a specific comment by ID
    • create(string $body) - Create a new comment and return CommentInstance
    • update(int $commentId, string $body) - Update a comment
    • delete(int $commentId) - Delete a comment
    • comment(int $commentId) - Get CommentInstance for chaining
  • CommentInstance - Chainable comment operations

    • get() - Fetch comment data with caching
    • update(string $body) - Update comment body
    • delete() - Delete the comment
    • react(string $content) - Add a reaction to the comment
    • reactions() - Get all reactions on the comment
    • deleteReaction(int $reactionId) - Delete a reaction
  • TimelineQuery - Timeline event filtering

    • get() - Get all timeline events for an issue
    • ofType(string|array $types) - Filter events by specific types
    • comments() - Get only comment events
    • labels() - Get only label-related events

Tests

  • Comprehensive test coverage for all services (27 tests, 60 assertions)
  • All services have 100% code coverage
  • Tests follow existing patterns using Saloon MockClient

Quality Gates

  • All tests passing
  • Code formatted with Pint
  • PHPStan analysis passing (level 9)
  • 100% test coverage on new code

Usage Examples

use ConduitUI\Issue\Services\CommentManager;

// Create a comment manager
$manager = new CommentManager($connector, 'owner/repo', 123);

// Get all comments
$comments = $manager->all();

// Create and react to a comment
$manager->create('Great work!')
    ->react('heart');

// Update a comment
$manager->update(456, 'Updated text');

// Delete a comment
$manager->delete(456);

// Chain operations
$manager->comment(789)
    ->react('+1')
    ->update('Thanks!');
use ConduitUI\Issue\Services\TimelineQuery;

// Create a timeline query
$timeline = new TimelineQuery($connector, 'owner/repo', 123);

// Get all timeline events
$events = $timeline->get();

// Get only comments
$comments = $timeline->comments();

// Get only label events
$labelEvents = $timeline->labels();

// Filter by specific event types
$specific = $timeline->ofType(['closed', 'reopened']);

- Added CommentManager for fluent comment CRUD operations
- Added CommentInstance for chainable comment actions
- Added TimelineQuery for timeline event filtering
- All services include 100% test coverage
- Follows existing patterns and code standards
@coderabbitai
Copy link

coderabbitai bot commented Dec 19, 2025

Warning

Rate limit exceeded

@jordanpartridge has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 7 minutes and 55 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between dff68e7 and f732534.

📒 Files selected for processing (6)
  • src/Services/CommentInstance.php (1 hunks)
  • src/Services/CommentManager.php (1 hunks)
  • src/Services/TimelineQuery.php (1 hunks)
  • tests/Unit/Services/CommentInstanceTest.php (1 hunks)
  • tests/Unit/Services/CommentManagerTest.php (1 hunks)
  • tests/Unit/Services/TimelineQueryTest.php (1 hunks)
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/comment-system

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 and usage tips.

@github-actions github-actions bot merged commit 96a2f1e into master Dec 19, 2025
2 checks passed
@github-actions github-actions bot deleted the feat/comment-system branch December 19, 2025 05:26
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 Comment/Timeline Management System

2 participants