Skip to content
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

[Components] kaleido #8866 #12558

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

[Components] kaleido #8866 #12558

wants to merge 3 commits into from

Conversation

lcaresia
Copy link
Collaborator

@lcaresia lcaresia commented Jun 25, 2024

WHY

Summary by CodeRabbit

  • New Features

    • Introduced actions to create, delete, and manage contracts and memberships in Kaleido.
    • Added new prop definitions and methods for interacting with Kaleido API, including handling contracts and memberships.
  • Updates

    • Updated package version to 0.1.0 and added a new dependency.

@lcaresia lcaresia self-assigned this Jun 25, 2024
Copy link

vercel bot commented Jun 25, 2024

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

3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Ignored (Inspect) Visit Preview Jun 26, 2024 7:57pm
pipedream-docs ⬜️ Ignored (Inspect) Jun 26, 2024 7:57pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Jun 26, 2024 7:57pm

Copy link
Contributor

coderabbitai bot commented Jun 25, 2024

Walkthrough

The recent changes introduce new actions for Kaleido, including creating and deleting contracts and creating memberships. It also involves added methods for interacting with the Kaleido API and updating properties for better functionality. The @pipedream/kaleido package version is updated to 0.1.0 with a new dependency on @pipedream/platform.

Changes

Files Change Summary
components/kaleido/actions/create-contract/create-contract.mjs | components/kaleido/actions/create-membership/create-membership.mjs | components/kaleido/actions/delete-contract/delete-contract.mjs Introduced actions for creating contracts, creating memberships, and deleting contracts in Kaleido
components/kaleido/common/constants.mjs Added a new constant array TYPES to list different types of contract projects
components/kaleido/kaleido.app.mjs Added new prop definitions and methods for contract management and interaction with the Kaleido API
components/kaleido/package.json Updated version to 0.1.0 and added a dependency on @pipedream/platform

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CreateContractAction
    participant KaleidoAPI
    User->>CreateContractAction: Trigger create contract
    CreateContractAction->>KaleidoAPI: Send request to create contract
    KaleidoAPI-->>CreateContractAction: Return contract creation response
    CreateContractAction-->>User: Return result
Loading
sequenceDiagram
    participant User
    participant CreateMembershipAction
    participant KaleidoAPI
    User->>CreateMembershipAction: Trigger create membership
    CreateMembershipAction->>KaleidoAPI: Send request to create membership
    KaleidoAPI-->>CreateMembershipAction: Return membership creation response
    CreateMembershipAction-->>User: Return result
Loading
sequenceDiagram
    participant User
    participant DeleteContractAction
    participant KaleidoAPI
    User->>DeleteContractAction: Trigger delete contract
    DeleteContractAction->>KaleidoAPI: Send request to delete contract
    KaleidoAPI-->>DeleteContractAction: Return contract deletion response
    DeleteContractAction-->>User: Return result
Loading

Poem

In code's twilight, changes bloom,
Kaleido's toolkit quelled the gloom,
Contracts crafted, memberships spark,
APIs sway, light in the dark.
Versions rise, dependencies cheer,
Future bright, updates near. 🌟


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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.

@lcaresia lcaresia linked an issue Jun 25, 2024 that may be closed by this pull request
GTFalcao
GTFalcao previously approved these changes Jun 25, 2024
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.

LGTM!

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between e934396 and 39a2831.

Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing (6)
  • components/kaleido/actions/create-contract/create-contract.mjs (1 hunks)
  • components/kaleido/actions/create-membership/create-membership.mjs (1 hunks)
  • components/kaleido/actions/delete-contract/delete-contract.mjs (1 hunks)
  • components/kaleido/common/constants.mjs (1 hunks)
  • components/kaleido/kaleido.app.mjs (1 hunks)
  • components/kaleido/package.json (2 hunks)
Files skipped from review due to trivial changes (1)
  • components/kaleido/package.json
Additional context used
Biome
components/kaleido/kaleido.app.mjs

[error] 147-147: Useless rename. (lint/complexity/noUselessRename)

Safe fix: Remove the renaming.


[error] 155-155: Useless rename. (lint/complexity/noUselessRename)

Safe fix: Remove the renaming.

Additional comments not posted (5)
components/kaleido/common/constants.mjs (1)

1-9: Constants defined correctly.

The TYPES array is well-defined and follows best practices for constant management in modular JavaScript.

components/kaleido/actions/delete-contract/delete-contract.mjs (1)

1-37: Delete contract functionality implemented correctly.

The rest of the code in this file is implemented correctly, adhering to best practices for asynchronous operations and API interactions.

components/kaleido/actions/create-contract/create-contract.mjs (1)

1-61: Create contract functionality implemented correctly.

The code is well-structured and adheres to best practices for asynchronous operations and API interactions.

components/kaleido/actions/create-membership/create-membership.mjs (1)

1-60: Create membership functionality implemented correctly.

The code is well-structured and adheres to best practices for asynchronous operations and API interactions.

components/kaleido/kaleido.app.mjs (1)

1-160: Functionality for Kaleido app implemented correctly.

The prop definitions and methods are correctly implemented, facilitating effective interaction with the Kaleido API.

Tools
Biome

[error] 147-147: Useless rename. (lint/complexity/noUselessRename)

Safe fix: Remove the renaming.


[error] 155-155: Useless rename. (lint/complexity/noUselessRename)

Safe fix: Remove the renaming.

Comment on lines +1 to +37
import app from "../../kaleido.app.mjs";

export default {
key: "kaleido-delete-contract",
name: "Delete Contract",
description: "Delete a contract in Kaleido. [See the documentation](https://api.kaleido.io/platform.html#tag/Contracts/paths/~1consortia~1%7Bconsortia_id%7D~1contracts~1%7Bcontract_id%7D/delete)",
version: "0.0.1",
type: "action",
props: {
app,
consortiaId: {
propDefinition: [
app,
"consortiaId",
],
},
contractId: {
propDefinition: [
app,
"contractId",
(c) => ({
consortiaId: c.consortiaId,
}),
],
},
},
async run({ $ }) {
const response = await this.app.deleteContract({
$,
consortiaId: this.consortiaId,
contractId: this.contractId,
});

$.export("$summary", `Successfully deleted contract with ID '${this.this.contract_id}'`);

return response;
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo in summary export.

There is a typo in the summary export statement which could lead to a runtime error.

- $.export("$summary", `Successfully deleted contract with ID '${this.this.contract_id}'`);
+ $.export("$summary", `Successfully deleted contract with ID '${this.contractId}'`);
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import app from "../../kaleido.app.mjs";
export default {
key: "kaleido-delete-contract",
name: "Delete Contract",
description: "Delete a contract in Kaleido. [See the documentation](https://api.kaleido.io/platform.html#tag/Contracts/paths/~1consortia~1%7Bconsortia_id%7D~1contracts~1%7Bcontract_id%7D/delete)",
version: "0.0.1",
type: "action",
props: {
app,
consortiaId: {
propDefinition: [
app,
"consortiaId",
],
},
contractId: {
propDefinition: [
app,
"contractId",
(c) => ({
consortiaId: c.consortiaId,
}),
],
},
},
async run({ $ }) {
const response = await this.app.deleteContract({
$,
consortiaId: this.consortiaId,
contractId: this.contractId,
});
$.export("$summary", `Successfully deleted contract with ID '${this.this.contract_id}'`);
return response;
},
import app from "../../kaleido.app.mjs";
export default {
key: "kaleido-delete-contract",
name: "Delete Contract",
description: "Delete a contract in Kaleido. [See the documentation](https://api.kaleido.io/platform.html#tag/Contracts/paths/~1consortia~1%7Bconsortia_id%7D~1contracts~1%7Bcontract_id%7D/delete)",
version: "0.0.1",
type: "action",
props: {
app,
consortiaId: {
propDefinition: [
app,
"consortiaId",
],
},
contractId: {
propDefinition: [
app,
"contractId",
(c) => ({
consortiaId: c.consortiaId,
}),
],
},
},
async run({ $ }) {
const response = await this.app.deleteContract({
$,
consortiaId: this.consortiaId,
contractId: this.contractId,
});
$.export("$summary", `Successfully deleted contract with ID '${this.contractId}'`);
return response;
},

});
},
async getContracts({
consortiaId: consortiaId, ...args
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove useless renaming in method parameters.

The renaming of consortiaId in the method parameters is unnecessary and can be simplified.

- async getContracts({
-   consortiaId: consortiaId, ...args
- }) {
+ async getContracts({
+   consortiaId, ...args
+ }) {
- async getMemberships({
-   consortiaId: consortiaId, ...args
- }) {
+ async getMemberships({
+   consortiaId, ...args
+ }) {

Also applies to: 155-155

Tools
Biome

[error] 147-147: Useless rename. (lint/complexity/noUselessRename)

Safe fix: Remove the renaming.

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.

[Components] kaleido
2 participants