Skip to content

Conversation

@michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Sep 3, 2025

Resolves #18081

Summary by CodeRabbit

  • New Features

    • Microsoft 365 Planner: Added “New Task Assigned to User” trigger that emits an event whenever a task is assigned to you, enabling automated workflows based on new assignments.
  • Chores

    • Bumped component version to 0.3.0.
    • Upgraded platform dependency for improved compatibility and stability.

@vercel
Copy link

vercel bot commented Sep 3, 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 Sep 3, 2025 9:32pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Sep 3, 2025 9:32pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 3, 2025

Walkthrough

Adds a new Microsoft 365 Planner event source that emits events for tasks assigned to the authenticated user. Updates the package version to 0.3.0 and bumps the @pipedream/platform dependency to ^3.1.0 in the Microsoft 365 Planner component.

Changes

Cohort / File(s) Summary of Changes
Component metadata update
components/microsoft_365_planner/package.json
Version updated 0.2.0 → 0.3.0. Dependency @pipedream/platform updated ^1.6.5 → ^3.1.0.
New trigger: Task assigned to user
components/microsoft_365_planner/sources/new-task-assigned-to-user/new-task-assigned-to-user.mjs
Adds new source that lists user tasks via Microsoft Graph, paginates results, and emits events with unique dedupe. Includes generateMeta and run implementation.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant SR as Source Runner
  participant MP as Microsoft 365 Planner API
  participant EM as Event Emitter

  Note over SR: Scheduled/Invoked run
  SR->>SR: getResourceFn() / getArgs()
  SR->>MP: listUserTasks(args)
  loop Paginate tasks
    MP-->>SR: Page of tasks (async iterator)
    SR->>EM: emitEvent(task)\n(id, summary, ts)
  end

  Note over SR,EM: Dedupe: unique by task.id
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Assessment against linked issues

Objective Addressed Explanation
Implement trigger for Microsoft Planner: “When task is assigned to me” (#18081)
Include relevant API docs link for the trigger (#18081)

Assessment against linked issues: Out-of-scope changes

(none)

Poem

I thump my paws—new tasks appear,
A Planner breeze, assignments near.
I sniff the queue, emit with glee,
Each tidy hop: event set free.
With version bumped and deps in line,
I chase the tasks—unique by design. 🐇✨

✨ 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-18081

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 or @coderabbit 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: 1

🧹 Nitpick comments (3)
components/microsoft_365_planner/sources/new-task-assigned-to-user/new-task-assigned-to-user.mjs (3)

12-18: Consider exposing args for paging and filtering (optional).

If the API supports $top / $select or plan/bucket scoping, exposing them via props or getArgs can reduce API load and user noise.


27-38: Optional: avoid initial backfill flood; emit only “newly assigned since install”.

Today, unique-by-id will emit all existing assigned tasks on first run. Add an opt-out prop (e.g., emitOnStart: false) and skip items older than the first run’s checkpoint based on the assigned timestamp.

Example (assuming this.db is available via common):

 export default {
   ...common,
   key: "microsoft_365_planner-new-task-assigned-to-user",
@@
   methods: {
     ...common.methods,
@@
   },
   async run() {
+    const now = Date.now();
+    const firstRun = !this.db.get("initialized");
+    if (firstRun) this.db.set("initialized", true);
+
     const fn = this.getResourceFn();
     const args = this.getArgs();
     const items = this.microsoft365Planner.paginate({
       fn,
       args,
     });
 
     for await (const item of items) {
-      this.emitEvent(item);
+      const ts = this.getAssignedTs(item);
+      if (!firstRun || this.emitOnStart) this.emitEvent(item);
+      else if (ts >= now) this.emitEvent(item); // only assignments observed after install
     }
   },

If you’d like, I can wire up the emitOnStart boolean prop and update the docs.


30-33: Minor: consider passing a page size (if supported) to paginate.

Helps control runtime and rate limiting for orgs with many tasks.

📜 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 6aeaea6 and ac00a10.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • components/microsoft_365_planner/package.json (2 hunks)
  • components/microsoft_365_planner/sources/new-task-assigned-to-user/new-task-assigned-to-user.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 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/microsoft_365_planner/package.json
⏰ 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: Verify TypeScript components
  • GitHub Check: Lint Code Base
  • GitHub Check: Publish TypeScript components
🔇 Additional comments (3)
components/microsoft_365_planner/package.json (2)

3-3: Version bump looks good.

Increment to 0.3.0 matches the addition of a new public source.


16-16: @pipedream/platform v3.1.0 compatibility verified. Code uses only v3 APIs (this.$emit, this.db.get/set, timer interfaces, DEFAULT_POLLING_SOURCE_TIMER_INTERVAL); no ^1.x pins remain.

components/microsoft_365_planner/sources/new-task-assigned-to-user/new-task-assigned-to-user.mjs (1)

7-7: Description and docs link LGTM.

Accurately describes the trigger and links to the correct Graph endpoint doc.

@vunguyenhung vunguyenhung merged commit 5e31cad into master Sep 6, 2025
10 checks passed
@vunguyenhung vunguyenhung deleted the issue-18081 branch September 6, 2025 08:33
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.

[TRIGGER] Microsoft Planner

4 participants