Skip to content

integration_trello cards - #370

Open
fak111 wants to merge 2 commits into
mainfrom
integration_trello3
Open

integration_trello cards#370
fak111 wants to merge 2 commits into
mainfrom
integration_trello3

Conversation

@fak111

@fak111 fak111 commented May 15, 2025

Copy link
Copy Markdown
Contributor

🏷️ Ticket

trello

testing & results

Microsoft Edge 2025-05-19 19 41 30 image image image

📸 Screenshots (if applicable)

https://www.loom.com/share/19c2355db7a042958a3a1d54f6d02b4e?sid=9ff6227c-0622-4d7e-8f32-8a947a763dc6

✅ Checklist

  • [ ✅ ] I have signed the Contributor License Agreement (CLA) and read the contributing guide (required)
  • [ ✅ ] I have linked this PR to an issue or a ticket (required)
  • [ ] I have updated the documentation related to my change if needed
  • [ ] I have updated the tests accordingly (required for a bug fix or a new feature)
  • [ ] All checks on CI passed

Summary by CodeRabbit

  • New Features
    • Added Trello app integration, enabling users to create, view, update, and delete Trello cards.
    • Supports authentication via API key and offers comprehensive card management options including member assignment, labels, due dates, and card positioning.

@vercel

vercel Bot commented May 15, 2025

Copy link
Copy Markdown

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

Name Status Preview Comments Updated (UTC)
aci-dev-portal ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 15, 2025 2:46pm

@coderabbitai

coderabbitai Bot commented May 15, 2025

Copy link
Copy Markdown
Contributor

"""

Walkthrough

A new Trello app integration is introduced with two files: a JSON file defining the app's metadata, authentication scheme, and categorization, and a functions file specifying four REST API endpoints for managing Trello cards. These endpoints enable creating, retrieving, updating, and deleting cards, each with detailed parameter requirements and descriptions.

Changes

File(s) Change Summary
backend/apps/trello/app.json Added Trello app configuration file with metadata, logo, provider, description, category, visibility, and API key security.
backend/apps/trello/functions.json Added four REST API function definitions for Trello cards: create, get, update, and delete, each with parameters and schemas.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant TrelloApp
    participant TrelloAPI

    User->>TrelloApp: Initiate card operation (create/get/update/delete)
    TrelloApp->>TrelloAPI: Send REST API request with API key and token
    TrelloAPI-->>TrelloApp: Return API response (card data or status)
    TrelloApp-->>User: Display result of operation
Loading

Poem

In the world of boards and cards so bright,
Trello hops in, a rabbit’s delight!
Create, fetch, update, or send cards away—
With new endpoints, we work and play.
🐇✨ Project plans, now in sight!
"""

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 2465edb and a4eb5c9.

📒 Files selected for processing (1)
  • backend/apps/trello/app.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • backend/apps/trello/app.json
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Format & Lint
  • GitHub Check: Format, Lint, and Test
  • GitHub Check: Compose Tests

🪧 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.
    • @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 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.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in 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.

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

♻️ Duplicate comments (3)
backend/apps/trello/functions.json (3)

95-197: Duplicate: authentication parameter alignment applies here too
The same mismatch between "key" in app.json and "token" in this function occurs in TRELLO__GET_CARD. Please apply the fix outlined above for CREATE_CARD.


198-312: Duplicate: authentication parameter alignment applies here too
The TRELLO__UPDATE_CARD function also defines only "token". Ensure "key" is added per the security scheme and both are marked as required.


313-377: Duplicate: authentication parameter alignment applies here too
The TRELLO__DELETE_CARD function likewise expects only "token". Add "key" in the query parameters to align with app.json.

🧹 Nitpick comments (4)
backend/apps/trello/app.json (2)

6-6: Ensure semantic versioning consistency
The "version": "aipolabs_0.0.1" deviates from standard Semantic Versioning (e.g., 0.0.1). Consider aligning with SemVer conventions for clarity and consistency across apps.


16-19: Verify categories against taxonomy
Ensure the categories "Productivity" and "Project Management" match the platform’s predefined taxonomy and casing conventions to maintain consistency in the UI.

backend/apps/trello/functions.json (2)

36-43: Add enum and format constraints for known parameters
To improve schema validation and reduce runtime errors:

  • Add an enum for "pos" (e.g., ["top","bottom"]) or allow numeric values via a union type.
  • Add "format": "date-time" for "due" and "start" to enforce ISO 8601 date‐time strings.

Also applies to: 66-82


157-163: Specify enum for checklist options
The "checklists" parameter describes valid values "all" or "none" but is typed as string. Consider adding an enum constraint:

"checklists": {
  "type": "string",
  "enum": ["all", "none"],
  "description": "Whether to include checklists."
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 4c63896 and 2465edb.

📒 Files selected for processing (2)
  • backend/apps/trello/app.json (1 hunks)
  • backend/apps/trello/functions.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Compose Tests
  • GitHub Check: Format & Lint
  • GitHub Check: Format, Lint, and Test

Comment on lines +8 to +14
"security_schemes": {
"api_key": {
"location": "query",
"name": "key",
"prefix": null
}
},

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.

⚠️ Potential issue

Mismatch between security scheme and function parameters
The security scheme in app.json defines the API key as a query param named "key", but the functions in functions.json expect a "token" parameter (and not "key"). This will lead to authentication failures. You should either:

  • Update the functions to require "key" (and "token" if Trello requires both), or
  • Adjust the security scheme to include "token".
🤖 Prompt for AI Agents
In backend/apps/trello/app.json around lines 8 to 14, the security scheme
defines the API key as a query parameter named "key", but the functions expect a
parameter named "token". To fix this, either update the functions in
functions.json to require "key" instead of "token" (or both if needed), or
modify the security scheme here to use "token" as the parameter name to match
the functions. Ensure consistency between the security scheme and function
parameters to avoid authentication failures.

Comment on lines +1 to +93
[
{
"name": "TRELLO__CREATE_CARD",
"description": "Create a new card in Trello. You can specify the card name, description, position, labels, members and other attributes.",
"tags": [
"cards",
"create"
],
"visibility": "public",
"active": true,
"protocol": "rest",
"protocol_data": {
"method": "POST",
"path": "/cards",
"server_url": "https://api.trello.com/1"
},
"parameters": {
"type": "object",
"properties": {
"query": {
"type": "object",
"description": "Query parameters",
"properties": {
"token": {
"type": "string",
"description": "Trello API token for authentication"
},
"name": {
"type": "string",
"description": "The name of the card"
},
"desc": {
"type": "string",
"description": "The description of the card"
},
"pos": {
"type": "string",
"description": "The position of the card. Valid values: 'top', 'bottom', or a positive number."
},
"due": {
"type": "string",
"description": "Date due in ISO 8601 format, or null"
},
"start": {
"type": "string",
"description": "Start date in ISO 8601 format, or null"
},
"idList": {
"type": "string",
"description": "The ID of the list to add the card to"
},
"idMembers": {
"type": "array",
"description": "Array of member IDs to add to the card",
"items": {
"type": "string"
}
},
"idLabels": {
"type": "array",
"description": "Array of label IDs to add to the card",
"items": {
"type": "string"
}
}
},
"required": [
"token",
"idList"
],
"visible": [
"token",
"name",
"desc",
"pos",
"due",
"start",
"idList",
"idMembers",
"idLabels"
],
"additionalProperties": false
}
},
"required": [
"query"
],
"visible": [
"query"
],
"additionalProperties": false
}
},

@coderabbitai coderabbitai Bot May 15, 2025

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.

⚠️ Potential issue

Add and align API key parameter for authentication
The TRELLO__CREATE_CARD function only defines a "token" query parameter, but the app.json security scheme expects "key". The Trello API typically requires both key (your API key) and token (user token). Update this schema to include both parameters and mark them as required:

--- a/backend/apps/trello/functions.json
+++ b/backend/apps/trello/functions.json
@@ "properties": {
-    "token": {
+    "key": {
+      "type": "string",
+      "description": "Trello API key for authentication"
+    },
+    "token": {
       "type": "string",
       "description": "Trello API token for authentication"
     },
@@ "required": [
-    "token",
+    "key",
+    "token",
     "idList"
 ]
📝 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
[
{
"name": "TRELLO__CREATE_CARD",
"description": "Create a new card in Trello. You can specify the card name, description, position, labels, members and other attributes.",
"tags": [
"cards",
"create"
],
"visibility": "public",
"active": true,
"protocol": "rest",
"protocol_data": {
"method": "POST",
"path": "/cards",
"server_url": "https://api.trello.com/1"
},
"parameters": {
"type": "object",
"properties": {
"query": {
"type": "object",
"description": "Query parameters",
"properties": {
"token": {
"type": "string",
"description": "Trello API token for authentication"
},
"name": {
"type": "string",
"description": "The name of the card"
},
"desc": {
"type": "string",
"description": "The description of the card"
},
"pos": {
"type": "string",
"description": "The position of the card. Valid values: 'top', 'bottom', or a positive number."
},
"due": {
"type": "string",
"description": "Date due in ISO 8601 format, or null"
},
"start": {
"type": "string",
"description": "Start date in ISO 8601 format, or null"
},
"idList": {
"type": "string",
"description": "The ID of the list to add the card to"
},
"idMembers": {
"type": "array",
"description": "Array of member IDs to add to the card",
"items": {
"type": "string"
}
},
"idLabels": {
"type": "array",
"description": "Array of label IDs to add to the card",
"items": {
"type": "string"
}
}
},
"required": [
"token",
"idList"
],
"visible": [
"token",
"name",
"desc",
"pos",
"due",
"start",
"idList",
"idMembers",
"idLabels"
],
"additionalProperties": false
}
},
"required": [
"query"
],
"visible": [
"query"
],
"additionalProperties": false
}
},
"parameters": {
"type": "object",
"properties": {
"query": {
"type": "object",
"description": "Query parameters",
"properties": {
"key": {
"type": "string",
"description": "Trello API key for authentication"
},
"token": {
"type": "string",
"description": "Trello API token for authentication"
},
"name": {
"type": "string",
"description": "The name of the card"
},
"desc": {
"type": "string",
"description": "The description of the card"
},
"pos": {
"type": "string",
"description": "The position of the card. Valid values: 'top', 'bottom', or a positive number."
},
"due": {
"type": "string",
"description": "Date due in ISO 8601 format, or null"
},
"start": {
"type": "string",
"description": "Start date in ISO 8601 format, or null"
},
"idList": {
"type": "string",
"description": "The ID of the list to add the card to"
},
"idMembers": {
"type": "array",
"description": "Array of member IDs to add to the card",
"items": {
"type": "string"
}
},
"idLabels": {
"type": "array",
"description": "Array of label IDs to add to the card",
"items": {
"type": "string"
}
}
},
"required": [
"key",
"token",
"idList"
],
"visible": [
"token",
"name",
"desc",
"pos",
"due",
"start",
"idList",
"idMembers",
"idLabels"
],
"additionalProperties": false
}
},
"required": [
"query"
],
"visible": [
"query"
],
"additionalProperties": false
}
🤖 Prompt for AI Agents
In backend/apps/trello/functions.json lines 1 to 93, the TRELLO__CREATE_CARD
function schema currently only includes the "token" query parameter for
authentication, but the Trello API requires both "key" (API key) and "token"
(user token). To fix this, add a "key" parameter alongside "token" in the
"query" properties, provide a description for it as the Trello API key, and
update the "required" array to include both "key" and "token" to ensure both are
mandatory for authentication.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The Trello API requires two keys:

curl --request DELETE \
  --url 'https://api.trello.com/1/cards/{id}?**key**=APIKey&**token**=APIToken'

Refer to their documentation on API keys and tokens: Trello Cards API

However, our platform only supports the following authentication methods:

    NO_AUTH = "no_auth"
    API_KEY = "api_key"
    HTTP_BASIC = "http_basic"
    HTTP_BEARER = "http_bearer"
    OAUTH2 = "oauth2"

Solution 1: When attempting to implement a Trello connector, hardcoding the token is not ideal.
Solution 2: Fixing the code bottleneck requires modifying more code.

Compromise: Include the token in the prompt for now.
Future Plan: Revisit Solution 2.

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.

@fak111 I understand your approach regarding the Trello API authentication challenge. You're right that Trello requires both key and token parameters, which doesn't perfectly map to the standard authentication methods your platform supports.

Your compromise of including the token in the prompt for now is a pragmatic solution given the constraints. It allows you to move forward with the integration while acknowledging this isn't the ideal long-term approach.

This is a reasonable short-term workaround until you can implement Solution 2 in the future. If you need any assistance when you revisit this authentication challenge later, I'd be happy to help explore more scalable options.

@hanyixxx hanyixxx 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.

please attach screenshots of testing & results

@fak111

fak111 commented May 19, 2025

Copy link
Copy Markdown
Contributor Author

please attach screenshots of testing & results

fix

@fak111
fak111 requested a review from hanyixxx May 19, 2025 11:43
@hanyixxx

Copy link
Copy Markdown
Contributor

i think we need a better way to handle dual tokens
@jiwei-aipolabs

@hanyixxx hanyixxx 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.

we need to find a better way to support trello's dual token authentication

@recurseml

recurseml Bot commented Jul 14, 2025

Copy link
Copy Markdown

✨ No files to analyze in this PR.

Need help? Join our Discord for support!
https://discord.gg/qEjHQk64Z9

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.

2 participants