-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Canny - new components #19474
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
Canny - new components #19474
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
WalkthroughAdds a complete Canny integration: an app client with HTTP + pagination, action modules (create/get post, create comment, change post status), a parse utility, a polling base, three polling sources (comments, votes, status changes), and bumps package version to 0.7.0. Changes
Sequence Diagram(s)sequenceDiagram
participant Timer
participant Source as Polling Source
participant DB
participant CannyAPI
participant Emitter
Timer->>Source: trigger run()/deploy()
Source->>DB: _getLastTs()
Source->>CannyAPI: paginate (list* with skip/limit)
alt page has items
CannyAPI-->>Source: return page of items
Source->>Source: filter items by ts >= lastTs and isRelevant()
Source->>Emitter: emit(item, meta)
Source->>DB: _setLastTs(newest ts)
Source->>CannyAPI: fetch next page (loop)
else no items / done
CannyAPI-->>Source: no more pages
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Pre-merge checks and finishing touches❌ Failed checks (3 warnings, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
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: 9
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (11)
components/canny/actions/change-post-status/change-post-status.mjs(1 hunks)components/canny/actions/create-comment/create-comment.mjs(1 hunks)components/canny/actions/create-post/create-post.mjs(1 hunks)components/canny/actions/get-post/get-post.mjs(1 hunks)components/canny/canny.app.mjs(1 hunks)components/canny/common/utils.mjs(1 hunks)components/canny/package.json(1 hunks)components/canny/sources/common/base-polling.mjs(1 hunks)components/canny/sources/new-comment-created/new-comment-created.mjs(1 hunks)components/canny/sources/new-vote-created/new-vote-created.mjs(1 hunks)components/canny/sources/post-status-changed/post-status-changed.mjs(1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 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/canny/sources/common/base-polling.mjs
📚 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/canny/canny.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/canny/canny.app.mjs
🧬 Code graph analysis (6)
components/canny/actions/get-post/get-post.mjs (3)
components/canny/actions/change-post-status/change-post-status.mjs (1)
response(60-68)components/canny/actions/create-comment/create-comment.mjs (1)
response(65-75)components/canny/actions/create-post/create-post.mjs (1)
response(83-97)
components/canny/actions/create-comment/create-comment.mjs (3)
components/canny/actions/change-post-status/change-post-status.mjs (1)
response(60-68)components/canny/actions/create-post/create-post.mjs (1)
response(83-97)components/canny/actions/get-post/get-post.mjs (1)
response(41-48)
components/canny/sources/common/base-polling.mjs (2)
components/zep/actions/get-threads/get-threads.mjs (1)
max(39-39)components/canny/canny.app.mjs (1)
items(243-243)
components/canny/actions/create-post/create-post.mjs (1)
components/canny/common/utils.mjs (2)
parseObject(1-27)parseObject(1-27)
components/canny/actions/change-post-status/change-post-status.mjs (3)
components/canny/actions/create-comment/create-comment.mjs (1)
response(65-75)components/canny/actions/create-post/create-post.mjs (1)
response(83-97)components/canny/actions/get-post/get-post.mjs (1)
response(41-48)
components/canny/canny.app.mjs (2)
components/canny/sources/common/base-polling.mjs (3)
data(33-33)items(43-43)resourceKey(34-34)components/zep/actions/get-threads/get-threads.mjs (1)
max(39-39)
⏰ 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: Lint Code Base
- GitHub Check: pnpm publish
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
🔇 Additional comments (8)
components/canny/package.json (1)
1-18: Version bump looks consistent with new surface area.
No concerns in this file.components/canny/actions/get-post/get-post.mjs (1)
14-51: [rewritten comment]
[classification tag]components/canny/actions/create-comment/create-comment.mjs (1)
17-59: [rewritten comment]
[classification tag]components/canny/canny.app.mjs (1)
136-151: LGTM!The centralized
_makeRequestmethod correctly injectsapiKeyinto all requests and uses POST method as required by Canny's API.components/canny/common/utils.mjs (1)
12-27: LGTM!The recursive handling for arrays and objects is correctly implemented, and the null check on line 16 properly guards against
typeof null === "object".components/canny/actions/create-post/create-post.mjs (3)
4-14: LGTM!Action metadata and annotations are properly configured with appropriate hints for the action's behavior (non-destructive, open-world, read-write).
82-100: LGTM!The
runmethod correctly maps prop names to Canny's API field naming convention (e.g.,authorId→authorID) and provides a clear summary on success.
69-74: Consider parsingimageUrlslikecustomFieldsfor consistency.If users provide
imageUrlsas a JSON string (e.g., from a previous step), it won't be parsed. For consistency withcustomFieldshandling, consider usingparseObject.- imageURLs: this.imageUrls, + imageURLs: parseObject(this.imageUrls),Also applies to: 94-94
⛔ Skipped due to learnings
Learnt from: js07 Repo: PipedreamHQ/pipedream PR: 18744 File: components/slack_v2/actions/send-large-message/send-large-message.mjs:49-64 Timestamp: 2025-10-20T01:01:02.970Z Learning: In components/slack_v2/actions/send-large-message/send-large-message.mjs, the metadata_event_payload prop is typed as string, so the code only needs to handle string-to-JSON parsing and does not need to handle object inputs.
lcaresia
left a comment
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.
Hey, just one minor fix. Moving to QA.
components/canny/actions/change-post-status/change-post-status.mjs
Outdated
Show resolved
Hide resolved
For Integration QA:
|
|
Hello everyone, I have tested this PR and there're some test cases failed or needed improvement. Please check test reports below for more information:
|
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: 2
♻️ Duplicate comments (2)
components/canny/sources/common/base-polling.mjs (1)
33-68: Unbounded historical backfill and timestamp boundary issues already flagged.The issues with
processEvents()have been identified in a previous review:
run()callsprocessEvents()withoutmax, causing unbounded fetch on first poll- Using
ts >= lastTsre-emits the newest item on every poll interval- Items are emitted newest-first rather than chronological order
Please address the fix proposed in the previous review.
components/canny/sources/new-comment-created/new-comment-created.mjs (1)
37-47: Spec mismatch:postIdshould be required per linked issue.The linked issue #13310 specifies
new-comment-instantwith a requiredpost idprop. This has been flagged in a previous review.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
components/canny/sources/common/base-polling.mjs(1 hunks)components/canny/sources/new-comment-created/new-comment-created.mjs(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 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/canny/sources/common/base-polling.mjs
📚 Learning: 2024-10-08T15:33:38.240Z
Learnt from: LucBerge
Repo: PipedreamHQ/pipedream PR: 14080
File: components/nocodb/nocodb.app.mjs:133-133
Timestamp: 2024-10-08T15:33:38.240Z
Learning: When implementing pagination with an offset, incrementing `args.params.offset` within the loop ensures correct tracking of the offset, particularly when a maximum count limit (`max`) is used.
Applied to files:
components/canny/sources/common/base-polling.mjs
🧬 Code graph analysis (1)
components/canny/sources/common/base-polling.mjs (2)
components/zep/actions/get-threads/get-threads.mjs (1)
max(39-39)components/canny/canny.app.mjs (1)
items(243-243)
⏰ 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: Verify TypeScript components
- GitHub Check: Publish TypeScript components
🔇 Additional comments (3)
components/canny/sources/common/base-polling.mjs (2)
17-32: Helper methods and default implementations look good.The timestamp tracking via
db.get/db.set, defaultgetData()returning empty object,getTsField()returning"created"(matching Canny API), andisRelevant()defaulting totrueare appropriate patterns for a base polling component.
69-77: Abstract method stubs are correctly implemented.Using
ConfigurationErrorto enforce implementation in subclasses is the correct pattern for Pipedream components.components/canny/sources/new-comment-created/new-comment-created.mjs (1)
49-64: Resource methods are correctly implemented.The
getResourceFn,getData, andgetResourceKeyimplementations properly integrate with the base polling component and correctly map prop names to Canny API field names.
|
Hi everyone, all test cases are passed! Ready for release! Test reports
|
|
/approve |
lcaresia
left a comment
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.
LGTM!
Resolves #13310
Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.