-
-
Notifications
You must be signed in to change notification settings - Fork 724
Docs/new reference section #1719
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
WalkthroughThis pull request reorganizes the navigation structure in the Changes
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (3)
docs/management/auto-pagination.mdx (1)
26-41
: Next-page retrieval snippet is clear and actionable.
The example demonstrates checking for additional pages usinghasNextPage()
and retrieving subsequent pages withgetNextPage()
. For improved clarity, consider adding an inline comment inside the while loop describing the purpose of iterating over subsequent pages.docs/management/authentication.mdx (1)
77-80
: Consider refining the language for the PAT description.
To strengthen the writing, you might replace “gives access to” with “grants access to” and “orgs” with “organizations” for clarity and formality. For example:-A PAT is a token associated with a specific user, and gives access to all the orgs, projects, and environments that the user has access to. +A PAT is a token associated with a specific user, and grants access to all the organizations, projects, and environments that the user is associated with.🧰 Tools
🪛 LanguageTool
[style] ~80-~80: Try using a synonym here to strengthen your writing.
Context: ...en associated with a specific user, and gives access to all the orgs, projects, and e...(GIVE_PROVIDE)
docs/docs.json (1)
104-104
: Nitpick: Extra empty line in navigation.An extra empty line appears at line 104. If this additional spacing is intentional for readability, it’s fine; otherwise, consider removing it to keep the JSON compact.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
docs/docs.json
(3 hunks)docs/management/advanced-usage.mdx
(1 hunks)docs/management/authentication.mdx
(1 hunks)docs/management/auto-pagination.mdx
(1 hunks)docs/management/errors-and-retries.mdx
(1 hunks)docs/management/overview.mdx
(2 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/management/auto-pagination.mdx
[grammar] ~8-~8: The verb ‘await’ seems to be in the wrong form here.
Context: ...PI support auto-pagination. You can use for await … of
syntax to iterate through items a...
(FOR_VB)
docs/management/authentication.mdx
[style] ~80-~80: Try using a synonym here to strengthen your writing.
Context: ...en associated with a specific user, and gives access to all the orgs, projects, and e...
(GIVE_PROVIDE)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (21)
docs/management/advanced-usage.mdx (2)
1-5
: Frontmatter is correctly defined.
The YAML frontmatter clearly sets the title, sidebar title, and description which aligns with the file’s purpose.
7-26
: Code snippet for accessing raw HTTP responses is clear and useful.
The example demonstrates the use of bothwithResponse()
andasResponse()
to obtain and log HTTP response details. No issues were found.docs/management/auto-pagination.mdx (3)
1-5
: Frontmatter for auto-pagination is well-structured.
The metadata clearly defines the title, sidebar title, and description.
7-9
: Introduction text introduces auto-pagination effectively.
There is a LanguageTool hint regarding the verb “await” but note thatfor await … of
is a JavaScript language construct and is correctly used here.🧰 Tools
🪛 LanguageTool
[grammar] ~8-~8: The verb ‘await’ seems to be in the wrong form here.
Context: ...PI support auto-pagination. You can usefor await … of
syntax to iterate through items a...(FOR_VB)
10-22
: For-await-of snippet is succinct and correct.
The code example properly shows asynchronous iteration over paginated results using thefor await … of
syntax.docs/management/overview.mdx (2)
2-4
: Overview frontmatter reflects the new documentation structure.
The title and description are concise and align with the reorganized navigation.
41-41
: Usage code block ending is simple and effective.
The call tomain().catch(console.error);
is correctly placed; please ensure consistency in references, especially now that the Authentication details have been moved to a separate file.docs/management/errors-and-retries.mdx (3)
1-5
: Frontmatter for Errors and Retries is set appropriately.
The title, sidebar title, and description accurately introduce the content of the document.
33-47
: Retry configuration snippet is clear.
The example effectively demonstrates how to customize retry options via theconfigure
function.
51-61
: Disabling retries on a specific request is well illustrated.
This snippet concisely shows how to override default retry behavior when needed.docs/management/authentication.mdx (6)
1-5
: Frontmatter for the Authentication document is clear and informative.
The metadata accurately describes the purpose of the document.
7-13
: The note block for differentiating backend and frontend usage is effective.
This clearly advises users that the authentication strategies in this document are intended solely for backend usage.
15-45
: Authentication examples demonstrate both methods effectively.
The examples for secret key and personal access token configurations are clear. Please verify that using thesecretKey
property in the configuration for personal access tokens is intentional (since it might be overloaded in your SDK).
47-71
: Accordion table detailing endpoint support is comprehensive.
The table clearly differentiates which endpoints support secret key and personal access token authentication.
73-77
: Secret key section is concise and provides a clear reference.
Linking to the API Keys guide enhances the usability of the documentation.
81-96
: PAT usage snippet for uploading environment variables is clear.
The code example correctly shows the required arguments when using a PAT.docs/docs.json (5)
137-146
: Repositioned "Open source" Group.The "Open source" group has been re-added at a new position within the navigation. This change aligns with the PR objectives to improve the documentation’s structure. Please verify that its placement meets the intended hierarchy.
153-208
: New "API reference" Dropdown Implementation.A new dropdown labeled "API reference" has been added with clearly defined groups—namely, "API reference," "Tasks API," "Runs API," "Schedules API," and "Env Vars API." This reorganization looks well structured and fulfills the PR’s goal of enhancing accessibility to API documentation. Ensure that all page paths and group names are correct.
212-212
: Updated Icon for "Guides & examples".The icon for the "Guides & examples" dropdown has been updated from "book" to "books." This visual change aligns with the updated design specifications.
495-497
: Verified Redirect for "/frontend/react-hooks".The redirect entry mapping "/frontend/react-hooks" to "/frontend/react-hooks/overview" appears correct. Please confirm that this mapping remains consistent with the updated navigation structure.
498-501
: New Redirect for "/management/projects/runs".A new redirect has been added to reroute "/management/projects/runs" to "/management/overview." This update should help in handling legacy or misdirected URLs. Confirm that this redirect does not conflict with other routing rules.
```ts | ||
import { runs, APIError } from "@trigger.dev/sdk/v3"; | ||
|
||
async function main() { | ||
try { | ||
const run = await runs.retrieve("run_1234"); | ||
} catch (error) { | ||
if (error instanceof ApiError) { | ||
console.error(`API error: ${error.status}, ${error.headers}, ${error.body}`); | ||
} else { | ||
console.error(`Unknown error: ${error.message}`); | ||
} | ||
} | ||
} | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the identifier inconsistency for error handling.
The import uses APIError
(line 12) but the instance check uses ApiError
(line 18). This case mismatch will cause a runtime error. Please update the instance check to use the correct identifier.
Below is a diff that shows the necessary change:
- if (error instanceof ApiError) {
+ if (error instanceof APIError) {
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
```ts | |
import { runs, APIError } from "@trigger.dev/sdk/v3"; | |
async function main() { | |
try { | |
const run = await runs.retrieve("run_1234"); | |
} catch (error) { | |
if (error instanceof ApiError) { | |
console.error(`API error: ${error.status}, ${error.headers}, ${error.body}`); | |
} else { | |
console.error(`Unknown error: ${error.message}`); | |
} | |
} | |
} | |
``` | |
import { runs, APIError } from "@trigger.dev/sdk/v3"; | |
async function main() { | |
try { | |
const run = await runs.retrieve("run_1234"); | |
} catch (error) { | |
if (error instanceof APIError) { | |
console.error(`API error: ${error.status}, ${error.headers}, ${error.body}`); | |
} else { | |
console.error(`Unknown error: ${error.message}`); | |
} | |
} | |
} |
Summary by CodeRabbit