Skip to content

Conversation

@michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Aug 7, 2025

Resolves #17486

Summary by CodeRabbit

  • New Features

    • Introduced a new source to emit events for new baseball league transactions in Yahoo Fantasy Sports, with options to filter by event types and customizable polling intervals.
  • Improvements

    • Enhanced league selection to support different sports by allowing dynamic game key selection when retrieving league options.
  • Chores

    • Updated package and dependency versions for improved compatibility.
    • Incremented version number for the football league transactions source.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 7, 2025

Walkthrough

A new "New Baseball League Transactions" source was added for Yahoo Fantasy Sports, emitting events for new baseball league transactions. The league options logic was generalized to support different sports (not just NFL). Dependency and version updates were made to relevant files, and the football trigger's version was incremented.

Changes

Cohort / File(s) Change Summary
New Baseball League Transactions Source
components/yahoo_fantasy_sports/sources/new-baseball-league-transactions/new-baseball-league-transactions.mjs
Added a new source that emits events for new baseball league transactions, with configurable event filtering and polling.
League Options Generalization
components/yahoo_fantasy_sports/yahoo_fantasy_sports.app.mjs
Modified league prop and helper to accept a gameKey, supporting leagues beyond NFL (e.g., MLB).
Package and Dependency Updates
components/yahoo_fantasy_sports/package.json
Updated package version to 0.4.0 and upgraded @pipedream/platform dependency to ^3.1.0.
Football Transactions Source Version Bump
components/yahoo_fantasy_sports/sources/new-football-league-transactions/new-football-league-transactions.mjs
Incremented version from 0.0.3 to 0.0.4 in metadata only.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Source (New Baseball League Transactions)
    participant YahooFantasySportsApp
    participant Yahoo API

    User->>Source (New Baseball League Transactions): Configure source (select MLB league, event types)
    Source (New Baseball League Transactions)->>YahooFantasySportsApp: getLeagueOptions(gameKey="mlb")
    YahooFantasySportsApp->>Yahoo API: Fetch leagues for MLB
    Yahoo API-->>YahooFantasySportsApp: Return league options
    YahooFantasySportsApp-->>Source (New Baseball League Transactions): Return league options
    Source (New Baseball League Transactions)->>YahooFantasySportsApp: Fetch transactions for league (filtered by event types)
    YahooFantasySportsApp->>Yahoo API: API request for transactions
    Yahoo API-->>YahooFantasySportsApp: Return transactions
    YahooFantasySportsApp-->>Source (New Baseball League Transactions): Return transactions
    Source (New Baseball League Transactions)->>User: Emit event for each new transaction
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Assessment against linked issues

Objective Addressed Explanation
Add a trigger for Yahoo Fantasy Baseball transactions (similar to football trigger) (#17486)
Generalize league selection logic to support MLB for the new baseball trigger (#17486)
Ensure event emission for new baseball league transactions (#17486)

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes found.

Poem

A rabbit hopped through fields of code,
Bringing baseball leagues to the fantasy road.
With triggers anew and options that flex,
Now MLB joins the eventful complex!
So let the games and reviews commence—
This bunny’s work is pure suspense! 🐇⚾

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 00f9529 and 9d71436.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • components/yahoo_fantasy_sports/package.json (2 hunks)
  • components/yahoo_fantasy_sports/sources/new-baseball-league-transactions/new-baseball-league-transactions.mjs (1 hunks)
  • components/yahoo_fantasy_sports/sources/new-football-league-transactions/new-football-league-transactions.mjs (1 hunks)
  • components/yahoo_fantasy_sports/yahoo_fantasy_sports.app.mjs (2 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 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/yahoo_fantasy_sports/package.json
📚 Learning: 2024-10-10T19:18:27.998Z
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#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/yahoo_fantasy_sports/sources/new-baseball-league-transactions/new-baseball-league-transactions.mjs
📚 Learning: 2025-01-23T03:55:15.166Z
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#15376
File: components/monday/sources/name-updated/name-updated.mjs:6-6
Timestamp: 2025-01-23T03:55:15.166Z
Learning: Source names in Monday.com components don't need to start with "New" if they emit events for updated items (e.g., "Name Updated", "Column Value Updated") rather than new items. This follows the component guidelines exception where the "New" prefix is only required when emits are limited to new items.

Applied to files:

  • components/yahoo_fantasy_sports/sources/new-baseball-league-transactions/new-baseball-league-transactions.mjs
🧬 Code Graph Analysis (1)
components/yahoo_fantasy_sports/sources/new-baseball-league-transactions/new-baseball-league-transactions.mjs (1)
components/yahoo_fantasy_sports/sources/new-football-league-transactions/new-football-league-transactions.mjs (2)
  • eventTypes (40-42)
  • transactions (44-44)
⏰ 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 (10)
components/yahoo_fantasy_sports/sources/new-football-league-transactions/new-football-league-transactions.mjs (1)

9-9: LGTM: Version bump is appropriate.

The version increment aligns with the package version update and reflects the underlying changes to the app's league options handling.

components/yahoo_fantasy_sports/package.json (2)

3-3: LGTM: Appropriate version bump for new feature.

The minor version increment to 0.4.0 correctly reflects the addition of the new baseball league transactions source.


17-17: Verify compatibility with @pipedream/platform v3.1.0
We upgraded from ^1.2.0 to ^3.1.0 but the codebase imports dozens of APIs (axios, ConfigurationError, DEFAULT_POLLING_SOURCE_TIMER_INTERVAL, getFileStreamAndMetadata, sqlProxy, etc.) across nearly every component under components/*. Please:

  • Review the official v3.x migration guide or changelog for any breaking changes to these exports.
  • Spot-check key components (e.g. components/yahoo_fantasy_sports/yahoo_fantasy_sports.app.mjs) to confirm their imports still exist in v3.1.0.
  • Ensure any renamed or removed functions are updated throughout the codebase.
components/yahoo_fantasy_sports/yahoo_fantasy_sports.app.mjs (2)

13-15: LGTM: Well-implemented generalization of league options.

The parameter destructuring with default value maintains backward compatibility while enabling support for different game keys. The implementation correctly passes the gameKey to the underlying method.


62-64: LGTM: Proper API path generalization.

The dynamic game key implementation correctly replaces the hardcoded "nfl" with a parameterized approach while maintaining the "nfl" default for backward compatibility.

components/yahoo_fantasy_sports/sources/new-baseball-league-transactions/new-baseball-league-transactions.mjs (5)

1-11: LGTM: Proper component structure and metadata.

The imports, component key, name, and description are correctly configured for the baseball league transactions source. The version 0.0.1 is appropriate for a new component.


14-22: LGTM: Correct league configuration for baseball.

The league prop definition properly specifies "mlb" as the gameKey, which will fetch MLB league options through the generalized app method. The prop definition structure matches the established pattern.


23-41: LGTM: Consistent event types and timer configuration.

The eventTypes and timer props are identical to the football source, providing consistent user experience across different sports sources.


42-60: LGTM: Appropriate code reuse from football source.

The run method logic is correctly reused from the football source. This consistency ensures reliable behavior across both sports sources and reduces maintenance burden.


18-20: Confirmed valid game key for MLB

The gameKey: "mlb" is correct—Yahoo’s API accepts the game_code “mlb” to reference Major League Baseball and will map it to the current game_id. No changes needed.

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

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.
    • Explain this complex logic.
    • 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 explain this code block.
  • 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 explain its main purpose.
    • @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 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.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @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.

@vercel
Copy link

vercel bot commented Aug 7, 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) Aug 7, 2025 5:24pm
pipedream-docs ⬜️ Ignored (Inspect) Aug 7, 2025 5:24pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Aug 7, 2025 5:24pm

Copy link
Collaborator

@luancazarine luancazarine 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 55a33fa into master Aug 8, 2025
11 checks passed
@vunguyenhung vunguyenhung deleted the issue-17486 branch August 8, 2025 02: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] Yahoo Fantasy Baseball

4 participants