Repository navigation
add dropbox: files-api and python-surface - #266
AbdullahT01 wants to merge 5 commits into
Conversation
Signed-off-by: AbdullahT01 <abdullahtahad30@gmail.com>
| Watches: "Routes removed or added in Dropbox's own API spec for the files namespace " + | ||
| "(upload, download, copy, move, delete, search, sharing of properties), from " + | ||
| "dropbox-api-spec's files.stone, read at each commit that changed it", | ||
| URLs: []string{"https://github.com/dropbox/dropbox-api-spec/blob/main/files.stone"}, |
There was a problem hiding this comment.
Missing Packages (Rule 1). For an API source, Packages lists the provider's official SDKs. Your README says every official SDK is generated from this spec, so the Python and JS ones map straight to this source. Without them, plugin.ForPackage can't route a customer's lockfile entry for dropbox to this source. Please check the names on PyPI and npm first (I believe both are dropbox):
| URLs: []string{"https://github.com/dropbox/dropbox-api-spec/blob/main/files.stone"}, | |
| URLs: []string{"https://github.com/dropbox/dropbox-api-spec/blob/main/files.stone"}, | |
| Packages: []string{"pypi:dropbox", "npm:dropbox"}, |
| Watches: "Routes removed or added in Dropbox's own API spec for the files namespace " + | ||
| "(upload, download, copy, move, delete, search, sharing of properties), from " + | ||
| "dropbox-api-spec's files.stone, read at each commit that changed it", |
There was a problem hiding this comment.
Watches wording. "sharing of properties" isn't what these routes are. properties/* in the files namespace are file properties (custom metadata on files), and sharing is a separate namespace. The text goes into plugins.json as-is, so something like "(upload, download, copy, move, delete, search, file properties, tags, locks)" would be more accurate. The provider page (line 9) lists "file requests" too, but those are in the separate file_requests namespace, not files.stone.
| beforeLine, wasBefore := before[n] | ||
| afterLine, isAfter := after[n] | ||
| switch { | ||
| case wasBefore && !isAfter: |
There was a problem hiding this comment.
Precision question, please confirm. This reads one file, but a Stone namespace can span several files (for example, I believe namespace sharing is split across sharing_files.stone, sharing_folders.stone and others in the same repo). If namespace files is ever declared in a second file, a route moving between the two would produce a breaking event here with confidence: 1.0, even though the route still works. That would mean a wrong PR in someone's repo. The shape guard won't catch it while only a few routes move.
I couldn't list the upstream repo from CI to check this. If files.stone is the only namespace files file today, a sentence on the provider page saying so is enough (line 32 says "none has", but that is about other namespaces). If not, Path could become a list of files whose route sets are combined.
| |---|---|---|---|---| | ||
| | `dropbox-files-c8364404.stone` | https://raw.githubusercontent.com/dropbox/dropbox-api-spec/c8364404953d875801d496a81f786c5545f78223/files.stone | 2023-04-26 | MIT (dropbox/dropbox-api-spec `LICENSE`): excerpt for testing, © Dropbox, Inc.; maintainers, please confirm | `route properties/remove(file_properties.RemovePropertiesArg, Void, file_properties.RemovePropertiesError) deprecated` | | ||
| | `dropbox-files-6c68656c.stone` | https://raw.githubusercontent.com/dropbox/dropbox-api-spec/6c68656caafdff65a30943fe186a1800b9f35bbc/files.stone | 2026-05-12 | MIT: excerpt for testing, © Dropbox, Inc.; maintainers, please confirm | `route tags/add (AddTagArg, Void, AddTagError)` (new; `properties/remove` and its two siblings are gone) | | ||
| | `dropbox-files-a4fc0169.stone` | https://raw.githubusercontent.com/dropbox/dropbox-api-spec/a4fc0169eda7dc981facd4208ebc7b66a4db00ee/files.stone | 2026-06-07 | MIT: excerpt for testing, © Dropbox, Inc.; maintainers, please confirm | same 68 route names as `dropbox-files-6c68656c.stone`: the drop test | |
There was a problem hiding this comment.
Small factual fix: the saved a4fc0169 copy (and the 6c68656c copy) has 67 route names: 68 lines, one of which is namespace files. That matches "67 routes" on the provider page. c8364404 has 66, and 66 − 3 + 4 = 67.
| | `dropbox-files-a4fc0169.stone` | https://raw.githubusercontent.com/dropbox/dropbox-api-spec/a4fc0169eda7dc981facd4208ebc7b66a4db00ee/files.stone | 2026-06-07 | MIT: excerpt for testing, © Dropbox, Inc.; maintainers, please confirm | same 68 route names as `dropbox-files-6c68656c.stone`: the drop test | | |
| | `dropbox-files-a4fc0169.stone` | https://raw.githubusercontent.com/dropbox/dropbox-api-spec/a4fc0169eda7dc981facd4208ebc7b66a4db00ee/files.stone | 2026-06-07 | MIT: excerpt for testing, © Dropbox, Inc.; maintainers, please confirm | same 67 route names as `dropbox-files-6c68656c.stone`: the drop test | |
| ### What the plugin reads and ignores | ||
|
|
||
| - **Reads** every line matching `^route name(...)`, by name only (never the route's argument, result or error types, or whether it's marked `deprecated`): a name in the older commit's file and gone from the newer's is a `breaking` `api_operation` event; a name new in the newer commit's file is `added`. The excerpt quotes the whole declaration line, deprecation marker included when there is one. | ||
| - **Ignores** everything else in the file: structs, unions, docstrings, route attributes (`attrs`, `scope`, `is_preview`…) and whether a surviving route's own signature changed shape. A route that keeps its name but changes its request or response type isn't seen. |
There was a problem hiding this comment.
This says "the file's July-to-November 2026 commits" but then says it was confirmed on the 2026-05-12 commit. Line 27 says the bursts ran "from May to November 2026", so this probably should say "May-to-November".
Signed-off-by: AbdullahT01 <abdullahtahad30@gmail.com>
Adds dropbox/python-surface (apisurface, PyPI dropbox), alongside files-api. Most of the package is Stone-generated from the same spec files-api already reads, but dropbox_client.py (the Dropbox and DropboxTeam classes), oauth.py, session.py and content_hash.py are hand-written and independent of it, same as redis-py's and supabase-py's SDK surfaces over their own specs. Golden pair: 10.10.0 -> 11.0.0, the real dropbox.py -> dropbox_client.py rename UPGRADING.md documents. The release UPGRADING.md actually names, 10.11.0, turned out to be yanked on PyPI, so that's the real consecutive pair this source ever sees. Signed-off-by: AbdullahT01 <abdullahtahad30@gmail.com>
The SDK is nearly all Stone-generated, so this source is the spec as Python callers see it (every namespace, every parameter), not a view of hand-written code: walked against every real wheel from 11.0.0 to 12.2.5, all 46 breaking events are in generated modules. The old golden pair (10.10.0 -> 11.0.0) pinned an event reading dropbox.Dropbox removed when dropbox.Dropbox kept working; it's now a known gap. Golden is now 12.2.3 -> 12.2.4 (sharing_remove_file_member, deprecated, then removed); the drop pair 12.2.0 -> 12.2.1 reformats base.py's signatures. Signed-off-by: AbdullahT01 <abdullahtahad30@gmail.com>
… an event A Stone namespace can span files, and files did: files_properties.stone (2016-2017) and file_tagging.stone (2021-2026), whose routes then moved into files.stone. The golden pair read tags/add, tags/get and tags/remove as new when they had moved in. A name that looks removed or added is now looked for in the commit's other .stone files of the same namespace first. Over all 68 real pairs: 11 additions were moves, the 3 real removals stay. Also from review: Packages (pypi:dropbox, npm:dropbox) on files-api, Watches lists what files.stone holds, route and commit counts corrected. Signed-off-by: AbdullahT01 <abdullahtahad30@gmail.com>
|
Claude finished @AbdullahT01's task in 1m 9s —— View job
|
| Rule | Status | Evidence |
|---|---|---|
| 1. Registration and metadata | ✅ | providers/dropbox/provider.go:15 has one RegisterProvider with id, name, category storage and homepage. files-api has layer, Watches, URL and Packages (pypi:dropbox, npm:dropbox, the same pattern as openai/api). python-surface goes through apisurface.PyPI. The new category is added in core/plugin/provider.go:47 and in both enums in docs/plugins.schema.json. No hand-kept list. I read the Watches text and it matches what files.stone declares. |
| 2. Provider page and "Why this source" | ✅ | Both sections have a link, date checked, why this one, alternatives and a quote. The write-up on openapi/openapi.yaml as an alternative is especially useful. |
| 3. Golden, drop test, testdata, quotes | Goldens: TestFilesAPIGolden and TestPythonSurface. Pinned drops: a4fc0169 and 12.2.0→12.2.1, plus a rename pin. Every event has source_url and source_excerpt. But some rows of testdata/README.md are missing a quote (see below). |
|
| 4. Fetch and import boundaries | ✅ | routes.go fetches only through env.Get, using core/github's API and Raw constants. kinds/catalog imports no provider. providers/dropbox imports only core/ and kinds/. |
| 5. Precision over recall | ✅ | Routes are compared as a set of names, not lines. A rename only drops an event when both spellings map to the same Operation. A move needs the route to be declared in a file with the same namespace. If the listing can't be fetched, the pair fails instead of emitting an event (routes.go:253, tested in routes_test.go:59). The shape guard is at 0.8. |
| 6. Nothing private | ✅ | Only public GitHub, PyPI and forum links. No credentials, internal names or session links. |
Blocking (small)
Rows in providers/dropbox/testdata/README.md without a quote (Rule 3). The three dropbox-spec-listing-*.json rows (lines 23–25) and the PyPI metadata row (line 42) have an empty Quote column. The listing rows also have no License column. Please add a short quote from each file, e.g. "path": "file_tagging.stone", "type": "file" for c8364404. For the listings' license, something like "GitHub API response, metadata only" would do. The wheel rows put the fetch date in the paragraph above the table, which is fine.
Non-blocking suggestions
kinds/catalog/catalog.go:11-13: the package doc still says "a name that moves … reads as one removal and one addition … A reader never guesses a rename". BothCommandsand nowRoutesdrop a move or rename when they can prove the old and new names are the same thing (same file contents, same computedOperation, samenamespace). Rewording it to "never guesses a rename; it drops one only when both sides prove to be the same operation" would keep the doc true.- Cost of
elsewhere(routes.go:263): on a pair with a change, this fetches the listing and then every.stonefile at that commit, about 23–40 raw GETs. It's cheap enough, since it only runs on pairs with a change and the fetch layer caches. A one-line comment saying so would stop a future reader from "optimising" the check away. python_surface_test.go:17: the event namesbase.DropboxBase.sharing_remove_file_member, while callers writedropbox.Dropbox(...).sharing_remove_file_member. The provider page already explains this (line 71), so no change is needed. It may be worth a follow-up in the kind so inherited methods can be reported under the public subclass.- Commit
2d462fd's message: keeping it and correcting it inec0f65fis the right call. A squash merge would also make the history clean.
What this changes
Closes #98.
Adds Dropbox (new category
storage: no existing one fit file storage/sync), with two sources:dropbox/files-api(catalogkind, newRoutesreader): routes removed (breaking) or added in the files namespace of Dropbox's own API spec,files.stoneindropbox/dropbox-api-spec, read at each commit that changed it (no release tags, so a commit is the version, as for Convex's and Supabase's specs). Compares the set of declared route names, never lines, so the many commits that only reorder the file read as no change.dropbox/python-surface(apisurfacekind): the public API of thedropboxpackage on PyPI. It's nearly all Stone-generated from the same spec, so it's the spec as Python callers see it: every namespace (not onlyfiles) and every parameter (not only route names), whichfiles-apidoesn't read. Overlaps withfiles-apiwhere afilesroute is removed, the same wayopenai/apiandopenai/python-surfaceoverlap.Checked against real history, not only the fixtures
files-api, walked over all 68 real consecutive pairs offiles.stone: 3 breaking events, all real (properties/remove,properties/template/get,properties/template/list, deprecated since before 2023, removed 2026-05-12, the golden pair). Two things a plain name diff got wrong, both fixed and pinned:copy_v2→copy:2and four more, same HTTP call): matched by the operation the name maps to, not the name. Pinned byTestFilesAPIDropsARenamedSpellingon the real pair.namespace fileshas also lived infiles_properties.stone(2016-2017) andfile_tagging.stone(2021-2026); both moved their routes intofiles.stone, the second in the golden pair. A name that looks removed or added is now looked for in the commit's other.stonefiles of the same namespace first (only on pairs with a change). Over the 68 pairs this drops 11 additions that were moves and no removal. Pinned by the golden pair and by a synthetic move-out test inkinds/catalog.python-surface, walked over every real wheel from 11.0.0 to 12.2.5: 46 breaking events over 49 pairs, all in generated modules, spot-checked against the wheels (e.g.files_get_thumbnail'squalityparameter gone in 12.2.2). Golden pair 12.2.3 → 12.2.4:sharing_remove_file_member, already warning "deprecated", removed. Drop pair 12.2.0 → 12.2.1: most ofbase.py's signatures reformatted, none changed.Checklist
Packagesonfiles-api:pypi:dropbox,npm:dropbox, both checked on the registries)git commit -s, DCO)providers/dropbox/testdata/README.mdlists each file: URL, date, license, quote, and how it was trimmedproviders/dropbox/README.mdfrom the template, with Why this source, alternatives, and known gapsproviders/dropbox/;kinds/catalogimports no providerenv.Getmake checkpasses locally;make pluginsprints both sourcesNotes for the reviewer
files.stone, notopenapi/openapi.yamlin the same repo: the OpenAPI export is the cleaner typed source, but it was added 2026-11-17 and has no removal in its history yet to pin a test on. Written up as an alternative to revisit.2d462fd's message is wrong: it says the SDK source reads "the hand-written client surface". The walk above showed otherwise;ec0f65fcorrects the code, docs and tests, and its message says why. Left in place rather than force-pushing a reviewed branch.filesnamespace is read byfiles-api; a backfill overdropbox10.10.0 → 11.0.0 readsdropbox.Dropboxas removed when only thedropbox.dropboxsubmodule path broke.