Skip to content

Add deadline command to change a goal's deadline (Vibe Kanban)#223

Merged
narthur merged 9 commits intomainfrom
vk/02fa-add-command-to-c
Feb 11, 2026
Merged

Add deadline command to change a goal's deadline (Vibe Kanban)#223
narthur merged 9 commits intomainfrom
vk/02fa-add-command-to-c

Conversation

@narthur
Copy link
Collaborator

@narthur narthur commented Feb 11, 2026

Summary

Adds a new buzz deadline CLI command that allows users to change a Beeminder goal's deadline time directly from the terminal.

What changes were made

  • New API function (beeminder.go): UpdateGoalDeadline() sends a PUT request to the Beeminder API to update a goal's deadline field (seconds from midnight offset)
  • Time parsing (main.go): parseTimeToDeadlineOffset() converts human-readable time strings into Beeminder's deadline offset format, supporting both 12-hour (3:00 PM) and 24-hour (15:00) formats
  • Command handler (main.go): handleDeadlineCommand() with confirmation prompt that shows the current and new deadline before making the change
  • Safety flag: --yes / -y flag to skip the confirmation prompt for scripting use cases
  • Tests: Unit tests for time parsing (9 cases covering edge cases like midnight, AM/PM, 24-hour format, wrapping) and API integration tests with mock HTTP server

Why

Users need a quick way to adjust goal deadlines without leaving the terminal or navigating the Beeminder web UI. This is especially useful when managing multiple goals or scripting deadline changes.

Usage

buzz deadline mygoal 3:00 PM
buzz deadline mygoal 15:00
buzz deadline --yes mygoal 11:30 AM

The command fetches the current goal, displays the change (Change deadline for X from Y to Z? [y/N]), and only proceeds after user confirmation.


This PR was written using Vibe Kanban

Summary by CodeRabbit

  • New Features

    • Added a deadline command to update a goal's daily deadline from the CLI
    • Accepts human-readable times (12- and 24-hour formats), enforces valid windows, shows current vs new deadline, and supports --yes/-y to skip confirmation
  • Tests

    • Added tests covering deadline update flow and time-parsing (success and error cases)
  • Documentation

    • Updated README with usage, examples, and parameter details for deadline and schedule commands

narthur and others added 2 commits February 11, 2026 13:13
Add `buzz deadline <goalslug> <time>` command that updates a goal's
deadline via the Beeminder API. Supports both 12-hour ("3:00 PM") and
24-hour ("15:00") time formats.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Shows the current and new deadline and asks the user to confirm with
[y/N] before making the API call. Supports --yes/-y flag to skip the
prompt for scripting use cases.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 11, 2026 18:18
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 11, 2026

📝 Walkthrough

Walkthrough

Adds a new Beeminder deadline feature: a public UpdateGoalDeadline API function, CLI subcommand buzz deadline with time-parsing and confirmation flow, unit tests for API and time parsing, and README entries documenting the new commands.

Changes

Cohort / File(s) Summary
API Layer
beeminder.go, beeminder_test.go
Adds UpdateGoalDeadline(config *Config, goalSlug string, deadline int) (*Goal, error) implementing a PUT to update goal deadline; tests cover successful update and API error responses with mocked HTTP server.
CLI Integration
main.go, main_test.go
Adds buzz deadline [--yes] <goalslug> <time> command, parseTimeToDeadlineOffset helper with validation and midnight-wrap logic, confirmation prompt handling, and tests for time parsing and invalid inputs.
Documentation
README.md
Adds usage examples and parameter descriptions for buzz deadline and buzz schedule commands.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 58.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add deadline command to change a goal's deadline' accurately describes the main change—a new CLI command to modify Beeminder goal deadlines. It is clear, specific, and directly reflects the primary objective of the pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 vk/02fa-add-command-to-c

No actionable comments were generated in the recent review. 🎉


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

@narthur narthur changed the title Add command to change a goal's deadline (vibe-kanban) Add deadline command to change a goal's deadline (Vibe Kanban) Feb 11, 2026
@github-actions
Copy link

github-actions bot commented Feb 11, 2026

🚀 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-223-latest buzz-pr-223
# Run the pre-release
buzz-pr-223
# Uninstall the pre-release
bin remove buzz-pr-223

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

Adds a new CLI command to update a Beeminder goal’s deadline time, wiring it into the buzz command dispatcher and implementing the corresponding Beeminder API call, with unit tests covering time parsing and the API update request.

Changes:

  • Add buzz deadline [--yes|-y] <goalslug> <time> command and help text.
  • Implement parseTimeToDeadlineOffset and handleDeadlineCommand flow (fetch current goal → confirm → update).
  • Add UpdateGoalDeadline Beeminder API client method plus tests for parsing and request behavior.

Reviewed changes

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

File Description
main.go Adds the deadline command, parsing logic, and command handler; updates help/command list.
main_test.go Adds tests for parseTimeToDeadlineOffset.
beeminder.go Adds UpdateGoalDeadline (PUT) API call.
beeminder_test.go Adds tests for UpdateGoalDeadline request/response handling.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@beeminder.go`:
- Around line 645-649: UpdateGoalDeadline constructs the API path with the raw
goalSlug which can break for spaces/special characters; mirror FetchGoal by
applying url.PathEscape to goalSlug before building apiURL so the PUT path is
properly escaped (update the UpdateGoalDeadline function to call
url.PathEscape(goalSlug) when formatting apiURL).

In `@main.go`:
- Around line 1206-1236: The parseTimeToDeadlineOffset function currently uses
if hour > 6 to decide wrapping, which leaves 6:01–6:59 AM as positive offsets
exceeding Beeminder's +21600 limit; update the wrap condition in
parseTimeToDeadlineOffset to treat any time after 6:00 AM as wrapping (i.e., if
hour > 6 OR hour == 6 and minute > 0) so offsets for 6:01–6:59 become negative
via offset = offset - 24*3600; keep 6:00 AM (hour==6 && minute==0) as the
maximum positive 21600.

narthur and others added 5 commits February 11, 2026 13:37
Matches the pattern used by FetchGoal and FetchGoalWithDatapoints to
ensure safe URL path construction.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ToUpper already normalizes lowercase input like "3:00 am" to "3:00 AM",
making the separate ToLower parse attempt unnecessary.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Times between 6:01-6:59 AM now correctly wrap to negative offsets to
stay within the Beeminder API range of -61200 to 21600. Also adds a
reference to the forum post confirming the undocumented API support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Beeminder does not allow deadlines between 6:01 AM and 6:59 AM.
Allowed ranges are 12:00 AM-6:00 AM (nightowl) and 7:00 AM-11:59 PM
(earlybird). Added reference to the Beeminder help article.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@beeminder.go`:
- Around line 672-675: The non-200 response handling in the unnamed block
discards the io.ReadAll error which can mask failures; update this block to read
resp.Body into body and check the error from io.ReadAll, returning a formatted
error that includes both the HTTP status and either the body content (if read
succeeded) or the read error (if read failed), mirroring the pattern used in
CreateCharge and FetchGoalRawJSON so callers receive clear, explicit failure
information.

In `@main.go`:
- Around line 1247-1252: The deadline command's flag parsing uses deadlineFlags
:= flag.NewFlagSet(...) and calls deadlineFlags.Parse(os.Args[2:]) but doesn't
handle flag.ErrHelp or return the same exit code as other commands; update the
Parse error handling to mirror next/add/view: if err == flag.ErrHelp then print
deadlineFlags.Usage() and exit 0, else print the flag error (or usage) and exit
2. Ensure you reference deadlineFlags.Parse, flag.ErrHelp, and the yes/yesShort
flags so the code shows usage on -h and returns exit code 2 for parse errors.

narthur and others added 2 commits February 11, 2026 14:37
Align with CreateCharge pattern by explicitly checking the read error
when reading the response body for non-200 status codes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Mirror the pattern from next/add/view commands: show usage on -h/--help
and exit with code 2 on flag parse errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@narthur narthur merged commit 0385121 into main Feb 11, 2026
5 checks passed
@narthur narthur deleted the vk/02fa-add-command-to-c branch February 11, 2026 22:06
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