Add and change cloud files and Google documents in Docs & Files
JE
18m ago+2600+2600+0123456789012345678901234567890123456789-5-5-0123456789
Why
The gap card 10476950575 names four SDK operations the CLI doesn't reach: adding and changing cloud files and Google documents in Docs & Files. files show already reads both kinds; nothing could create or edit them.
What changed
| Operation | Command |
|---|---|
CreateCloudFile | basecamp files cloud-files create [title] --url … [--service] [--description] [--subscribe|--no-subscribe] [--visible-to-clients] |
UpdateCloudFile | basecamp files cloud-files update <id|url> [--url] [--title] [--service] [--description] |
CreateGoogleDocument | basecamp files google-docs create [title] --url … [--type] [--description] [--draft] [--subscribe|--no-subscribe] [--visible-to-clients] |
UpdateGoogleDocument | basecamp files google-docs update <id|url> [--url] [--title] [--type] [--description] [--publish] [--subscribe|--no-subscribe] |
The groups hang off files, so they appear under its aliases too (docs, vaults, …), like files documents and files folders.
- Update is a full replace in Basecamp. Both controllers build a new recordable from the permitted params alone, so an omitted title or description is erased. The update commands read the record first and send back every field no flag changes. The description goes back verbatim, as
files updatealready does for documents. The known rich-text write-back problem with @mentions is card 10439714339. --serviceis inferred from the URL's host with the same tabledoorsuses, falling back toother.--typeis inferred from a docs.google.com path (document, spreadsheets, presentation), falling back toother. An explicit flag wins. On update, a new URL changes the service or type only when its host or path names one.- Google documents publish on create unless
--draftis given, matchingfiles documents create; Basecamp's own default is a draft. On update, status is left out unless--publishis given, so Basecamp keeps the document's current status.--publish=falseis refused, because a published document can't go back to a draft. files showbreadcrumbs for a cloud file or Google document now point at these update commands, not atfiles update, which can't change them.
Builds on
main at 29150b2, which already pins SDK v0.35.0, with main merged in through da36c00. No bump is needed.
Left out
--subscribeoncloud-files update. bc3 appliessubscriptionson update only to a drafted recording (Recording::DraftSubscribers), andCloudFilesControlleralways creates and updates a cloud file as active. The flag would be a no-op. Ongoogle-docs updateit is offered and documented as affecting drafts only.- Subscriptions on
files upload. The card also asks for upload notifications.CreateUploadis already reached, butfiles uploadstill sends no subscriber list. That part of the card is untouched, so the card stays open for it.
Tests
- Unit tests in
internal/commands/files_links_test.gocover:- inference of the service and type;
- subscribers sent,
[]for--no-subscribe, and none by default; - refusals before any request;
- update sending back unchanged fields;
- an empty
--descriptionclearing it; - draft and publish;
- an explicit
--typewinning over the URL.
- e2e validation in
e2e/files.bats: create without--url, update with no fields, an unknown--type. - Smoke:
e2e/smoke/smoke_file_links.batscreates and renames one of each against the QA project. Thedocsandvaultsvariants are marked out of scope insmoke_lifecycle.bats, as for the otherfilessubgroups.check-smoke-coverageaccounts for every leaf. API-COVERAGE.mdgainscloud_filesandgoogle_documentsrows (232 of 232 tracked), and.surfaceis regenerated.bin/cipasses locally on the merge with main through da36c00.TestHardenConfigDirininternal/cli(untouched here) fails under a umask of 077, because its fixtures are created without an explicit chmod and it expects 0755 and 0644; it passes under 022, as in CI.
Gap card
https://app.basecamp.com/2914079/buckets/48521764/card_tables/cards/10476950575
Summary by cubic
Adds files cloud-files create/update and files google-docs create/update, so the CLI can now add and change cloud files and Google documents in Docs & Files; previously files show could only read them.
- Updates replace the whole record in Basecamp, so the update commands read the record first and send back every field no flag changes; an explicitly empty
--descriptionclears it. - Update accepts a URL only from a trusted Basecamp host naming one record of its own type in the configured account, as
doorsdoes; descriptions upload the local images they name. --serviceis inferred from the URL host and--typefrom a docs.google.com path, with an explicit flag winning.- Google documents publish on create unless
--draftis given; on update, status is untouched unless--publish. files showbreadcrumbs for these records now point at the new update commands, naming the ID create prints sincefiles listdoesn't list them; follow-up commands carry the profile and account.--subscribeis omitted fromcloud-files updatebecause Basecamp only applies subscriptions to drafted records, and cloud files are always active; ongoogle-docs updateit affects drafts only.- Subscriptions on
files uploadare still unsupported, so the gap card stays open for that.