Commit Graph

648 Commits

Author SHA1 Message Date
Peter Steinberger
3165da427d fix(auth): isolate Keep service account fallback (#414) (thanks @jgwesterlund)
Some checks failed
ci / test (push) Has been cancelled
ci / worker (push) Has been cancelled
ci / windows (push) Has been cancelled
ci / darwin-cgo-build (push) Has been cancelled
2026-03-07 16:47:24 +00:00
John Westerlund
91b4822c60 fix(auth): restrict Keep service account to Keep API calls only
When a Keep-specific service account file (keep-sa-*.json) exists,
tokenSourceForServiceAccountScopes falls back to it for all API calls,
not just Keep. This causes 401 errors on Calendar, Gmail, Drive, and
other services that should use OAuth.

Only use keep-sa and legacy Keep SA files when serviceLabel is "keep",
allowing other services to fall through to OAuth authentication.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 16:45:46 +00:00
Peter Steinberger
8036c597a1 fix(googleapi): scope timeout landing cleanup (#425) (thanks @laihenyi) 2026-03-07 16:44:51 +00:00
laihenyi
449beff88b
fix(googleapi): replace Client.Timeout with transport-level ResponseHeaderTimeout (#425)
* feat(drive): include shortcutDetails in drive get fields

Add shortcutDetails to the Drive Get API fields to enable resolving
shortcut target file IDs and MIME types.

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

* fix(googleapi): replace Client.Timeout with transport-level ResponseHeaderTimeout

The global http.Client.Timeout (30s) applied to the entire request
lifecycle, causing large Drive file downloads (videos, backups, etc.)
to time out. Replace it with http.Transport.ResponseHeaderTimeout
which only limits the time waiting for the server to begin responding.
Once response headers arrive and the body starts streaming, there is
no hard cap — large transfers complete naturally.

- Set ResponseHeaderTimeout=30s on the base transport
- Remove http.Client.Timeout from the API client
- Keep a dedicated tokenExchangeTimeout=30s for OAuth2 token refreshes
- Add tests verifying the new transport configuration

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 16:44:37 +00:00
Peter Steinberger
4403350a18 ci: cancel stale runs and cache tool installs 2026-03-07 15:35:06 +00:00
Peter Steinberger
0287bf3b9d fix: land sheets create parent move semantics (#424) (thanks @ManManavadaria) 2026-03-07 15:32:19 +00:00
Man Manavadaria
56398222f1
sheets create: add --parent flag and move spreadsheet to parent folder using Drive service (#424) 2026-03-07 15:31:47 +00:00
Peter Steinberger
6fa8b66941 fix(ci): satisfy nilnil lint in watch serve test 2026-03-07 15:01:27 +00:00
Peter Steinberger
8bf794a0b1 docs: backfill changelog entry for watch serve client override (#411) 2026-03-07 15:00:01 +00:00
Chrys Bader
2ee9860712
fix(gmail): preserve --client in watch serve push handler contexts (#411)
Ensure gmail watch serve re-applies the selected OAuth client to request-time contexts before creating Gmail services, so push handling does not fall back to client default in multi-client setups.
2026-03-07 14:59:29 +00:00
salmonumbrella
4abcd03da7
fix(gmail): allow Workspace native aliases with empty verification status (#407)
* fix(gmail): allow workspace native aliases for --from

* fix: land Workspace alias send fix and changelog (#407) (thanks @salmonumbrella)

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-03-07 14:56:25 +00:00
salmonumbrella
caf38a3d33
fix(gmail-watch): delay history fetch in watch serve (#397)
* fix(gmail-watch): delay history fetch in watch serve

* fix: land gmail watch fetch delay and changelog (#397) (thanks @salmonumbrella)

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-03-07 14:54:54 +00:00
Viz
4b1d1d429d
fix: embed IANA timezone database for Windows support (#388)
- Import time/tzdata in cmd/gog/main.go to bundle the IANA tz database
  into the binary (~450KB), fixing time.LoadLocation on Windows
- Add tzdata_test.go verifying LoadLocation works for representative zones
- Add windows-latest CI job running the full gate (fmt, lint, test, build)
2026-03-07 14:53:06 +00:00
laihenyi
e208a50128
fix(contacts): correct parameter types in contacts apply helpers (#355)
* fix(contacts): correct parameter types in contacts apply helpers

Go's parameter grouping syntax caused `given` and `org` to be typed as
`bool` instead of `string` in contactsApplyPersonName and
contactsApplyPersonOrganization, resulting in a build failure.

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

* fix(contacts): resolve lint errors from upstream refactor

- Rewrite if-else chain to switch statement (gocritic)
- Rename `clear` variable to `clearAll` to avoid shadowing predeclared
  identifier (predeclared)
- Remove unused `primaryURL` function (unused)

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 14:51:46 +00:00
Peter Steinberger
0ed89978d3 fix(sheets): cover rich-text hyperlinks in links command (#374) (thanks @omothm) 2026-03-03 05:25:56 +00:00
Omar Othman
ddc1a232e0 feat(sheets): add links command to retrieve cell hyperlinks
Add `gog sheets links` (alias: hyperlinks) command that retrieves
hyperlinks embedded in cells via spreadsheets.get with IncludeGridData.
Mirrors the existing `notes` command pattern using the CellData.Hyperlink field.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-03 05:25:56 +00:00
Peter Steinberger
9eb42121e9 docs: update drive ls --all docs/changelog (#107) (thanks @struong) 2026-03-03 05:06:17 +00:00
Steven Truong
14af8f2604 feat(drive): add --all flag to ls for global file listing 2026-03-03 05:06:17 +00:00
Peter Steinberger
e909bc8aad fix: honor dry-run for gmail bulk shortcuts (#385) (thanks @yeager) 2026-03-03 04:33:41 +00:00
Daniel Nylander
74d8089a15 feat(gmail): add archive, read, unread, trash convenience commands
New top-level Gmail commands for common label operations:

- `gog gmail archive` — remove INBOX label (archive)
- `gog gmail read` — remove UNREAD label (mark as read)
- `gog gmail unread` — add UNREAD label (mark as unread)
- `gog gmail trash` — add TRASH + remove INBOX label

All commands support:
- Message IDs as positional args: `gog gmail archive ID1 ID2`
- Query-based bulk ops: `gog gmail archive -q 'is:unread older_than:7d'`
- `--max` to limit query results (default 100)
- JSON output with `--json`
- Automatic batching (1000 per request, Gmail API limit)

These wrap the existing `gog gmail batch modify` with ergonomic
shortcuts for the most common Gmail operations.
2026-03-03 04:33:41 +00:00
Peter Steinberger
7abf494408 fix(ci): clear pre-existing lint baseline and docs updates 2026-03-03 04:06:29 +00:00
Peter Steinberger
0041b1f86a fix(auth): document gmail scope + readonly scope behavior (#113) (thanks @salmonumbrella) 2026-03-03 03:58:53 +00:00
salmonumbrella
59fb51276f fix(auth): resolve main rebase fallout 2026-03-03 03:58:53 +00:00
salmonumbrella
6eab7fd95a fix(lint): add blank lines for wsl_v5 linter
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-03 03:58:53 +00:00
salmonumbrella
25040fe7fe fix(auth): add readonly gmail and drive scope handling 2026-03-03 03:58:53 +00:00
Peter Steinberger
0aaafbe663 docs(readme): document drafts quote behavior 2026-03-03 03:39:26 +00:00
Peter Steinberger
ce9a89adfe fix(gmail): harden draft quote thread fallback (#394) (thanks @salmonumbrella) 2026-03-03 03:37:05 +00:00
salmonumbrella
5234214de3 feat(gmail): add --quote support to draft replies 2026-03-03 03:37:05 +00:00
Peter Steinberger
c2e7754a35 fix(cmd): repair rebase fallout in docs, time, and drive tests 2026-03-03 03:27:32 +00:00
Peter Steinberger
8b9f8316ab build(deps): update go, worker, and toolchain pins 2026-03-03 03:27:30 +00:00
Peter Steinberger
9ae2860754 ci(github): move CI jobs to blacksmith runners 2026-03-03 03:27:22 +00:00
salmonumbrella
b341ac1f78 docs(drive): add comment explaining shared drives query params
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-03 03:04:43 +00:00
salmonumbrella
427801d95c test(calendar): add test for --to monday end-of-day expansion
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-03 03:04:43 +00:00
salmonumbrella
65c33c8ef4 test(calendar): add tests for --to tomorrow and --to now
Add integration tests verifying isDayExpr() integration:
- TestResolveTimeRangeWithDefaultsToTomorrowEndOfDay: verifies
  --to tomorrow expands to end-of-day (23:59:59.999999999)
- TestResolveTimeRangeWithDefaultsToNowNoExpansion: verifies
  --to now does NOT expand to end-of-day (remains current time)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-03 03:04:43 +00:00
salmonumbrella
1b44490a24 test(calendar): add unit tests for isDayExpr function
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-03 03:04:43 +00:00
salmonumbrella
8955d73482 fix(drive): include all drives in ls 2026-03-03 03:04:43 +00:00
salmonumbrella
c8f16ebd4c fix(calendar): expand date-only --to 2026-03-03 03:04:43 +00:00
salmonumbrella
88fba24f05 fix(drive): include shared drives in search 2026-03-03 03:04:43 +00:00
salmonumbrella
2459923d28 fix: address linter issues in docs/drive commands
- Fix variable shadowing in DocsUpdateCmd (govet: shadow)
- Extract formatAuto constant to satisfy goconst linter

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-03 03:04:43 +00:00
salmonumbrella
f05a11c662 fix(drive): validate download formats 2026-03-03 03:04:43 +00:00
salmonumbrella
a5de5491ea fix(lint): resolve goconst and shadow lint errors
- Add boolTrue/boolFalse constants for string "true"/"false" values
- Rename shadowed err variable to writeErr in test file

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-03 03:04:43 +00:00
salmonumbrella
725d176143 docs(drive): add comment explaining shared drives query params
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-03 03:04:43 +00:00
salmonumbrella
4da63c9037 test(calendar): add test for --to monday end-of-day expansion
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-03 03:04:43 +00:00
salmonumbrella
9fea0341a1 test(calendar): add tests for --to tomorrow and --to now
Add integration tests verifying isDayExpr() integration:
- TestResolveTimeRangeWithDefaultsToTomorrowEndOfDay: verifies
  --to tomorrow expands to end-of-day (23:59:59.999999999)
- TestResolveTimeRangeWithDefaultsToNowNoExpansion: verifies
  --to now does NOT expand to end-of-day (remains current time)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-03 03:04:43 +00:00
salmonumbrella
e4d303f143 test(calendar): add unit tests for isDayExpr function
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-03 03:04:43 +00:00
salmonumbrella
2888f991e1 fix(drive): include all drives in ls 2026-03-03 03:04:43 +00:00
salmonumbrella
7e6ee3f1ba fix(calendar): expand date-only --to 2026-03-03 03:04:43 +00:00
salmonumbrella
b4d0bf9780 fix(docs): clarify update command help text
Distinguish the update command from write by specifying it inserts
text at a specific index position in the document.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-03 03:04:43 +00:00
salmonumbrella
10cafc986b test(docs): add invalid index validation tests for DocsUpdateCmd
Test that --index flag properly rejects zero and negative values
with the expected error message.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-03 03:04:32 +00:00
salmonumbrella
feae67ba9d test(docs): add --file input tests for write and update commands
Cover the readTextInput function and file path expansion logic
by testing DocsWriteCmd and DocsUpdateCmd with temp files.
Also test error cases: non-existent file, empty file, and
mutual exclusion of --text and --file flags.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-03 03:04:32 +00:00