Repository navigation
fix(calendar): report freebusy calendars Google could not read - #1311
saariuslystoned wants to merge 3 commits into
Conversation
freeBusy.query returns errors[] and no busy periods for a calendar it could not compute, such as one the caller cannot see (notFound). The text and --plain views read only busy, so such a calendar printed nothing and looked free. Warn on stderr for each calendar with errors, as calendar team already reports them, and list rows in the requested calendar order instead of map order. Stdout columns, exit status and JSON output are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Codex review: blocked before merge. What this changesThe PR warns about per-calendar free/busy errors and prints successful calendar rows in requested order. Example: Query a@example.com,c@example.com,b@example.com when c@example.com returns notFound.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains This PR fixes a current-main availability-reporting bug; the earlier warning finding is resolved, and no correctness blocker remains. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe Calendar CLI sends selected calendar IDs and a time window through the Google API client, then renders response calendars as JSON or a text table. flowchart LR
A[Calendar CLI arguments] --> B[Calendar selection and time range]
B --> C[Google freeBusy query]
C --> D[Response calendars]
D --> E[Unchanged JSON output]
D --> F[Ordered busy rows]
D --> G[Error warnings on stderr]
Technical reviewBest possible solution: Land the focused warning and ordering fix after the existing workflow approval gate is cleared and checks pass. Do we have a high-confidence way to reproduce the issue? Current-main source deterministically discards per-calendar errors; the contributor's before/after CLI transcript independently demonstrates the mixed-success response scenario. Is this the best way to solve the issue? The change repairs presentation in the existing command and renderer while preserving machine-readable columns, JSON, and exit semantics. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e8428c36dd31. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 8, 2026, 8:39 AM ET / 13:39 UTC (Revision 2). |
The warning for a calendar Google could not read now ends with a next step for the documented reasons: check the calendar ID and sharing for notFound, query fewer calendars for tooManyCalendarsRequested and groupTooBig, and otherwise retry before relying on its availability. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for the review.
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Thank you for the fix. I reproduced the claim and consolidated warning about inaccessible free/busy calendars while keeping table columns stable into #1336, with regression coverage and your coauthor credit retained. The full |
What problem this solves
freeBusy.queryreports a calendar it could not compute ascalendars.<id>.errors[]with an emptybusylist. The Calendar reference documents the reasons asnotFound,tooManyCalendarsRequested,groupTooBigandinternalError, and says "clients should gracefully handle additional error statuses". The text and--plainviews ofgog calendar freebusyread onlybusy. A calendar you cannot see therefore prints no rows and no message, and the command exits 0, which is the same output as a calendar that is free for the whole window.Here
c@example.comcame backnotFound, so a script or agent that checks for busy rows sees it as free.calendar teamalready reportserror: <reason>per member for the same response, and--jsonkeepserrorsbecause it prints the response as-is.The rows also came from ranging over the response map, so with several calendars the
--plainrow order changed from run to run, which works against the documented stable TSV.Change
errors, write one stderr line with the reason and a next step:Warning: no free/busy data for c@example.com (notFound); its busy times are unknown, not free. Check the calendar ID and that the calendar is shared with this account.FortooManyCalendarsRequestedandgroupTooBigthe next step is to query fewer calendars. For other reasons it is to retry before relying on the calendar's availability. Stdout keeps its three columns, so existing parsers are unaffected. Exit status is unchanged. Making a partial failure non-zero would be a stronger signal, but it would change what scripts see when one of many calendars is private, so I left that for you to decide.Evidence
internal/cmd/calendar_freebusy_errors_test.godrivesCalendarFreeBusyCmdagainst anhttptestfreeBusy response with onenotFoundcalendar:--plainrows in the requested order, checked over 20 runserrorsThe warning and order tests fail on
main(e8428c3). The order failure wasb@example.combeforea@example.comfor a request ofa,c,b. Both pass with this change.calendarFreeBusyRowstakes the requested order, and its existing presentation test passesnil.A built
bin/gogfrommainand from this branch was run three times each against a local stand-in throughGOG_GOOGLE_API_BASE_URL, with an emptyGOG_HOMEand the file keyring. The stand-in is not Google. It returnsc@example.comwitherrors: [{reason: notFound}]and lists calendars in reverse order.mainprintedbbeforeawith empty stderr on every run. This branch printeda, thenb, plus the warning forc.Transcript of the built-CLI runs. This is a local stand-in served through
GOG_GOOGLE_API_BASE_URL, not Google. It answersfreeBusy.querywithc@example.comset toerrors: [{reason: notFound}]andbusy: [], and lists calendars in reverse order. Each binary ran three times with the same output every run; one run of each is shown:make cipassed locally on 268dbaf (macOS arm64, go1.27.3).Boundary: the response shape comes from the freeBusy reference. No live Google Calendar was queried, so this does not show which reason Google returns for a particular unshared calendar.
🤖 Generated with Claude Code