Skip to content

docs(js-sdk): 3 docstrings name parameters the functions do not take - #1740

Open
karpovantonme wants to merge 1 commit into
e2b-dev:mainfrom
karpovantonme:docs/parameters-that-are-not-in-the-signatures
Open

docs(js-sdk): 3 docstrings name parameters the functions do not take#1740
karpovantonme wants to merge 1 commit into
e2b-dev:mainfrom
karpovantonme:docs/parameters-that-are-not-in-the-signatures

Conversation

@karpovantonme

Copy link
Copy Markdown
Contributor

Volume.makeDir and Volume.writeFile each document options and opts, and the signature takes 1 merged parameter, opts?: VolumeWriteOpts & VolumeApiOpts. I merged the 2 doc lines instead of dropping one, since both halves are still true of the single argument.

TemplateBase.build documents tags, which is not in the signature, and says nothing about config, which is. I added a line for config; drop that hunk if you would rather leave the internal method as it was.

Comments only, no behaviour change. Found by a checker I wrote that compares every documented @param name against the signature under it. It read 183 of the 185 documented comments in this repository and these 3 were all it had to say.

Volume.makeDir and Volume.writeFile each document 2 options parameters,
options and opts, while the signature takes 1: opts?: VolumeWriteOpts &
VolumeApiOpts. The 2 lines are merged into one describing the intersection.

TemplateBase.build documents tags, which the signature does not take, and does
not document config, which it does.
@changeset-bot

changeset-bot Bot commented Aug 21, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 3d7b128

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@cla-bot cla-bot Bot added the cla-signed label Aug 21, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed against TASTE.md (e2b-dev/sdk-harness), focusing on the docstring rules this PR touches: T-69 (docstrings are API: document params, defaults, failure modes), T-70 (JSDoc tags), T-72 (@returns must not restate the method name), plus T-12 (acronym casing in prose) and T-45/T-47 (timeout knobs documented).

3 violations, all in packages/js-sdk/src/volume/index.ts — the two phantom options params are correctly removed, but collapsing them into @param opts <domain> and connection options leaves the actual knobs (uid, gid, mode, force, requestTimeoutMs) undocumented, which is what T-69 asks for.

Not tied to a changed line: in packages/js-sdk/src/template/index.ts the added @param config is accurate and the tags removal is right; @param options Build configuration options there is equally content-free, but build() is private so T-69 doesn't bite. Also worth noting for a follow-up (pre-existing, not this diff): makeDir/writeFile take an inline intersection VolumeWriteOpts & VolumeApiOpts rather than a named exported option type (T-23), which is part of why the opts docstring has nothing to link to.

* @param path path to the directory to create.
* @param options directory creation options.
* @param opts connection options.
* @param opts directory creation and connection options.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

T-69 (docstrings are part of the API — every public method documents its parameters, defaults and failure modes) and T-72 (a @returns that restates the method name documents nothing — here it is missing entirely while the method returns VolumeEntryStat).

Dropping the phantom options param is right, but "directory creation and connection options" names no knob the caller can act on: opts is VolumeWriteOpts & VolumeApiOpts, i.e. uid/gid/mode, force (create missing parents), and the connection surface (requestTimeoutMs, headers, proxy, domain).

Suggested change
* @param opts directory creation and connection options.
* @param opts directory metadata (`uid`, `gid`, `mode`), `force` to also create missing parent directories, and connection options such as `requestTimeoutMs` (default 60_000), `headers`, and `proxy`.
*
* @returns stat of the created directory: its name, path, type, size, and access/modification/creation times

* @param data data to write to the file. Data can be a string, `ArrayBuffer`, `Blob`, or `ReadableStream`. Outside the browser, `ReadableStream` data is streamed to the API instead of being buffered in memory.
* @param options file creation options.
* @param opts connection options.
* @param opts file creation and connection options.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

T-69 — same issue as makeDir: "file creation and connection options" documents nothing. force here means overwrite an existing file (not "create parents" as in makeDir), and this method defaults requestTimeoutMs to FILE_TIMEOUT_MS (1 hour) rather than the usual 60s — exactly the kind of default T-69/T-47 want stated in the docstring, and the kind of same-name/different-meaning flag a docstring is the only place to settle.

Suggested change
* @param opts file creation and connection options.
* @param opts file metadata (`uid`, `gid`, `mode`), `force` to overwrite an existing file, and connection options such as `requestTimeoutMs` (defaults to 1 hour for file writes), `headers`, and `proxy`.

* @param opts connection options.
* @param opts file creation and connection options.
*
* @returns information about the written file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

T-72 — a @returns that restates the method name documents nothing: "information about the written file" is the value's type spelled in English. Say which fields come back (VolumeEntryStat), the way getInfo is expected to enumerate what it returns.

Suggested change
* @returns information about the written file
* @returns stat of the written file: its name, path, type, size, and access/modification/creation times

@mishushakov

mishushakov commented Aug 24, 2026

Copy link
Copy Markdown
Member

Hey @karpovantonme would you be able to follow Devin's guidance? Otherwise we will have to close the PR as stale.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants