Skip to content

Create, show, update and delete timesheet entries - #982

Open
jeremy wants to merge 6 commits into
mainfrom
sdk-absorb/card-10447986600
Open

jeremy wants to merge 6 commits into
mainfrom
sdk-absorb/card-10447986600

Conversation

@jeremy

@jeremy jeremy commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Why

The CLI reads timesheets through the three reports (timesheet report, project, item) but can't log, change or remove time. SDK v0.29.1, the CLI's pin, has had TimesheetService Get, Create, Update and Destroy for a while; the CLI called none of them, while API-COVERAGE.md claimed "list, show, create, update, delete". The operation coverage report from basecamp/basecamp-sdk#1055 found the gap.

What changed

A timesheet entry group. bc3 routes entries by account alone, so no verb takes or needs a project.

SDK operation Command
CreateTimesheetEntry (POST /recordings/{id}/timesheet/entries.json) basecamp timesheet entry create <item-id|url> --hours 1.5 [--date] [--description] [--person]
GetTimesheetEntry (GET /timesheet_entries/{id}) basecamp timesheet entry show <id|url>
UpdateTimesheetEntry (PUT /timesheet_entries/{id}) basecamp timesheet entry update <id|url> [--hours] [--date] [--description] [--person]
DestroyTimesheetEntry (DELETE /timesheet_entries/{id}) basecamp timesheet entry delete <id|url> [--force]
  • --hours is checked locally as a decimal or h:mm, the two forms bc3 takes. --date goes through dateparse and must come out as a real ISO date; on create it defaults to today. --person takes an ID, name, email or me.
  • delete is permanent: bc3 never trashes or archives an entry. So it asks for confirmation, and machine output needs --force, the same as subtasks delete.
  • The per-entry verbs take only a bare ID or the entry's own URL (…/timesheet/entries/<id>, or either API form). Any other URL, such as the to-do the time is logged against, is refused rather than read as an entry ID, so delete can't aim at the wrong thing. create refuses a project's timesheet URL, which carries the project's ID and not the timesheet recording's.
  • Also updated: the catalog (entry action), .surface, the API-COVERAGE.md row (now 7 endpoints, listed), a "Timesheet entries" section in the basecamp skill, the timesheet group's agent notes (they named a basecamp clock shortcut that no longer exists), and a smoke lifecycle file.
  • basecamp mcp needs nothing: its model already serves create_timesheet_entry, get_timesheet_entry, update_timesheet_entry and destroy_timesheet_entry.

Tests

  • internal/commands/timesheet_entries_test.go: each verb's method, path and body over the recording transport. Covers entry URLs in all three forms, a default date of today, --person me resolution, fields left out when unset, local refusals that send no request (bad hours, bad dates, empty values, nothing to update, non-IDs, item and project-timesheet URLs on every per-entry verb), delete needing --force without a terminal, and a 403 on delete returned as an error.
  • e2e/timesheet.bats: the local refusals through the built binary.
  • e2e/smoke/smoke_timesheet_write.bats: create, show, update, delete against a real account. A 403 from an account without timesheets counts as unverifiable.
  • bin/ci passes.

Gap card: https://app.basecamp.com/2914079/buckets/48521764/card_tables/cards/10447986600


Summary by cubic

Adds a timesheet entry command group so the CLI can log, view, change, and delete timesheet entries. The CLI previously read timesheets only through the three report commands; the pinned SDK's entry operations went unused while API-COVERAGE.md claimed them.

  • create logs hours against an item (--hours required, --date defaults to today, --person takes an ID, name, email, or me).
  • create takes only the item kinds bc3 logs time against; project, listing, and person URLs are refused too. show, update, and delete take the entry ID or its own URL; any other URL is refused so delete can't target the item the time is logged against.
  • Pasted URLs must be http(s) on a trusted Basecamp host and name the configured account (compared numerically); anything else is refused before any request, and follow-up commands carry an account adopted from a pasted URL.
  • delete is permanent, so it prompts for confirmation and needs --force in machine-output or non-interactive sessions; the delete breadcrumb carries --force for machine readers.
  • Also updates the command catalog, .surface, API-COVERAGE.md, the skill file, and the timesheet group's agent notes, and adds unit, e2e, and a serial smoke lifecycle whose timesheets-off gaps are allowlisted. The entry summary carries the person's name and ID, which styled and Markdown output would otherwise skip.

Written for commit 87ddf41. Summary will update on new commits.

View guided diff Turn on auto-fix

Copilot AI balanced review requested due to automatic review settings October 28, 2026 05:06
@jeremy

jeremy commented Oct 28, 2026

Copy link
Copy Markdown
Member Author

@codex review

@github-actions github-actions Bot added commands CLI command implementations tests Tests (unit and e2e) skills Agent skills docs labels Oct 28, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T06:36:14.549064Z 87ddf41 Draft marked ready
🔒 Security Review ✅ Completed 2026-10-28T06:40:21.511961Z 87ddf41 Draft marked ready

Security findings

Advisory findings (2)

ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Timesheet commands accept untrusted URL hosts and ignore URL account IDs, risking operations against the wrong account, while create also accepts URLs without a recording ID and can target a project ID instead.

2 open issues
What changed in this PR

Adds individual timesheet entry management alongside the existing reports, exposing four previously unused SDK operations through the CLI.

Changes:

  • Adds timesheet entry create, show, update, and delete, with input validation and confirmation for permanent deletion.
  • Updates command discovery, API coverage, help text, and agent guidance.
  • Adds unit, end-to-end, and live-account lifecycle tests.

[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

File Description
skills/​basecamp/​SKILL.md Documents entry commands and time-logging behavior.
internal/​commands/​timesheet.go Registers the entry group and updates help.
internal/​commands/​timesheet_entries.go Implements entry operations, validation, and output.
internal/​commands/​timesheet_entries_test.go Tests requests, validation, and deletion safeguards.
internal/​commands/​commands.go Adds entry management to the command catalog.
e2e/​timesheet.bats Tests local refusals through the CLI binary.
e2e/​smoke/​smoke_timesheet_write.bats Adds a live-account entry lifecycle test.
e2e/​smoke/​run_smoke.sh Includes the timesheet lifecycle in mutation tests.
API-COVERAGE.md Corrects timesheet coverage to seven endpoints.
.surface Records the new commands, arguments, and flags.

Review effort: Balanced

Comment thread internal/commands/timesheet_entries.go Outdated
Comment thread internal/commands/timesheet_entries.go Outdated

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

Copy link
Copy Markdown

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: 2f7ec1a62d

ℹ️ 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".

Comment thread internal/commands/timesheet_entries.go Outdated
Comment thread internal/commands/timesheet_entries.go Outdated
Comment thread e2e/smoke/smoke_timesheet_write.bats
Comment thread e2e/smoke/smoke_timesheet_write.bats
Copilot AI balanced review requested due to automatic review settings October 28, 2026 05:11

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛡️ Codex Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: 2f7ec1a62d

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread internal/commands/timesheet_entries.go Outdated
@jeremy

jeremy commented Oct 28, 2026

Copy link
Copy Markdown
Member Author

@codex review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Create accepts scheme-less URLs that bypass host and account validation and person URLs misidentified as recordings, risking time entries in the wrong account or against an unrelated recording.

3 open issues
2 resolved since last review

Review effort: Balanced

Comment thread internal/commands/timesheet_entries.go Outdated
Comment thread internal/commands/timesheet_entries.go Outdated
Comment thread internal/commands/timesheet_entries.go Outdated
Copilot AI balanced review requested due to automatic review settings October 28, 2026 05:17

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

Copy link
Copy Markdown

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: c6d9d29e7e

ℹ️ 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".

Comment thread internal/commands/timesheet_entries.go Outdated
@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: c6d9d29e7e

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Scheme-less URLs bypass host and account validation during creation, while generated follow-up commands lose account/profile scope, risking requests against the wrong environment.

3 open issues

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 28, 2026 05:24
Copilot AI previously approved these changes Oct 28, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approved

No active review issues are reported for the timesheet entry command changes.

No open issues 🎉

3 resolved since last review

Review effort: Balanced

@jeremy

jeremy commented Oct 28, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: a910aa68e7

ℹ️ 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".

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛡️ Codex Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: a910aa68e7

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread internal/commands/timesheet_entries.go Outdated
The CLI read timesheets through the three reports but couldn't log time:
SDK v0.29.1's TimesheetService Get, Create, Update and Destroy went
unused, while API-COVERAGE.md claimed the whole set.

timesheet entry create logs hours against an item (date defaults to
today), show and update address one entry by id or URL, and delete
removes it for good behind --force or a confirmation, since bc3 never
trashes an entry.
A URL on a look-alike host, or from another account than the configured
one, is refused before any request, and create refuses project and
listing URLs, which name no item.
…lifecycle

The delete breadcrumb carries --force when machine output is reading it,
as chat delete's does. The smoke lifecycle runs its tests in order, and
its timesheets-off gaps are allowlisted like the read-only ones.
Anything but a bare id is a URL that has to be http(s) on a trusted
Basecamp host. create takes only the item kinds bc3 logs time against,
so a person's or project's URL can't send its id out as a recording's.
URL accounts compare numerically, and the follow-up commands carry an
account adopted from the URL.
A path written after a # or ? is not the URL's path, so entry URLs are
parsed first and only their path is matched, and create routes only the
scheme, host and path. URLs carrying userinfo are refused.
@jeremy
jeremy force-pushed the sdk-absorb/card-10447986600 branch from a910aa6 to badc84c Compare October 28, 2026 06:13
Copilot AI balanced review requested due to automatic review settings October 28, 2026 06:13
@jeremy

jeremy commented Oct 28, 2026

Copy link
Copy Markdown
Member Author

Rebased onto main (now SDK v0.31.0, after #973). The only conflict was skills/basecamp/SKILL.md, where the new Project logo and Timesheet entries sections both landed before "Content and stdin". Both are kept, .surface regenerates unchanged, and the timesheet API is unchanged in v0.31.0.

Copilot AI dismissed their stale review, a newer Copilot review was requested October 28, 2026 06:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Terminal and Markdown output omit the person associated with a timesheet entry, preventing users from identifying whose hours are shown or confirming a --person change.

1 open issue

Review effort: Balanced

Comment thread internal/commands/timesheet_entries.go
Styled and Markdown output skip the nested person, so the summary
carries the person's name and id.
Copilot AI balanced review requested due to automatic review settings October 28, 2026 06:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approved

No active review issues are identified for the new timesheet entry commands.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@jeremy

jeremy commented Oct 28, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 87ddf418a2

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 87ddf418a2

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@jeremy

jeremy commented Oct 28, 2026 •

Copy link
Copy Markdown
Member Author

Review threads: 13 resolved, 13 fixed and 0 declined.
Copilot approved 87ddf41, and Codex's code and security reviews completed on 87ddf41 with no findings. CI is green and the PR merges cleanly.

@jeremy
jeremy marked this pull request as ready for review October 28, 2026 06:33
@jeremy
jeremy requested a review from a team as a code owner October 28, 2026 06:33

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands CLI command implementations docs skills Agent skills tests Tests (unit and e2e)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants