Skip to content

add dropbox: files-api and python-surface - #266

Open
AbdullahT01 wants to merge 5 commits into
mainfrom
dropbox-source
Open

AbdullahT01 wants to merge 5 commits into
mainfrom
dropbox-source

Conversation

@AbdullahT01

@AbdullahT01 AbdullahT01 commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

Closes #98.

Adds Dropbox (new category storage: no existing one fit file storage/sync), with two sources:

  • dropbox/files-api (catalog kind, new Routes reader): routes removed (breaking) or added in the files namespace of Dropbox's own API spec, files.stone in dropbox/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 (apisurface kind): the public API of the dropbox package 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 only files) and every parameter (not only route names), which files-api doesn't read. Overlaps with files-api where a files route is removed, the same way openai/api and openai/python-surface overlap.

Checked against real history, not only the fixtures

  • files-api, walked over all 68 real consecutive pairs of files.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:
    • A renamed Stone spelling (2018-08-14: copy_v2 → copy:2 and four more, same HTTP call): matched by the operation the name maps to, not the name. Pinned by TestFilesAPIDropsARenamedSpelling on the real pair.
    • A route moved between files of its namespace. namespace files has also lived in files_properties.stone (2016-2017) and file_tagging.stone (2021-2026); both moved their routes into files.stone, the second in the golden pair. A name that looks removed or added is now looked for in the commit's other .stone files 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 in kinds/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's quality parameter 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 of base.py's signatures reformatted, none changed.

Checklist

  • Metadata complete in the registration (Packages on files-api: pypi:dropbox, npm:dropbox, both checked on the registries)
  • Every commit is signed off (git commit -s, DCO)
  • A golden test per source over real saved copies; one pinned drop test per source
  • providers/dropbox/testdata/README.md lists each file: URL, date, license, quote, and how it was trimmed
  • providers/dropbox/README.md from the template, with Why this source, alternatives, and known gaps
  • Provider-specific code only in providers/dropbox/; kinds/catalog imports no provider
  • Fetches only through env.Get
  • make check passes locally; make plugins prints both sources
  • Nothing private

Notes for the reviewer

  • Why files.stone, not openapi/openapi.yaml in 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.
  • Commit 2d462fd's message is wrong: it says the SDK source reads "the hand-written client surface". The walk above showed otherwise; ec0f65f corrects the code, docs and tests, and its message says why. Left in place rather than force-pushing a reviewed branch.
  • Known gaps, on the provider page: deprecation isn't its own event yet (only removal); only the files namespace is read by files-api; a backfill over dropbox 10.10.0 → 11.0.0 reads dropbox.Dropbox as removed when only the dropbox.dropbox submodule path broke.

Signed-off-by: AbdullahT01 <abdullahtahad30@gmail.com>
@AbdullahT01
AbdullahT01 requested a review from adssib as a code owner November 22, 2026 22:05
@claude

claude Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

PR #266 was updated after the trigger (536795e -> 2d462fd). Push again or mention Claude to run on the latest version.

@AbdullahT01 AbdullahT01 reopened this Nov 22, 2026
@AbdullahT01
AbdullahT01 marked this pull request as draft November 22, 2026 22:07
Comment thread providers/dropbox/provider.go Outdated
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"},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Suggested change
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"},

Comment on lines +19 to +21
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",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread kinds/catalog/routes.go Outdated
beforeLine, wasBefore := before[n]
afterLine, isAfter := after[n]
switch {
case wasBefore && !isAfter:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread providers/dropbox/testdata/README.md Outdated
|---|---|---|---|---|
| `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 |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Suggested change
| `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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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>
@AbdullahT01
AbdullahT01 marked this pull request as ready for review November 23, 2026 01:52
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>
@AbdullahT01 AbdullahT01 changed the title add the dropbox files-api plugin add dropbox: files-api and python-surface Nov 23, 2026
@AbdullahT01

Copy link
Copy Markdown
Contributor Author

@claude

@claude

claude Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Claude finished @AbdullahT01's task in 1m 9s —— View job


⚠️ Merge after fixes: one small docs fix in testdata/README.md; the code looks right

Thanks @AbdullahT01. This is a careful PR. Walking the real history of both sources (68 files.stone pairs, 49 wheel pairs) found the renamed spelling and the move between files, and that's the kind of check Rule 5 asks for. Every point from my last review is fixed in d3b4ae9:

  • Packages was added.
  • The Watches wording now says "file properties, tags, locks".
  • The namespace that spans several files is handled.
  • The route counts are 66/67.
  • The README now says "May-to-November".

I reviewed by reading the code only. I couldn't run the tests here; CI_go covers them.

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". Both Commands and now Routes drop a move or rename when they can prove the old and new names are the same thing (same file contents, same computed Operation, same namespace). 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 .stone file 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 names base.DropboxBase.sharing_remove_file_member, while callers write dropbox.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 in ec0f65f is the right call. A squash merge would also make the history clean.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

I14.6 · Watch Dropbox

1 participant