Skip to content

Conversation

olgabot
Copy link
Contributor

@olgabot olgabot commented Oct 29, 2024

WHY

As mentioned (#14358), Seqera "runs" turns out to be named "workflows" in the API (unlike "runs", which I called them in my original request #10142). The Seqera Pipedream app needs to call /workflows in the API, while specifying the workspace ID with workspaceId. From my testing, If workspaceId is not specified, then no workflow runs are returned, so workspaceId is required, and I think should be specified when creating the integration, kind of like with Notion, you specify which databases the integration has access to.

getResourcesFn in components/seqera/sources/new-run-created/new-run-created.mjs also needs to be updated to listWorkflows:

Let me know how I can help!

Summary by CodeRabbit

  • New Features

    • The method for retrieving workflows has been updated and renamed from listRuns to listWorkflows, enhancing clarity in functionality.
    • The API endpoint has been changed to align with updated specifications, requiring a workspaceId for workflow retrieval.
    • New property workspaceId added to support event emission for new workflows.
  • Bug Fixes

    • Adjustments made to ensure proper invocation of the workflow retrieval method with the new parameters.
    • Metadata generation for new workflows updated to reflect the new resource type and timestamping method.
  • Chores

    • Version numbers updated across various components to reflect the latest changes.

Copy link

vercel bot commented Oct 29, 2024

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

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Oct 30, 2024 3:44pm

Copy link

vercel bot commented Oct 29, 2024

@olgabot is attempting to deploy a commit to the Pipedreamers Team on Vercel.

A member of the Team first needs to authorize it.

@dylburger dylburger added the User submitted Submitted by a user label Oct 29, 2024
@pipedream-component-development
Copy link
Collaborator

Thank you so much for submitting this! We've added it to our backlog to review, and our team has been notified.

@pipedream-component-development
Copy link
Collaborator

Thanks for submitting this PR! When we review PRs, we follow the Pipedream component guidelines. If you're not familiar, here's a quick checklist:

Copy link
Contributor

coderabbitai bot commented Oct 29, 2024

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

📥 Commits

Reviewing files that changed from the base of the PR and between 7d5586d and d49694f.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (6)
  • components/seqera/actions/create-action/create-action.mjs (1 hunks)
  • components/seqera/actions/create-compute-environment/create-compute-environment.mjs (1 hunks)
  • components/seqera/actions/create-pipeline/create-pipeline.mjs (1 hunks)
  • components/seqera/package.json (2 hunks)
  • components/seqera/seqera.app.mjs (3 hunks)
  • components/seqera/sources/new-run-created/new-run-created.mjs (2 hunks)
 _______________________________________
< For a good time, call 1-800-COD-RABT. >
 ---------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ

Walkthrough

The changes in this pull request involve a significant update to the listRuns method within the components/seqera/seqera.app.mjs file. The method has been renamed to listWorkflows, and its API endpoint has been modified from "/ga4gh/wes/v1/runs" to "/workflow?workspaceId=${workspaceId}". The new implementation requires a workspaceId parameter, altering how the method is invoked in the application, while the overall structure of the exported object remains unchanged.

Changes

File Change Summary
components/seqera/seqera.app.mjs - Renamed method listRuns to listWorkflows.
- Updated API path from "/ga4gh/wes/v1/runs" to "/workflow?workspaceId=${workspaceId}".
- Method now requires workspaceId parameter.

Suggested reviewers

  • jcortes

🐰 In the meadow, changes bloom,
A method's name sheds old costume.
From runs to workflows, it now flies,
With workspaceId, it reaches the skies!
A hop, a skip, through code we dance,
Embracing change, we take a chance! 🌼

Tip

CodeRabbit can generate a title for your PR based on the changes.

Add @coderabbitai placeholder anywhere in the title of your PR and CodeRabbit will replace it with a title based on the changes in the PR. You can change the placeholder by changing the reviews.auto_title_placeholder setting.


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

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 46e7530 and 7d5586d.

📒 Files selected for processing (1)
  • components/seqera/seqera.app.mjs (1 hunks)
🔇 Additional comments (2)
components/seqera/seqera.app.mjs (2)

168-172: 🛠️ Refactor suggestion

Consider adding workspaceId to propDefinitions.

Since workspaceId is a required parameter and already defined in propDefinitions for other methods, consider updating the documentation to indicate it's required.

Apply this diff to update the prop definition:

    workspaceId: {
      type: "string",
      label: "Workspace ID",
      description: "The ID of the workspace to use.",
-     optional: true,
+     optional: false,
      async options() {

Likely invalid or redundant comment.


168-172: Verify pagination handling for workflows endpoint.

The method is using the generic _makeRequest, but we should verify if the Seqera workflows endpoint supports pagination and if it follows the same pattern as other endpoints.

Let's check if other files in the codebase use this endpoint and how they handle pagination:

✅ Verification successful

Let me search for more context about pagination patterns in the codebase.


Let me check the constants and any pagination-related configuration in the codebase.


Based on the search results, I can see that the Seqera API uses pagination with page_size and page_token parameters, and the codebase has a standard pagination implementation in getIterations method that handles this pattern. The listWorkflows method is properly integrated with this pagination mechanism through _makeRequest.

Pagination is properly implemented for the workflows endpoint

The endpoint follows the standard pagination pattern used across the Seqera API:

  • Uses page_size parameter (default 50)
  • Returns next_page_token for subsequent requests
  • Integrated with the common getIterations pagination handler
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for workflow endpoint usage and pagination patterns
rg -l "workflow\?workspaceId" | while read -r file; do
  echo "=== $file ==="
  rg -A 10 "workflow\?workspaceId" "$file"
done

Length of output: 466


Script:

#!/bin/bash
# Search for pagination related patterns and getIterations usage
rg -A 10 "getIterations" components/seqera/seqera.app.mjs

# Look for other API endpoints that might show pagination patterns
rg -A 5 "_makeRequest" components/seqera/seqera.app.mjs

# Check if there are any pagination related parameters in the codebase
rg -i "pageSize|nextPageToken|offset|limit" components/seqera/seqera.app.mjs

Length of output: 1896


Script:

#!/bin/bash
# Check constants file for pagination defaults
rg -A 5 "DEFAULT_LIMIT|DEFAULT_MAX" .

# Look for the actual implementation of getIterations to understand pagination logic
ast-grep --pattern 'async *getIterations($_) {
  $$$
}'

Length of output: 281629

@vunguyenhung
Copy link
Collaborator

Hi everyone, all test cases are passed! Ready for release!

Test report
https://vunguyenhung.notion.site/Seqera-List-Workflows-not-Runs-12fbf548bb5e81959cd5f2d6ab384e8f

@michelle0927 michelle0927 merged commit 639f5cc into PipedreamHQ:master Oct 31, 2024
9 of 11 checks passed
lcaresia pushed a commit that referenced this pull request Dec 3, 2024
* List Workflows, not Runs

* updates

* pnpm-lock.yaml

---------

Co-authored-by: michelle0927 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
User submitted Submitted by a user
Projects
Development

Successfully merging this pull request may close these issues.

5 participants