Skip to content

Conversation

D-K-P
Copy link
Member

@D-K-P D-K-P commented Sep 9, 2025

No description provided.

Copy link

changeset-bot bot commented Sep 9, 2025

⚠️ No Changeset found

Latest commit: f6c0e27

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

Copy link
Contributor

coderabbitai bot commented Sep 9, 2025

Walkthrough

Adds a new docs page at docs/guides/example-projects/anchor-browser-web-scraper.mdx detailing a scheduled Anchor Browser web scraping workflow with Trigger.dev, including code samples and cleanup handling. Updates docs/guides/introduction.mdx to include a new row in the Example projects table linking to the guide and its GitHub repo. Modifies docs/docs.json to insert the new guide into the Guides & examples → Example projects navigation, placed before the batch LLM evaluator entry. No application code or APIs are changed.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10–15 minutes

  • Scope: 3 docs files; one new, content-heavy MDX page with code snippets; minor nav and table edits.
  • Complexity: Low logic density; primarily content and example code.
  • Heterogeneity: Mostly documentation; consistent, localized changes.

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e0d3869 and f6c0e27.

📒 Files selected for processing (1)
  • docs/guides/example-projects/anchor-browser-web-scraper.mdx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/guides/example-projects/anchor-browser-web-scraper.mdx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (javascript-typescript)

Pre-merge checks (2 passed, 1 warning)

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request currently lacks a description and does not follow the required description template, omitting key sections such as a summary of changes, motivation, and testing instructions. Please populate the pull request description by filling out the repository’s PR description template, ensuring all required sections like summary, motivation, implementation details, and testing steps are completed.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title clearly summarizes the main change by indicating that an Anchor Browser example is being added and concisely describes the primary update without unnecessary detail.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs/anchorbrowser-example

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/guides/example-projects/anchor-browser-web-scraper.mdx (1)

120-125: Typo: “Browser our” → “Browse our”.

-- Browser our [example projects](/guides/introduction) to see how you can use Trigger.dev with other services.
+- Browse our [example projects](/guides/introduction) to see how you can use Trigger.dev with other services.
🧹 Nitpick comments (3)
docs/guides/example-projects/anchor-browser-web-scraper.mdx (3)

49-58: Verify SDK import and env var naming against current Anchor SDK.

Docs commonly use AnchorClient with ANCHOR_API_KEY, while some pages show a named Anchorbrowser. The default import used here may not match the SDK; the env var name differs too. Please confirm and align to reduce copy/paste errors.

Option aligning with quickstart:

-import Anchorbrowser from "anchorbrowser";
+import { AnchorClient } from "anchorbrowser";

-const client = new Anchorbrowser({
-  apiKey: process.env.ANCHOR_BROWSER_API_KEY!,
+const client = new AnchorClient({
+  apiKey: process.env.ANCHOR_API_KEY!,
});

Refs: SDK quickstart (AnchorClient, ANCHOR_API_KEY) and alternate examples. (docs.anchorbrowser.io)


61-66: Prefer returned live_view_url over manual construction.

The create-session response includes live_view_url. Using it avoids future URL format changes.

- console.log(`Live View URL: https://live.anchorbrowser.io?sessionId=${session.data.id}`);
+ console.log(`Live View URL: ${session.data.live_view_url}`);

Anchor’s API returns live_view_url; live view embedding guidance recommends using that value. (docs.anchorbrowser.io)


75-89: Make result parsing deterministic (avoid brittle string contains).

Relying on a free-form string with “Show:” is fragile. Either request structured output or parse with a schema/regex.

- const result = response.data.result?.result || response.data.result || response.data;
- if (result && typeof result === "string" && result.includes("Show:")) {
+ const raw = response.data.result?.result ?? response.data.result ?? response.data;
+ const m = typeof raw === "string" 
+   ? raw.match(/Show:\s*(.+?),\s*Price:\s*(.+?),\s*Time:\s*(.+)$/)
+   : null;
+ if (m) {
+   const [, show, price, time] = m;
    return {
      success: true,
-     bestDeal: result,
+     bestDeal: { show, price, time },
      liveViewUrl: `https://live.anchorbrowser.io?sessionId=${session.data.id}`,
    };

Or change the prompt to request JSON and JSON.parse it.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 12bef0a and e0d3869.

📒 Files selected for processing (3)
  • docs/docs.json (1 hunks)
  • docs/guides/example-projects/anchor-browser-web-scraper.mdx (1 hunks)
  • docs/guides/introduction.mdx (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (4)
docs/docs.json (1)

339-351: Nav entry looks good; please verify route build succeeds.

The slug path format matches surrounding entries. After merge, run the docs build and click-test the new item in the “Guides & examples → Example projects” menu to ensure no missing-page regressions.

docs/guides/introduction.mdx (1)

48-49: LGTM: new example row renders and links correctly.

Name, docs link, and repo URL look consistent with the new guide.

docs/guides/example-projects/anchor-browser-web-scraper.mdx (2)

67-76: Endpoint usage looks correct.

tools.performWebTask with sessionId, url, and prompt matches the v1 API.

Reference. (docs.anchorbrowser.io)


90-98: Nice: robust session cleanup.

Good use of finally and nested try/catch to avoid leaking sessions if the task throws.

@D-K-P D-K-P merged commit b9b17e2 into main Sep 9, 2025
7 checks passed
@D-K-P D-K-P deleted the docs/anchorbrowser-example branch September 9, 2025 13:32
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.

2 participants