Skip to content

Conversation

@luancazarine
Copy link
Collaborator

@luancazarine luancazarine commented Nov 12, 2025

Resolves #13338

Summary by CodeRabbit

  • New Features

    • Added form selection capability to specify which form to monitor.
    • Introduced a new event source to detect and emit new form responses.
    • Introduced a new event source to detect and emit newly created forms.
  • Chores

    • Version bumped to 0.7.0.

…ion and responses. Added `New Form Created` and `New Form Response` sources, enabling event emission for new forms and responses. Updated `aidaform.app.mjs` with new prop definitions and methods for form management. Bump version to 0.7.0 in package.json.
@luancazarine luancazarine linked an issue Nov 12, 2025 that may be closed by this pull request
@vercel
Copy link

vercel bot commented Nov 12, 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 Nov 12, 2025 11:47pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Nov 12, 2025 11:47pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 12, 2025

Walkthrough

The changes refactor the AidaForm app module with a new API helper suite including pagination, URL construction, and request utilities, then introduce two new polling sources to monitor form creation and new form responses respectively.

Changes

Cohort / File(s) Summary
API Infrastructure
components/aidaform/aidaform.app.mjs
Introduces internal helpers (_apiUrl, _getHeaders, _makeRequest) for composing API requests; adds listForms() and listResponses() methods for fetching data; implements paginate() async generator with limit/marker-based pagination and optional result capping; adds public formId propDefinition with async options; removes previous authKeys hook; adds axios import and LIMIT constant (100)
Version Bump
components/aidaform/package.json
Bumps package version from 0.6.0 to 0.7.0
New Response Polling Source
components/aidaform/sources/new-form-response/new-form-response.mjs
New polling source that fetches form responses via listResponses() and pagination; tracks last processed timestamp in db; filters, sorts, and emits events per response with id, summary, and timestamp; deploy hook initializes with 25 results; provides formId selection prop
New Form Polling Source
components/aidaform/sources/new-form/new-form.mjs
New polling source that fetches forms via listForms(); tracks last seen form date in db; filters by creation date, sorts, and emits events per newly created form with name summary and timestamp; deploy hook initializes with 25 results

Sequence Diagram(s)

sequenceDiagram
    participant Timer
    participant Source as Response Source
    participant App as aidaform.app
    participant API as AidaForm API
    participant DB as State (db)

    Timer->>Source: trigger run()
    Source->>DB: _getLastDate()
    DB-->>Source: lastDate
    Source->>App: listResponses(formId)
    App->>App: paginate({fn, params})
    loop For each paginated batch
        App->>API: GET /forms/{formId}/responses?limit=100&marker=X
        API-->>App: responses + marker
        App-->>App: yield each response
    end
    App-->>Source: responses array
    Source->>Source: filter(created_at > lastDate)
    Source->>Source: sort descending, reverse for emit
    Source->>Source: emit each response (oldest→newest)
    Source->>DB: _setLastDate(newest.created_at)
    DB-->>Source: state saved
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • components/aidaform/aidaform.app.mjs: Medium complexity with new pagination logic, pagination generator with marker tracking, and API helper composition
  • components/aidaform/sources/new-form-response/new-form-response.mjs: High complexity per file—introduces full polling event source with state management (db persistence), pagination coordination, filtering, sorting, and emit ordering logic
  • components/aidaform/sources/new-form/new-form.mjs: Medium complexity—similar polling pattern to response source but operating on forms instead

Areas requiring extra attention:

  • Pagination logic in _apiUrl-based composition and marker/limit handling
  • State persistence and filtering logic in both sources (filtering by date, sorting, reverse traversal for emit order)
  • Event deduplication strategy (dedupe: "unique") and timestamp-based state tracking
  • Alignment of emit order (chronological oldest→newest for responses; newest→oldest for forms via reverse) and corresponding event payload structures

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR partially addresses issue #13338: it adds new-response and new-form sources with form ID selection, but does not implement all three required sources (missing new-payment-instant and new-file-instant). Add implementations for new-payment-instant and new-file-instant sources to fully satisfy the requirements in issue #13338.
Description check ❓ Inconclusive The PR description is minimal, referencing only the issue number without substantive detail about changes or requirements from the description template. Expand the description to include a WHY section explaining the rationale and benefits of the changes, as specified in the repository template.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main objective of the PR—enhancing the Aidaform component with new sources for monitoring forms.
Out of Scope Changes check ✅ Passed Changes include infrastructure updates to aidaform.app.mjs and version bump to package.json that are necessary for the new sources; these support the stated objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 13338-components-aidaform

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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 11446b8 and d910115.

📒 Files selected for processing (4)
  • components/aidaform/aidaform.app.mjs (1 hunks)
  • components/aidaform/package.json (1 hunks)
  • components/aidaform/sources/new-form-response/new-form-response.mjs (1 hunks)
  • components/aidaform/sources/new-form/new-form.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-06-04T17:52:05.780Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 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/aidaform/aidaform.app.mjs
📚 Learning: 2025-09-15T22:01:11.472Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 18362
File: components/leonardo_ai/actions/generate-image/generate-image.mjs:103-105
Timestamp: 2025-09-15T22:01:11.472Z
Learning: In Pipedream components, pipedream/platform's axios implementation automatically excludes undefined values from HTTP requests, so there's no need to manually check for truthiness before including properties in request payloads.

Applied to files:

  • components/aidaform/aidaform.app.mjs
📚 Learning: 2024-10-10T19:18:27.998Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 14265
File: components/the_magic_drip/sources/common.mjs:35-43
Timestamp: 2024-10-10T19:18:27.998Z
Learning: In `components/the_magic_drip/sources/common.mjs`, when processing items in `getAndProcessData`, `savedIds` is intentionally updated with IDs of both emitted and non-emitted items to avoid emitting retroactive events upon first deployment and ensure only new events are emitted as they occur.

Applied to files:

  • components/aidaform/sources/new-form/new-form.mjs
  • components/aidaform/sources/new-form-response/new-form-response.mjs
🧬 Code graph analysis (2)
components/aidaform/sources/new-form/new-form.mjs (1)
components/aidaform/sources/new-form-response/new-form-response.mjs (2)
  • lastDate (35-35)
  • responseArray (44-44)
components/aidaform/sources/new-form-response/new-form-response.mjs (1)
components/aidaform/sources/new-form/new-form.mjs (2)
  • lastDate (29-29)
  • responseArray (30-30)
⏰ 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: pnpm publish
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base

Copy link
Collaborator

@lcaresia lcaresia left a comment

Choose a reason for hiding this comment

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

LGTM!

@vunguyenhung
Copy link
Collaborator

For Integration QA:

@vunguyenhung
Copy link
Collaborator

Hi everyone, all test cases are passed! Ready for release!

Test reports

@luancazarine luancazarine merged commit 0a09fa5 into master Nov 14, 2025
10 checks passed
@luancazarine luancazarine deleted the 13338-components-aidaform branch November 14, 2025 14:54
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.

[Components] aidaform

4 participants