Skip to content

Conversation

@michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Aug 20, 2025

Resolves #18070

Summary by CodeRabbit

  • New Features

    • Added actions to list all Gmail “Send As” aliases for the signed-in account.
    • Added an action to retrieve details for a specific “Send As” alias.
    • The “Send As Email” field now offers selectable options from your available aliases.
  • Chores

    • Bumped Gmail component version to 1.3.0.

@vercel
Copy link

vercel bot commented Aug 20, 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 20, 2025 7:45pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Aug 20, 2025 7:45pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 20, 2025

Walkthrough

Adds two new Gmail actions to list and retrieve Send-As aliases via the Gmail API, and bumps the Gmail component version to 1.3.0.

Changes

Cohort / File(s) Summary of Changes
Gmail Send-As actions
components/gmail/actions/list-send-as-aliases/list-send-as-aliases.mjs, components/gmail/actions/get-send-as-alias/get-send-as-alias.mjs
Introduces two action modules: one lists all Send-As aliases using gmail.listSignatures(), another retrieves a specific Send-As alias using users.settings.sendAs.get. Both export summaries and return API data.
Package metadata
components/gmail/package.json
Version bumped from 1.2.0 to 1.3.0.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant U as User/Workflow
  participant A as Action: List Send-As
  participant G as Gmail App
  participant API as Gmail API

  U->>A: Run action
  A->>G: listSignatures({ $ })
  G->>API: GET users.settings.sendAs.list
  API-->>G: sendAs[]
  G-->>A: { sendAs, ... }
  A-->>U: Response (exports summary with count)
  note over A,U: Summarizes number of aliases
Loading
sequenceDiagram
  autonumber
  participant U as User/Workflow
  participant A as Action: Get Send-As
  participant G as Gmail App
  participant API as Gmail API

  U->>A: Run with sendAsEmail
  A->>G: _client().users.settings.sendAs.get({ userId, sendAsEmail })
  G->>API: GET users/{userId}/settings/sendAs/{sendAsEmail}
  API-->>G: alias data
  G-->>A: { data }
  A-->>U: Alias data (exports success summary)
  note over A: Options for sendAsEmail populated via listSignatures()
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Assessment against linked issues

Objective Addressed Explanation
Implement GET users/{userId}/settings/sendAs/{sendAsEmail} (#18070)
Implement list users/{userId}/settings/sendAs (#18070)

Poem

A twitch of whiskers, ears held high,
I fetched your aliases swift and spry—
One hop to list, one hop to get,
Gmail burrows? Mapped, you bet!
Now every From is neat and terse,
Signed, a rabbit—guardian of your verse. 🐇✉️

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-18070

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

🧹 Nitpick comments (4)
components/gmail/package.json (1)

15-25: Optional: Update Gmail client & auth library versions

The script check shows you’re currently on:

  • @googleapis/gmail at ^13.0.1 (latest is 14.0.1)
  • google-auth-library at ^8.7.0 (latest is 10.2.1)

No peerDependencies or compatibility issues were reported for the newest releases. To reduce the risk of auth regressions in future actions, consider:

  • Bumping "@googleapis/gmail" to ^14.0.1
  • Bumping "google-auth-library" to ^10.2.1
  • Running your full test suite (and any integration tests) to verify nothing breaks
components/gmail/actions/list-send-as-aliases/list-send-as-aliases.mjs (1)

13-20: Guard against undefined response and improve summary/return ergonomics

If the API returns no sendAs field, the summary renders “undefined”. Also, returning the array directly is often more ergonomic for step outputs (callers can iterate without drilling into response.sendAs). Not required, but improves DX.

Apply:

   async run({ $ }) {
-    const response = await this.gmail.listSignatures({
-      $,
-    });
-
-    $.export("$summary", `Successfully retrieved ${response.sendAs?.length} send as aliases`);
-
-    return response;
+    const response = await this.gmail.listSignatures({ $ });
+    const items = response?.sendAs ?? [];
+    $.export("$summary", `Successfully retrieved ${items.length} send-as aliases`);
+    // Return the array for convenience; keep full response under meta if needed.
+    return items;
   },
components/gmail/actions/get-send-as-alias/get-send-as-alias.mjs (2)

22-31: Add friendly error handling and a more descriptive summary

Surface 404 / not-found with context, and include the alias in the success summary.

Apply:

   async run({ $ }) {
-    const { data } = await this.gmail._client().users.settings.sendAs.get({
-      userId: constants.USER_ID,
-      sendAsEmail: this.sendAsEmail,
-    });
-
-    $.export("$summary", "Successfully retrieved send as alias");
-
-    return data;
+    try {
+      const { data } = await this.gmail._client().users.settings.sendAs.get({
+        userId: constants.USER_ID,
+        sendAsEmail: this.sendAsEmail,
+      });
+      $.export("$summary", `Successfully retrieved send-as alias: ${data?.sendAsEmail ?? this.sendAsEmail}`);
+      return data;
+    } catch (err) {
+      if (err?.code === 404) {
+        throw new Error(`Send-as alias not found: ${this.sendAsEmail}`);
+      }
+      throw err;
+    }
   },

4-21: Optional: consider reusing a propDefinition for sendAsEmail

If other actions will reference send-as aliases, centralizing the dynamic options as a propDefinition in gmail.app.mjs (e.g., propDefinitions.sendAsEmail) reduces duplication and keeps behavior consistent across actions.

📜 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 cb0ee6f and c54ff1c.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • components/gmail/actions/get-send-as-alias/get-send-as-alias.mjs (1 hunks)
  • components/gmail/actions/list-send-as-aliases/list-send-as-aliases.mjs (1 hunks)
  • components/gmail/package.json (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: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (3)
components/gmail/package.json (1)

3-3: Semver bump looks correct for new actions

Adding user-facing actions justifies a minor bump from 1.2.0 → 1.3.0. LGTM.

components/gmail/actions/list-send-as-aliases/list-send-as-aliases.mjs (1)

1-11: Action metadata is clear and consistent

Key, name, description link, and props shape match existing conventions for Pipedream Gmail actions. Import path to gmail.app.mjs also looks correct.

components/gmail/actions/get-send-as-alias/get-send-as-alias.mjs (1)

1-3: USER_ID and OAuth Scope Verification Complete

I have confirmed that:

  • constants.USER_ID is defined as "me" in components/gmail/common/constants.mjs and is consistently used across all Gmail actions (e.g., listMessages, getMessage, listSignatures, and the new get-send-as-alias action).
  • The Gmail OAuth scopes include https://www.googleapis.com/auth/gmail.settings.basic in the _serviceAccountAuth method of components/gmail/gmail.app.mjs (lines 522–524), and the README setup instructions also list this scope.

No further changes are required.

Copy link
Collaborator

@jcortes jcortes left a comment

Choose a reason for hiding this comment

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

Hi @michelle0927 lgtm! Ready for QA!

@vunguyenhung vunguyenhung merged commit d66263d into master Aug 21, 2025
10 checks passed
@vunguyenhung vunguyenhung deleted the issue-18070 branch August 21, 2025 01:43
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.

Gmail

4 participants