Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 22, 2025

  • Add duration parsing function to support formats like 1h, 5d, 1w
  • Add IsDueWithin function to check if a goal is due within a given duration
  • Add tests for duration parsing function
  • Add tests for IsDueWithin function
  • Add handleDueCommand function to handle the new command
  • Update main.go to route 'due' command to handler
  • Update help text to document the new command
  • Update README.md with documentation for the new command
  • Address code review feedback:
    • Added validation to reject negative durations
    • Added overflow protection for very large durations
    • Added tests for negative durations (-1h, -5d, -1w)
    • Added tests for zero durations (0h, 0d, 0w)
    • Added tests for very large durations (overflow scenarios)
    • Fixed indentation inconsistency in test case
    • Updated README to clarify overdue goals are included
  • All tests passing (25 test cases for ParseDuration)
  • Security scan passed
Original prompt

Add new command, buzz due <duration>, that accepts a duration and then lists goals that are due within that duration like buzz today or buzz tomorrow. Examples: buzz due 1h, buzz due 5d, buzz due 1w, etc.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 22, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.


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

Copilot AI changed the title [WIP] Add new command to list due goals within duration feat: add buzz due command with duration parsing Dec 22, 2025
Copilot AI requested a review from narthur December 22, 2025 14:57
@narthur narthur marked this pull request as ready for review December 22, 2025 15:42
Copilot AI review requested due to automatic review settings December 22, 2025 15:42
@github-actions
Copy link

github-actions bot commented Dec 22, 2025

🚀 Pre-release Build Ready

Test builds are ready! Install directly using the bin command:

# Install the pre-release
bin install https://github.com/PinePeakDigital/buzz/releases/tag/pr-201-latest buzz-pr-201
# Run the pre-release
buzz-pr-201
# Uninstall the pre-release
bin remove buzz-pr-201

Direct Download Links

Or download binaries directly from the pre-release page:

💡 No GitHub login required for downloads!

🗑️ This pre-release will be automatically deleted when the PR is closed.

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 a new buzz due <duration> command that allows users to list goals due within a custom time window, extending the existing fixed today and tomorrow commands with flexible duration parsing.

Key changes:

  • Implements duration parsing supporting hours, days, and weeks with decimal values (e.g., 1h, 5d, 1.5w)
  • Adds filtering logic to show goals due within the specified timeframe
  • Includes comprehensive test coverage with 23 test cases across parsing and filtering functions

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
main.go Adds handleDueCommand() function with argument validation and integrates it into command routing; updates help text to include the new command
beeminder.go Implements ParseDuration() for parsing duration strings, IsDueWithin() and IsDueWithinAt() for filtering goals by deadline
beeminder_test.go Adds comprehensive test coverage for ParseDuration (15 test cases) and IsDueWithin (8 test cases) functions
README.md Documents the new command with examples, supported duration units, and usage patterns

@narthur
Copy link
Collaborator

narthur commented Dec 22, 2025

@copilot apply changes based on the comments in this thread

Copy link
Contributor Author

Copilot AI commented Dec 22, 2025

@copilot apply changes based on the comments in this thread

All review comments have been addressed in commit 0a37a93:

  1. ✅ Added validation to reject negative durations
  2. ✅ Added test coverage for negative durations (-1h, -5d, -1w)
  3. ✅ Added test coverage for zero durations (0h, 0d, 0w) - accepted as valid
  4. ✅ Added test coverage for very large durations with overflow protection
  5. ✅ Fixed indentation inconsistency (tabs → spaces)
  6. ✅ Updated README to clarify overdue goals are included

All 25 test cases pass and the command properly rejects invalid inputs.

Copilot AI requested a review from narthur December 22, 2025 16:13
@narthur narthur merged commit 5319a7c into main Dec 22, 2025
5 checks passed
@narthur narthur deleted the copilot/add-buzz-due-command branch December 22, 2025 16:36
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