Skip to content

Add field clearing to todos update#370

Merged
jeremy merged 8 commits intomainfrom
delightful-hamburger
Mar 25, 2026
Merged

Add field clearing to todos update#370
jeremy merged 8 commits intomainfrom
delightful-hamburger

Conversation

@jeremy
Copy link
Member

@jeremy jeremy commented Mar 24, 2026

Summary

  • Adds --no-due, --no-starts-on, --no-description flags to basecamp todos update for clearing fields
  • Also supports empty-value clearing: --due "", --starts-on "", --description ""
  • Detects conflicting usage (--no-due + --due "friday") and returns a clear error
  • Clears fields using BC3 API omission semantics: the PUT body includes all fields to preserve, omitting those to clear. Clearing due also clears starts (Basecamp enforces starts <= due).
  • Guards against nil Bucket in the clearing path

Test plan

  • basecamp todos update <id> --no-due clears the due date
  • basecamp todos update <id> --due "" also clears
  • basecamp todos update <id> --no-due --title "New" clears date + sets title in one call
  • basecamp todos update <id> --no-due --due "friday" returns usage error
  • basecamp todos update --help shows the clearing flags
  • Normal update path (--due "friday", --title "x") is unchanged

CI note

TestSurfaceSnapshot failure is pre-existing on main — the unit snapshot baseline has accumulated stale ARG removals unrelated to this PR. The merge-gating "CLI Surface Check" job (which runs check-cli-surface.sh separately) passes green.

Closes #293

Copilot AI review requested due to automatic review settings March 24, 2026 19:23
@github-actions github-actions bot added commands CLI command implementations enhancement New feature or request labels Mar 24, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

Copy link

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 extends basecamp todos update to support clearing nullable todo fields (due date, start date, description) via dedicated --no-* flags and by treating explicitly empty flag values (e.g. --due "") as “clear”.

Changes:

  • Add --no-due, --no-starts-on, --no-description flags and document clearing examples in help text.
  • Detect and error on conflicting clear/set usage (e.g. --no-due with a non-empty --due).
  • When clearing is requested, bypass the SDK typed request and issue a raw PUT with null values.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions github-actions bot added the tests Tests (unit and e2e) label Mar 24, 2026
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b8e9523169

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copilot AI review requested due to automatic review settings March 24, 2026 20:06
@jeremy jeremy force-pushed the delightful-hamburger branch from 8325fdb to e5d3707 Compare March 24, 2026 20:09
Copy link

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8325fdb7c6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copilot AI review requested due to automatic review settings March 24, 2026 20:25
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="e2e/smoke/smoke_todos_write.bats">

<violation number="1" location="e2e/smoke/smoke_todos_write.bats:119">
P2: The new preservation smoke tests do not assert all fields they claim to preserve, so starts_on/content regressions can pass unnoticed.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5ed8d807a6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jeremy jeremy force-pushed the delightful-hamburger branch from 5ed8d80 to 9637ea2 Compare March 24, 2026 20:30
@github-actions github-actions bot added tui Terminal UI sdk SDK wrapper and provenance docs deps breaking Breaking change labels Mar 24, 2026
@github-actions
Copy link

⚠️ Potential breaking changes detected:

  • Change to the 'todos update' command introduces new mutually exclusive flag combinations (--no-due and --due, --no-description and --description, --no-starts-on and --starts-on), which may alter existing behavior for scripts or commands relying on previous flag handling.
  • Modification of the function signature for app.Account().Cards().Move to include an additional parameter (nil). This could affect any custom scripts or integrations relying on the API and not updated to handle the extra parameter.

Review carefully before merging. Consider a major version bump.

Copy link

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

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions github-actions bot removed the breaking Breaking change label Mar 24, 2026
Copilot AI review requested due to automatic review settings March 24, 2026 20:34
Copy link

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

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b67390e749

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jeremy jeremy changed the base branch from main to sdk-0.7.0 March 24, 2026 20:52
@jeremy jeremy force-pushed the sdk-0.7.0 branch 5 times, most recently from 6ea302a to d2df13a Compare March 25, 2026 07:31
@jeremy jeremy force-pushed the delightful-hamburger branch from b67390e to b824e1c Compare March 25, 2026 07:31
@github-actions github-actions bot added the skills Agent skills label Mar 25, 2026
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b824e1c051

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Base automatically changed from sdk-0.7.0 to main March 25, 2026 07:37
jeremy added 7 commits March 25, 2026 00:38
…scription)

The SDK's UpdateTodoRequest uses omitempty on value types, making it
impossible to send JSON null to clear a field. When clearing is needed,
bypass the typed SDK path and issue a raw PUT with nil map values — the
same pattern the TUI uses in hub.go.

Supports both explicit flags (--no-due) and empty values (--due "").
Conflicting usage (--no-due --due "friday") returns a clear error.

Closes #293
Guard against nil Bucket in the clearing path. Add tests covering:
null emission for each --no-* flag, empty-value clearing (--due ""),
conflicting flag combinations, and combined clear+set operations.
The BC3 API clears fields by omission, not by sending null.
Rebuild the PUT body with all existing values preserved, omitting
only the fields being cleared. Clearing due also clears starts
(Basecamp enforces starts <= due).

Updates mock GET responses to include realistic todo data so
clear-path tests can verify field preservation.
Basecamp requires a due date when a start date is set, so clearing
the due while setting a start is contradictory. Return a clear usage
error instead of silently dropping the starts-on value.
Two new live-API smoke tests resolve the contract dispute between
the SDK typed-update path and the raw-PUT clearing path:

1. Update title only → verify due_on, starts_on, description survive
2. Clear due via --no-due → verify due/starts cleared, description preserved

Uses raw API GET to check null fields that the SDK omits via omitempty.
Move the clearDue+startsOn conflict check after clear detection so
--due "" --starts-on "value" is caught alongside --no-due --starts-on.
Add missing starts_on assertion to the field preservation smoke test.
Smoke tests: use todos update for --starts-on (create lacks it),
match description as HTML substring (API wraps in <p> tags).

Unit tests: add --starts-on "" and --description "" empty-value
clearing coverage alongside the existing --due "" test.
Copilot AI review requested due to automatic review settings March 25, 2026 07:39
@jeremy jeremy force-pushed the delightful-hamburger branch from b824e1c to e397f06 Compare March 25, 2026 07:39
@github-actions github-actions bot removed tui Terminal UI sdk SDK wrapper and provenance skills Agent skills docs deps labels Mar 25, 2026
Copy link

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jeremy jeremy merged commit e48eadd into main Mar 25, 2026
27 checks passed
@jeremy jeremy deleted the delightful-hamburger branch March 25, 2026 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands CLI command implementations enhancement New feature or request tests Tests (unit and e2e)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: basecamp todos update command

2 participants