Skip to content

Conversation

michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Aug 25, 2025

Resolves #18063

Summary by CodeRabbit

  • New Features

    • Added “Get Listings” action to retrieve MLS listings from Bridge Interactive datasets with geographic filters, sorting, field selection, and pagination.
    • Introduced “New Listing Created” source that polls for newly added listings, avoids duplicates using timestamps, and includes a sample event for testing.
    • Dynamic field picker now derives available fields from the selected dataset.
  • Chores

    • Bumped Bridge Interactive Platform package version to 0.1.0 and added required dependency to improve compatibility.

Copy link

vercel bot commented Aug 25, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
pipedream-docs Ignored Ignored Aug 25, 2025 5:34pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Aug 25, 2025 5:34pm

Copy link
Contributor

coderabbitai bot commented Aug 25, 2025

Walkthrough

Adds Bridge Interactive Platform app methods and prop definitions, a “Get Listings” action, and a “New Listing Created” polling source with sample data. Implements API client with token-based requests to Bridge Data Output, enforces exclusive spatial filters, and updates package version and dependency.

Changes

Cohort / File(s) Summary
App client and props
components/bridge_interactive_platform/bridge_interactive_platform.app.mjs
Adds propDefinitions (dataset, field with dynamic options, near/radius/box/poly/geohash). Implements HTTP client: _baseUrl, _makeRequest (adds access_token), getListings. Removes authKeys. Targets https://api.bridgedataoutput.com/api/v2.
Action: Get Listings
components/bridge_interactive_platform/actions/get-listings/get-listings.mjs
New action to fetch listings from a dataset. Validates only one spatial filter is set. Calls app.getListings with parameters, supports sort/order/fields/limit/offset. Summarizes “Found N listings” and returns response.
Source: New Listing Created
components/bridge_interactive_platform/sources/new-listing-created/new-listing-created.mjs
New polling source. Enforces exclusive spatial filter. Persists last timestamp. Fetches listings sorted by OriginalEntryTimestamp desc, updates checkpoint, emits only newer listings with metadata. Includes deploy hook and timer.
Test fixture
components/bridge_interactive_platform/sources/new-listing-created/test-event.mjs
Adds static sample listing payload for testing source emissions.
Package metadata
components/bridge_interactive_platform/package.json
Bumps version 0.0.1 → 0.1.0; adds dependency @pipedream/platform ^3.1.0.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Action as Get Listings Action
  participant App as Bridge App Client
  participant API as Bridge Data Output API

  User->>Action: Trigger action with dataset + filters
  Action->>Action: Validate exclusive spatial filter
  Action->>App: getListings({ dataset, params })
  App->>API: GET /api/v2/{dataset}/listings?access_token=...
  API-->>App: 200 OK (listings bundle)
  App-->>Action: Response
  Action-->>User: Output + summary "Found N listings"
Loading
sequenceDiagram
  autonumber
  participant Timer
  participant Source as New Listing Created Source
  participant App as Bridge App Client
  participant API as Bridge Data Output API
  Note over Source: Maintains lastTs checkpoint

  Timer->>Source: Run (interval)
  Source->>Source: Validate exclusive spatial filter
  Source->>App: getListings({ dataset, sort=OriginalEntryTimestamp, order=desc, limit })
  App->>API: GET /api/v2/{dataset}/listings?access_token=...
  API-->>App: 200 OK (bundle)
  App-->>Source: Listings
  Source->>Source: Update lastTs to newest seen
  Source->>Source: Filter where OriginalEntryTimestamp > previous lastTs
  loop For each new listing
    Source-->>Source: Generate meta (id, summary, ts)
    Source-->>Timer: Emit event
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Assessment against linked issues

Objective Addressed Explanation
Implement Bridge Interactive Platform app integration (#18063)
Provide authenticated API client to Bridge Data Output (#18063)
Add action to fetch MLS listings (#18063)
Add source to emit newly created listings (#18063)

Assessment against linked issues: Out-of-scope changes

(no out-of-scope functional changes identified)

Poem

A rabbit taps keys with jubilant flare,
New listings hop in from data’s lair.
A timer ticks—“any burrows new?”—
The bridge replies with a freshest view.
Fields align, filters sing in tune—
Version bumped—let’s ship it soon! 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch issue-18063

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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

🧹 Nitpick comments (9)
components/bridge_interactive_platform/package.json (1)

15-17: Dependency addition is appropriate

Adding @pipedream/platform is required for axios/$ utilities used across the new app/action/source. Consider adding a brief changelog entry in the PR description noting this new dependency for visibility.

components/bridge_interactive_platform/sources/new-listing-created/test-event.mjs (2)

317-317: Typo in unit string

"Square Meteres" should be "Square Meters" (or "Square Metres" if using UK spelling). Since this is sample data, low priority, but fixing avoids propagating typos into user screenshots/demos.

-  "BuildingAreaUnits": "Square Meteres",
+  "BuildingAreaUnits": "Square Meters",

855-857: Sample URL missing protocol

The sample url lacks the https scheme. Recommend adding it to avoid confusion when users click/preview.

-  "url": "api.bridgedataoutput.com/api/v2/test/listings/P_5dba1ffa4aa4055b9f2a5936"
+  "url": "https://api.bridgedataoutput.com/api/v2/test/listings/P_5dba1ffa4aa4055b9f2a5936"
components/bridge_interactive_platform/bridge_interactive_platform.app.mjs (3)

35-39: Minor doc nit: radius description

Typo and clarity: remove the trailing "s" and clarify units expectation.

-      description: "Search Radius in miles, km, or degrees (no units)s",
+      description: "Search radius in miles, km, or degrees (specify the unit; e.g., 10mi, 5km, or degrees with no unit)",

48-57: Naming/UX: clarify “Field” vs “Sort By”

Using the same propDefinition for both the “Sort By” field and the multi-select “Fields” is clever, but can be confusing in the UI. Consider updating the base description in propDefinitions.field to be generic (“A response field name”), and set specific descriptions on the consuming props, which you already do. Optional.


60-62: Optional: retries / 429 handling

Bridge APIs can occasionally rate-limit. Consider adding an optional retry with backoff in _makeRequest using axios-retry semantics (or manual try/catch with exponential backoff) to improve robustness. Can be a follow-up.

components/bridge_interactive_platform/actions/get-listings/get-listings.mjs (2)

93-103: Mutually exclusive spatial filters check is good

The guard prevents conflicting spatial filters. Consider including radius validation (e.g., warn if radius is provided without near) to help users catch misconfigurations early. Optional.

-    if (Object.values(coords).filter(Boolean).length > 1) {
+    if (Object.values(coords).filter(Boolean).length > 1) {
       throw new ConfigurationError("Only one of near, poly, box, or geohash can be used");
     }
+    if (this.radius && !this.near) {
+      throw new ConfigurationError("`radius` can only be used with `near`.");
+    }

122-123: Summary assumes Bridge response shape

response.bundle will be defined after fixing _makeRequest. For extra safety, you could default to 0 to avoid runtime errors if upstream changes response shape.

-    $.export("$summary", `Found ${response.bundle.length} listings`);
+    $.export("$summary", `Found ${response?.bundle?.length ?? 0} listings`);
components/bridge_interactive_platform/sources/new-listing-created/new-listing-created.mjs (1)

115-118: Deploy behavior: confirm initial emission vs. state-only initialization

deploy() currently emits up to 25 events. If the product expectation is to seed state without emitting historical events, switch deploy() to set the initial cursor to the latest timestamp and skip emits. If emitting on deploy is desired, leave as-is.

-    async deploy() {
-      await this.processEvent(25);
-    },
+    async deploy() {
+      // Initialize cursor to latest without emitting
+      const resp = await this.bridgeInteractivePlatform.getListings({
+        dataset: this.dataset,
+        params: {
+          near: this.near,
+          radius: this.radius,
+          box: this.box,
+          poly: this.poly,
+          geohash: this.geohash,
+          sortBy: "OriginalEntryTimestamp",
+          order: "desc",
+          limit: 1,
+        },
+      });
+      const latest = resp?.bundle?.[0]?.OriginalEntryTimestamp;
+      if (latest) this._setLastTs(Date.parse(latest));
+    },
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 4fb872c and 1a0aa73.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (5)
  • components/bridge_interactive_platform/actions/get-listings/get-listings.mjs (1 hunks)
  • components/bridge_interactive_platform/bridge_interactive_platform.app.mjs (1 hunks)
  • components/bridge_interactive_platform/package.json (2 hunks)
  • components/bridge_interactive_platform/sources/new-listing-created/new-listing-created.mjs (1 hunks)
  • components/bridge_interactive_platform/sources/new-listing-created/test-event.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2024-12-12T19:23:09.039Z
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14935
File: components/sailpoint/package.json:15-18
Timestamp: 2024-12-12T19:23:09.039Z
Learning: When developing Pipedream components, do not add built-in Node.js modules like `fs` to `package.json` dependencies, as they are native modules provided by the Node.js runtime.

Applied to files:

  • components/bridge_interactive_platform/package.json
📚 Learning: 2025-06-04T17:52:05.780Z
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#16954
File: components/salesloft/salesloft.app.mjs:14-23
Timestamp: 2025-06-04T17:52:05.780Z
Learning: In the Salesloft API integration (components/salesloft/salesloft.app.mjs), the _makeRequest method returns response.data which directly contains arrays for list endpoints like listPeople, listCadences, listUsers, and listAccounts. The propDefinitions correctly call .map() directly on these responses without needing to destructure a nested data property.

Applied to files:

  • components/bridge_interactive_platform/bridge_interactive_platform.app.mjs
🧬 Code graph analysis (3)
components/bridge_interactive_platform/actions/get-listings/get-listings.mjs (2)
components/bridge_interactive_platform/sources/new-listing-created/new-listing-created.mjs (2)
  • coords (67-72)
  • response (79-91)
components/bridge_interactive_platform/bridge_interactive_platform.app.mjs (1)
  • response (18-23)
components/bridge_interactive_platform/sources/new-listing-created/new-listing-created.mjs (2)
components/bridge_interactive_platform/actions/get-listings/get-listings.mjs (2)
  • coords (94-99)
  • response (105-121)
components/bridge_interactive_platform/bridge_interactive_platform.app.mjs (2)
  • response (18-23)
  • listing (24-24)
components/bridge_interactive_platform/bridge_interactive_platform.app.mjs (2)
components/bridge_interactive_platform/actions/get-listings/get-listings.mjs (1)
  • response (105-121)
components/bridge_interactive_platform/sources/new-listing-created/new-listing-created.mjs (1)
  • response (79-91)
⏰ 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). (4)
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base
  • GitHub Check: pnpm publish
🔇 Additional comments (6)
components/bridge_interactive_platform/package.json (1)

3-3: Version bump looks good

Package version updated to 0.1.0. No issues from my side.

components/bridge_interactive_platform/bridge_interactive_platform.app.mjs (2)

75-82: getListings path assembly OK

Path composition and param pass-through look correct for Bridge Data Output v2.


68-71: Could you please share the Bridge Data Output API documentation URL or a sample request/response? With that information, I can confirm whether it supports sending the access token via the Authorization: Bearer header instead of the access_token query parameter.

components/bridge_interactive_platform/actions/get-listings/get-listings.mjs (1)

105-121: Param construction is correct; ensure data-shape after app fix

Once _makeRequest returns response.data, this call path will work as expected, and fields joining is correct. No change needed here.

components/bridge_interactive_platform/sources/new-listing-created/new-listing-created.mjs (2)

74-76: Good exclusivity guard on spatial filters

Prevents ambiguous geographic queries. Matches the action.


106-112: Meta payload looks good

Stable id and timestamp extraction from OriginalEntryTimestamp is appropriate.

@vunguyenhung vunguyenhung merged commit 04803d2 into master Aug 27, 2025
10 checks passed
@vunguyenhung vunguyenhung deleted the issue-18063 branch August 27, 2025 00:53
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.

[APP] Bridge Interactive Platform
3 participants