Skip to content

feat(social_fetch): add 4 reddit actions#21312

Open
michelle0927 wants to merge 3 commits into
masterfrom
issue-21276-social-fetch
Open

feat(social_fetch): add 4 reddit actions#21312
michelle0927 wants to merge 3 commits into
masterfrom
issue-21276-social-fetch

Conversation

@michelle0927

@michelle0927 michelle0927 commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Resolves #21276

Summary by CodeRabbit

  • New Features

    • Added Reddit capabilities: fetch subreddit details, list subreddit posts, list post comments, and retrieve post transcripts.
    • Added filtering options for sort order, timeframe, cursor, and transcript language.
    • Added smarter subreddit input handling and automatic truncation of long result lists (up to 10 items) for easier viewing.
  • Chores

    • Updated versions for the Social Fetch package and related actions.

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 277c7cf4-864f-40d9-9b2f-4b803818d531

📥 Commits

Reviewing files that changed from the base of the PR and between 8be94cf and b5f07b1.

📒 Files selected for processing (7)
  • components/social_fetch/actions/get-reddit-post-transcript/get-reddit-post-transcript.mjs
  • components/social_fetch/actions/get-subreddit/get-subreddit.mjs
  • components/social_fetch/actions/list-reddit-post-comments/list-reddit-post-comments.mjs
  • components/social_fetch/actions/list-subreddit-posts/list-subreddit-posts.mjs
  • components/social_fetch/common/routing.mjs
  • components/social_fetch/common/utils.mjs
  • components/social_fetch/social_fetch.app.mjs

📝 Walkthrough

Walkthrough

This PR adds Reddit support to the social_fetch component by introducing shared Reddit helpers, new app props and API methods, four Reddit actions, and version bumps for existing actions, a source, and the package.

Changes

Social Fetch Reddit Support

Layer / File(s) Summary
Shared Reddit helpers
components/social_fetch/common/constants.mjs, components/social_fetch/common/routing.mjs, components/social_fetch/common/utils.mjs
Adds Reddit sort/timeframe option constants, subreddit normalization, and truncateArrays(data, max).
App props and Reddit API methods
components/social_fetch/social_fetch.app.mjs
Extends prop definitions with Reddit inputs and adds getSubreddit, listSubredditPosts, listPostComments, and getPostTranscript.
New Reddit actions
components/social_fetch/actions/get-subreddit/get-subreddit.mjs, components/social_fetch/actions/list-subreddit-posts/list-subreddit-posts.mjs, components/social_fetch/actions/list-reddit-post-comments/list-reddit-post-comments.mjs, components/social_fetch/actions/get-reddit-post-transcript/get-reddit-post-transcript.mjs
Adds four actions that call the new app methods and, where applicable, truncate response arrays.
Version bumps
components/social_fetch/actions/get-credit-balance/..., get-post/..., get-profile/..., get-transcript/..., list-profile-posts/..., sources/new-profile-update/..., components/social_fetch/package.json
Bumps existing action/source versions and the package version.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Action
  participant SocialFetchApp
  participant RedditAPI
  Action->>SocialFetchApp: getSubreddit / listSubredditPosts / listPostComments / getPostTranscript
  SocialFetchApp->>RedditAPI: GET /v1/reddit/... with query params
  RedditAPI-->>SocialFetchApp: response data
  SocialFetchApp-->>Action: response
Loading

Possibly related PRs

Suggested labels: User submitted

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description only says 'Resolves #21276' and omits the required summary and checklist details from the template. Add a Summary section and complete the checklist items for versioning, app integration, and CodeRabbit review acknowledgements.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: adding four Reddit actions to social_fetch.
Linked Issues check ✅ Passed The PR adds the Reddit actions and supporting app methods requested by #21276, matching the documented endpoints.
Out of Scope Changes check ✅ Passed The supporting constants and utility functions appear to serve the new Reddit actions, so no clear unrelated changes stand out.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-21276-social-fetch

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.

@vercel

vercel Bot commented Jul 2, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
pipedream-docs-redirect-do-not-edit Ignored Ignored Jul 2, 2026 4:59pm

Request Review

@michelle0927 michelle0927 marked this pull request as ready for review July 2, 2026 16:34

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@components/social_fetch/actions/get-subreddit/get-subreddit.mjs`:
- Line 6: The Reddit action descriptions are too minimal and should be expanded
for agent use across all four new actions, including getSubreddit in
get-subreddit.mjs and the other Reddit action definitions in this PR. Update
each action’s description to add when-to-use guidance, brief parameter format
notes (especially accepted subreddit and URL forms), and a cross-reference to
related actions such as List Subreddit Posts so the agent can choose the right
tool more reliably. Keep the doc link, but make the description more
task-oriented and explicit in the action metadata.

In `@components/social_fetch/common/utils.mjs`:
- Around line 12-17: The truncation notice in the Object.keys(data) loop is
being overwritten each time another array field exceeds max, so only the last
truncated field is recorded. Update the logic in the truncation utility in
utils.mjs to accumulate notices instead of assigning data._truncated on every
iteration, and preserve existing messages when multiple array properties are
sliced.

In `@components/social_fetch/social_fetch.app.mjs`:
- Around line 125-139: The `sort` and `timeframe` prop descriptions in
`social_fetch.app.mjs` only point to the options arrays, so update those
descriptions to explicitly list the allowed enum values inline. Use the existing
`SUBREDDIT_POST_SORT_OPTIONS` and `SUBREDDIT_POST_TIMEFRAME_OPTIONS` definitions
to reflect the concrete values in the `sort` and `timeframe` fields so AI agents
can see examples like the valid sort and timeframe strings directly in the text.
- Around line 112-117: `listSubredditPosts` is using the raw `subreddit` input
in the request path, so the documented `r/`-prefixed and full Reddit URL forms
break the API call. Normalize the value inside `listSubredditPosts` before
constructing `/v1/reddit/subreddits/.../posts` by trimming, extracting the
subreddit name from `r/...` or `https://www.reddit.com/r/...`, and then encoding
only the canonical subreddit segment; keep the `subreddit` prop contract in sync
with the normalization behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5c185984-8c6e-4a7e-8f2d-5672ec2deb81

📥 Commits

Reviewing files that changed from the base of the PR and between d346113 and 8be94cf.

📒 Files selected for processing (14)
  • components/social_fetch/actions/get-credit-balance/get-credit-balance.mjs
  • components/social_fetch/actions/get-post/get-post.mjs
  • components/social_fetch/actions/get-profile/get-profile.mjs
  • components/social_fetch/actions/get-reddit-post-transcript/get-reddit-post-transcript.mjs
  • components/social_fetch/actions/get-subreddit/get-subreddit.mjs
  • components/social_fetch/actions/get-transcript/get-transcript.mjs
  • components/social_fetch/actions/list-profile-posts/list-profile-posts.mjs
  • components/social_fetch/actions/list-reddit-post-comments/list-reddit-post-comments.mjs
  • components/social_fetch/actions/list-subreddit-posts/list-subreddit-posts.mjs
  • components/social_fetch/common/constants.mjs
  • components/social_fetch/common/utils.mjs
  • components/social_fetch/package.json
  • components/social_fetch/social_fetch.app.mjs
  • components/social_fetch/sources/new-profile-update/new-profile-update.mjs

Comment thread components/social_fetch/actions/get-subreddit/get-subreddit.mjs Outdated
Comment thread components/social_fetch/common/utils.mjs
Comment thread components/social_fetch/social_fetch.app.mjs
Comment thread components/social_fetch/social_fetch.app.mjs
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.

[ACTION] Social Fetch: Reddit actions

1 participant