Skip to content

Conversation

@michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Dec 18, 2025

Resolves #17639

Summary by CodeRabbit

  • New Features

    • Memento Database integration: Create Entry, Get Library, List Entries, Update Entry actions.
    • Two new event sources: New Entry Created and Entry Updated (automatic triggers with pagination).
    • Improved field handling: robust JSON parsing for field inputs and dynamic select options for libraries/entries.
  • Chores

    • Package bumped to 0.1.0 and platform dependency added.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Dec 18, 2025

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

1 Skipped Deployment
Project Deployment Review Updated (UTC)
pipedream-docs-redirect-do-not-edit Ignored Ignored Dec 18, 2025 8:02pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 18, 2025

Walkthrough

Adds a full Memento Database integration: new actions (create/get/list/update entries), two polling sources (new-entry-created, entry-updated) built on a reusable polling base, an API client and prop definitions in the app, a recursive JSON parse utility, and a package version bump to 0.1.0.

Changes

Cohort / File(s) Summary
Action Modules
components/memento_database/actions/create-entry/create-entry.mjs, components/memento_database/actions/get-library/get-library.mjs, components/memento_database/actions/list-entries/list-entries.mjs, components/memento_database/actions/update-entry/update-entry.mjs
Four new action exports that define metadata, props, and async run handlers: Create Entry (creates an entry with parsed JSON fields), Get Library (fetches a library), List Entries (lists/paginates entries with fields/filtering), Update Entry (updates entry fields).
Polling Source Modules
components/memento_database/sources/new-entry-created/new-entry-created.mjs, components/memento_database/sources/entry-updated/entry-updated.mjs
Two new source modules that extend the shared base polling implementation; each overrides timestamp field, resource function, relevance check, and meta generation to emit events for created and updated entries.
Polling Framework
components/memento_database/sources/common/base-polling.mjs
New reusable polling base providing props, state tracking (lastRevision, lastTs via db), pagination (pageSize 100), abstract hooks (getTsField, getResourceFn, generateMeta, isRelevant), processEvent logic with deploy/run hooks and emission.
App Configuration & API Client
components/memento_database/memento_database.app.mjs
App extended with propDefinitions for libraryId, entryId (with paginated options), and fields; new internal methods: _baseUrl, _makeRequest, getLibrary, listLibraries, listEntries, createEntry, updateEntry; removed previous authKeys() behavior.
Utilities
components/memento_database/common/utils.mjs
New exported parseJson(input, maxDepth = 100) utility that recursively parses JSON-like strings into objects/arrays, prevents circular traversal via WeakSet, and falls back on original values for non-JSON or parse failures.
Package Configuration
components/memento_database/package.json
Package version bumped from 0.0.1 to 0.1.0 and adds dependency @pipedream/platform: ^3.1.1.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Focus areas:
    • components/memento_database/sources/common/base-polling.mjs — pagination, state persistence (lastRevision/lastTs), and processEvent correctness.
    • components/memento_database/memento_database.app.mjs — HTTP wrapper, auth token usage, and dynamic propDefinitions with pagination context.
    • components/memento_database/common/utils.mjs — recursive parsing edge cases, depth limiting, and circular reference handling.
    • actions that call parseJson (create/update) — ensure fields parsing and error handling align with API expectations.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR is missing required implementations: field-value-changed source and find-an-entry action are not included in the changeset. Implement the field-value-changed polling source [#17639] and find-an-entry action [#17639] to complete the requirements.
Description check ❓ Inconclusive The PR description only contains a single issue reference without filling the required 'WHY' section from the template. Complete the 'WHY' section in the PR description to explain the purpose and context of these new components.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: introducing new Memento Database components (actions and sources).
Out of Scope Changes check ✅ Passed All code changes are scoped to the Memento Database integration component: actions, sources, utilities, and app configuration.
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 issue-17639

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

📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 67eaf60 and c31e1ef.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (10)
  • components/memento_database/actions/create-entry/create-entry.mjs (1 hunks)
  • components/memento_database/actions/get-library/get-library.mjs (1 hunks)
  • components/memento_database/actions/list-entries/list-entries.mjs (1 hunks)
  • components/memento_database/actions/update-entry/update-entry.mjs (1 hunks)
  • components/memento_database/common/utils.mjs (1 hunks)
  • components/memento_database/memento_database.app.mjs (1 hunks)
  • components/memento_database/package.json (2 hunks)
  • components/memento_database/sources/common/base-polling.mjs (1 hunks)
  • components/memento_database/sources/entry-updated/entry-updated.mjs (1 hunks)
  • components/memento_database/sources/new-entry-created/new-entry-created.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (5)
📚 Learning: 2024-10-30T15:24:39.294Z
Learnt from: jcortes
Repo: PipedreamHQ/pipedream PR: 14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In `components/gainsight_px/actions/create-account/create-account.mjs`, the action name should be "Create Account" instead of "Create Memory".

Applied to files:

  • components/memento_database/actions/create-entry/create-entry.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/memento_database/sources/entry-updated/entry-updated.mjs
  • components/memento_database/sources/common/base-polling.mjs
📚 Learning: 2024-12-12T19:23:09.039Z
Learnt from: jcortes
Repo: PipedreamHQ/pipedream PR: 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/memento_database/package.json
📚 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/memento_database/memento_database.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/memento_database/memento_database.app.mjs
🧬 Code graph analysis (3)
components/memento_database/actions/create-entry/create-entry.mjs (2)
components/memento_database/actions/update-entry/update-entry.mjs (1)
  • entry (40-47)
components/memento_database/common/utils.mjs (2)
  • parseJson (1-40)
  • parseJson (1-40)
components/memento_database/sources/entry-updated/entry-updated.mjs (1)
components/memento_database/sources/common/base-polling.mjs (1)
  • ts (81-81)
components/memento_database/actions/update-entry/update-entry.mjs (2)
components/memento_database/actions/create-entry/create-entry.mjs (1)
  • entry (31-37)
components/memento_database/common/utils.mjs (2)
  • parseJson (1-40)
  • parseJson (1-40)
⏰ 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: Lint Code Base
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (15)
components/memento_database/package.json (1)

1-18: LGTM!

Version bump and dependency addition are appropriate for the new action and source components. The @pipedream/platform dependency is correctly added to support the polling infrastructure and configuration utilities used throughout the new modules.

components/memento_database/sources/common/base-polling.mjs (2)

44-55: LGTM - Abstract method pattern.

The abstract methods with ConfigurationError throws enforce implementation by subclasses, which is the correct pattern for this base polling framework.


100-107: No action needed. The implementation is correct.

The review comment is based on incorrect assumptions about item ordering. The Memento API returns entries sorted by creation time, from newest to oldest. The code collects items in the order received from the API (newest-first), and when max is specified, the truncation at line 100-102 retains the first 10 items—which are the newest entries, not older ones as the comment suggests. Additionally, Pipedream automatically emits events from oldest to newest when you add a timestamp, which handles the ordering correctly regardless of the emit sequence. Items are not emitted in oldest-first order; they're emitted in the order collected from the API. The current behavior properly ensures that during deploy, the 10 most recent entries are fetched and emitted, with Pipedream's system handling the final chronological ordering.

components/memento_database/common/utils.mjs (1)

14-18: WeakSet circular detection resets on nested JSON strings.

When a JSON string is parsed at line 15, parseJson is called recursively, creating a new WeakSet. This means circular reference detection doesn't persist across JSON parsing boundaries. If the parsed JSON contains an object reference that was already seen in an outer structure, it won't be detected.

This is likely acceptable given the use case (parsing user-provided field values), but worth noting for maintainability.

components/memento_database/actions/create-entry/create-entry.mjs (1)

30-40: LGTM!

The action correctly uses parseJson to handle the fields input, passes the required parameters to createEntry, and provides a helpful summary. The implementation is consistent with the update-entry action pattern.

components/memento_database/actions/get-library/get-library.mjs (1)

1-31: LGTM!

Clean implementation of a read-only action. Annotations correctly indicate readOnlyHint: true, and the action properly retrieves and returns the library with an informative summary.

components/memento_database/actions/update-entry/update-entry.mjs (2)

23-31: Good use of dependent prop definition.

The entryId prop correctly uses a function to pass libraryId for dynamic options, ensuring entries are filtered by the selected library.


39-50: LGTM!

The run function correctly parses fields, calls the update API, and provides a clear summary. Implementation is consistent with the create-entry pattern.

components/memento_database/actions/list-entries/list-entries.mjs (1)

47-62: LGTM - Clean implementation with proper pluralization.

The run function correctly passes all pagination parameters and handles singular/plural forms in the summary.

components/memento_database/sources/entry-updated/entry-updated.mjs (2)

18-19: Good filtering logic for updates only.

The isRelevant check correctly excludes newly created entries (where modifiedTime === createdTime) ensuring this source only emits genuine update events.


21-28: LGTM - Composite ID enables multiple events per entry.

Using ${entry.id}-${ts} as the event ID correctly allows the same entry to emit multiple update events over time, each with a unique identifier.

components/memento_database/memento_database.app.mjs (4)

7-20: LGTM! Well-structured dynamic options for library selection.

The libraryId prop correctly implements async options with proper null-safety using optional chaining and a fallback to an empty array. The mapping to { value, label } format follows Pipedream conventions.


21-47: LGTM! Pagination correctly implemented.

The entryId prop properly implements pagination using prevContext and nextPageToken, following Pipedream's pagination patterns. The optional chaining ensures safe access to the entries array.


70-109: LGTM! API methods follow consistent patterns.

The API client methods are well-structured with:

  • Consistent destructuring pattern for required parameters
  • Appropriate HTTP methods (GET, POST, PATCH)
  • Flexible ...opts spreading for additional request options
  • Clean path construction using template literals

The implementation follows Pipedream best practices for app files.


58-69: Authentication method is correct per Memento Database API documentation.

The Memento Database API uses query parameters for authentication token, as shown in official integration examples: params: { token: ${this.memento_database.$auth.api_token}, } The implementation correctly follows this pattern.

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

📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c31e1ef and c47732a.

📒 Files selected for processing (1)
  • components/memento_database/actions/list-entries/list-entries.mjs (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). (4)
  • GitHub Check: pnpm publish
  • GitHub Check: Lint Code Base
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (1)
components/memento_database/actions/list-entries/list-entries.mjs (1)

28-33: Past review feedback addressed.

The startRevision prop type has been correctly changed to "integer", resolving the previous review comment about type consistency with the polling sources and API expectations.

Copy link
Collaborator

@GTFalcao GTFalcao 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

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] Memento Database

4 participants