Skip to content

[Components] nextdoor - new action components #15306

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jcortes
Copy link
Collaborator

@jcortes jcortes commented Jan 15, 2025

WHY

Resolves #15251

Summary by CodeRabbit

Release Notes for Nextdoor Integration

  • New Features

    • Added comprehensive support for Nextdoor advertising platform interactions
    • Introduced capabilities to create advertisers, campaigns, ad groups, ads, and scheduled reports
    • Implemented new methods for managing advertising resources
  • Improvements

    • Enhanced API interaction methods
    • Added dynamic data retrieval for various advertising components
    • Improved platform integration with new property definitions
  • Version Update

    • Upgraded package version from 0.0.1 to 0.1.0

@jcortes jcortes added the action New Action Request label Jan 15, 2025
@jcortes jcortes self-assigned this Jan 15, 2025
Copy link

vercel bot commented Jan 15, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Ignored (Inspect) Visit Preview Apr 24, 2025 7:14pm
pipedream-docs ⬜️ Ignored (Inspect) Apr 24, 2025 7:14pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Apr 24, 2025 7:14pm

Copy link
Contributor

coderabbitai bot commented Jan 15, 2025

Walkthrough

This pull request introduces a comprehensive set of Nextdoor advertising components, including modules for creating advertisers, campaigns, ad groups, ads, and scheduled reports. The implementation provides a structured approach to interacting with the Nextdoor Advertising Manager (NAM) API, with each module designed to handle specific resource creation tasks. The changes include defining properties, methods for API interactions, and supporting utility functions in the Nextdoor application configuration.

Changes

File Change Summary
components/nextdoor/actions/create-advertiser/create-advertiser.mjs New module for creating Nextdoor advertisers
components/nextdoor/actions/create-campaign/create-campaign.mjs New module for creating advertising campaigns
components/nextdoor/actions/create-ad-group/create-ad-group.mjs New module for creating ad groups
components/nextdoor/actions/create-ad/create-ad.mjs New module for creating ads
components/nextdoor/actions/create-scheduled-report/create-scheduled-report.mjs New module for creating scheduled reports
components/nextdoor/common/constants.mjs Added DEFAUL_LIMIT constant
components/nextdoor/nextdoor.app.mjs Expanded prop definitions and added new API interaction methods
components/nextdoor/package.json Updated version and added platform dependency

Assessment against linked issues

Objective Addressed Explanation
Create Advertiser [#15251]
Create Campaign [#15251]
Create Ad Group [#15251]
Create Ad [#15251]
Create Scheduled Report [#15251]

Suggested Labels

user submitted

Suggested Reviewers

  • michelle0927

Poem

🐰 Nextdoor's digital dance begins,
Ads and campaigns, where marketing wins!
API calls leap with graceful might,
Connecting neighbors, pixel-bright!
A rabbit's code, precise and keen,
Brings advertising's vibrant scene! 🚀


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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

Documentation and Community

  • 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: 13

🧹 Nitpick comments (2)
components/nextdoor/nextdoor.app.mjs (1)

91-99: Improve date input validation for startTime and endTime

The startTime and endTime properties expect a ZonedDateTime format, which might be complex for users to input correctly. Consider using a date-time picker or validating the input format to improve user experience and prevent errors.

Also applies to: 96-99

components/nextdoor/actions/create-ad-group/create-ad-group.mjs (1)

47-51: Consider adding bid amount validation.

The bid amount should be validated to ensure it meets minimum requirements and follows the correct format.

     bid: {
       type: "object",
       label: "Bid",
       description: "The bid for the ad group.",
+      validate: (value) => {
+        if (!value.amount?.startsWith('USD ')) {
+          throw new Error('Bid amount must start with "USD "');
+        }
+        const amount = parseFloat(value.amount.replace('USD ', ''));
+        if (isNaN(amount) || amount <= 0) {
+          throw new Error('Invalid bid amount');
+        }
+        return true;
+      },
       default: {
         amount: "USD 10",
         pricing_type: "CPM",
       },
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f7ecf2a and 6f243ff.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • components/nextdoor/actions/create-ad-group/create-ad-group.mjs (1 hunks)
  • components/nextdoor/actions/create-ad/create-ad.mjs (1 hunks)
  • components/nextdoor/actions/create-advertiser/create-advertiser.mjs (1 hunks)
  • components/nextdoor/actions/create-campaign/create-campaign.mjs (1 hunks)
  • components/nextdoor/actions/create-scheduled-report/create-scheduled-report.mjs (1 hunks)
  • components/nextdoor/common/constants.mjs (1 hunks)
  • components/nextdoor/nextdoor.app.mjs (1 hunks)
  • components/nextdoor/package.json (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: pnpm publish
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base
  • GitHub Check: Publish TypeScript components
🔇 Additional comments (5)
components/nextdoor/nextdoor.app.mjs (2)

241-246: Verify the authentication token property

In the getHeaders method, you're accessing this.$auth.authorization_token. Please ensure that authorization_token is the correct property provided by the authentication setup. Depending on the authentication configuration, it might need to be this.$auth.oauth_access_token or another appropriate property.


247-255: ⚠️ Potential issue

Review assignment of $ in _makeRequest method

In the _makeRequest method, assigning $ = this may lead to unintended behavior since $ typically represents the execution context. Consider removing the default assignment to ensure the correct context is used.

Apply this diff to correct the assignment:

-_makeRequest({
-  $ = this, path, headers, ...args
-} = {}) {
+_makeRequest({
+  $, path, headers, ...args
+} = {}) {

Likely invalid or redundant comment.

components/nextdoor/actions/create-campaign/create-campaign.mjs (1)

1-59: Well-structured implementation of create-campaign action

The create-campaign action is implemented correctly with clear code structure and proper use of methods and properties. The use of destructuring and method definitions aligns with best practices.

components/nextdoor/package.json (2)

3-3: Version bump aligns with new features.

The version increment from 0.0.1 to 0.1.0 correctly follows semantic versioning for the addition of new advertising components.


15-16: Verify @pipedream/platform version compatibility.

The dependency on @pipedream/platform uses a caret range (^3.0.3) which allows compatible updates. Let's verify this version against current recommendations.

✅ Verification successful

@pipedream/platform version ^3.0.3 is appropriate

The dependency is using the latest available version (3.0.3) with a caret range, which matches current standards across recently updated components in the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check latest @pipedream/platform version and its usage across components

# Check the latest version of @pipedream/platform
npm view @pipedream/platform version

# Check platform versions used across other components
fd package.json components -x grep -l "@pipedream/platform" {} \; -x grep -A 1 "@pipedream/platform" {}

Length of output: 65740

@jcortes jcortes force-pushed the nextdoor-new-lead-instant-source branch from 6f243ff to aca6e93 Compare April 9, 2025 20:57
@jcortes jcortes force-pushed the nextdoor-new-lead-instant-source branch 2 times, most recently from 886e129 to 81c4ad1 Compare April 24, 2025 16:29
@jcortes jcortes force-pushed the nextdoor-new-lead-instant-source branch from 81c4ad1 to 431e2e1 Compare April 24, 2025 19:14
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.

Hi @jcortes , I have a few suggestions (not sure if they are feasible, depends on the app specifications). Please take a look at them before we move this forward

frequencyCaps: {
type: "string[]",
label: "Frecuency Caps",
description: "The frecuency caps for the ad group. Where `max_impressions`, `num_timeunits`, and `timeunit` are required. Eligible `timeunit` values are `MINUTE`, `MINUTES`, `HOUR`, `HOURS`, `DAY`, `DAYS`, `WEEK`, `WEEKS`, `MONTH`, `MONTHS`.",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't this be spelled frequency in the label and description?

Is it possible to split this into an individual prop for each of 'max impressions', 'num_timeunits' and 'timeunits'? Or can the object have more properties than these three?

type: "object",
label: "Budget",
description: "The budget for the ad group. Both `amount` and `budget_type` properties are required.",
default: {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it possible to split this into two props (Budget Amount and Budget Type) or can the object have more properties?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action New Action Request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Components] nextdoor
2 participants