Skip to content

Add prebuilt integration to send Trello summary emails via Mailchimp - #59

Open
anjanaed wants to merge 18 commits into
wso2:mainfrom
anjanaed:trello-summary-email
Open

Add prebuilt integration to send Trello summary emails via Mailchimp #59
anjanaed wants to merge 18 commits into
wso2:mainfrom
anjanaed:trello-summary-email

Conversation

@anjanaed

@anjanaed anjanaed commented Mar 12, 2026

Copy link
Copy Markdown

Purpose

Adds prebuilt integration that automates the process of fetching Trello cards, generating summaries, and sending email campaigns via Mailchimp. It aims to streamline team communication by providing regular updates on Trello board activities.

Resolves: https://github.com/wso2-enterprise/integration-engineering/issues/69

Features

  • Fetches cards from Trello boards and lists.
  • Filters cards based on labels, members, and due dates.
  • Group cards by list, member, or label for better organization.
  • Generates detailed email summaries, including overdue cards, card age, attachments, and checklist progress.
  • Sends email campaigns to a Mailchimp audience with customizable configurations.

Summary by CodeRabbit

  • New Features

    • Trello-to-Mailchimp email summary integration: fetch, filter (label/member/due date), group (list/member/label) and send HTML campaigns; manual or scheduled triggers; configurable summary presentation and Mailchimp subject/date options
    • Command-line/automation entry to run the summary
  • Documentation

    • README, setup guides, configuration reference, workflow diagram, and usage instructions
  • Chores

    • Project manifest, .gitignore rules, CI project entry, and runtime configuration schema added

@coderabbitai

coderabbitai Bot commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a new Ballerina integration project trello-summary-email that fetches Trello cards, applies filters and grouping, generates HTML summaries, and sends Mailchimp campaigns; includes Choreo docs and schema, configuration bindings, client connections, core processing logic, public types, and an executable entrypoint. (47 words)

Changes

Cohort / File(s) Summary
Project Integration Setup
​.github/workflows/projects.json, ballerina-integrator/trello-summary-email/Ballerina.toml, ballerina-integrator/trello-summary-email/.gitignore
Registers the project in CI, adds package metadata, and repository ignore rules for Ballerina artifacts.
Choreo Config & Docs
ballerina-integrator/trello-summary-email/.choreo/config-schema.json, ballerina-integrator/trello-summary-email/.choreo/diagram.md, ballerina-integrator/trello-summary-email/.choreo/instructions.md
Adds a full JSON configuration schema and Choreo documentation including a workflow diagram and setup/run instructions.
Project Documentation
ballerina-integrator/trello-summary-email/README.md
New README describing purpose, prerequisites, configuration structure, and deployment/scheduling guidance.
Configuration Bindings
ballerina-integrator/trello-summary-email/config.bal
Introduces top-level configurable records: trelloConfig, mailchimpConfig, filterConfig, and summaryConfig with defaults and types.
Connections / Clients
ballerina-integrator/trello-summary-email/connections.bal
Adds Trello and Mailchimp client initializations (trelloClient, trelloHttpClient, mailchimpClient) using configured credentials and base URLs.
Core Logic & Types
ballerina-integrator/trello-summary-email/functions.bal, ballerina-integrator/trello-summary-email/types.bal, ballerina-integrator/trello-summary-email/automation.bal, ballerina-integrator/trello-summary-email/main.bal
Implements Trello fetching/parsing/filtering, per-card processing, grouping, HTML generation, Mailchimp campaign creation/sending, orchestration (sendTrelloSummary), main, and adds SummaryGrouping, CardSummary, and GroupedSummary types.

Sequence Diagram

sequenceDiagram
    participant Main as Main
    participant Orch as Orchestration
    participant Trello as Trello API
    participant Mailchimp as Mailchimp API

    Main->>Orch: sendTrelloSummary()
    Orch->>Trello: Fetch boards, lists, cards
    Trello-->>Orch: Return card JSON
    Orch->>Orch: Apply filters & process cards (age, overdue, attachments, checklists)
    Orch->>Orch: Group cards & generate HTML
    Orch->>Mailchimp: Create campaign, upload HTML
    Mailchimp-->>Orch: Campaign ID / ack
    Orch->>Mailchimp: Send campaign
    Mailchimp-->>Orch: Send confirmation
    Orch-->>Main: Success / error
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

🐰 I hopped through boards at dawn's first light,
Gathered cards, sorted them neat and bright,
Wove HTML nests with checklists and date,
Mailchimp carried each summary straight,
A rabbit's cheer — integration takes flight!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is incomplete compared to the template. It covers Purpose and Features but lacks most required sections: Goals, Approach, User stories, Release note, Documentation, Training, Certification, Marketing, Automation tests, Security checks, Samples, Related PRs, Migrations, Test environment, and Learning. Complete the PR description by adding missing sections from the template, particularly Goals, Approach, Automation tests, Security checks, and Documentation to meet repository standards.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and concisely describes the main change: adding a prebuilt integration for Trello-to-Mailchimp email summaries, which is the primary focus of all the files added in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@CLAassistant

CLAassistant commented Mar 12, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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

🧹 Nitpick comments (5)
ballerina-integrator/trello-summary-email/.choreo/config-schema.json (3)

137-144: Schema requires fields that have Ballerina defaults.

All summaryConfig fields are marked as required, but config.bal (lines 26-33) defines defaults for all of them. The entire summaryConfig block has a default empty initializer (= {}), meaning users don't need to specify any of these fields.

Proposed fix
              "additionalProperties": false,
-             "required": [
-               "grouping",
-               "highlightOverdueCards",
-               "showCardAge",
-               "staleCardDays",
-               "showAttachmentCount",
-               "showChecklistProgress"
-             ],
              "description": ""
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ballerina-integrator/trello-summary-email/.choreo/config-schema.json` around
lines 137 - 144, The JSON schema currently lists all summaryConfig properties
("grouping", "highlightOverdueCards", "showCardAge", "staleCardDays",
"showAttachmentCount", "showChecklistProgress") as required which conflicts with
the Ballerina config (config.bal) that provides defaults and a default empty
initializer for summaryConfig; update the schema by removing these property
names from the "required" array (or remove the "required" array for
summaryConfig entirely) so the fields become optional and the Ballerina defaults
can be used, leaving the property definitions intact to validate when provided.

102-107: Schema requires fields that have Ballerina defaults, forcing unnecessary user configuration.

All filterConfig fields (labels, members, includeDueDateFilter, dueDateDaysAhead) are marked as required in the schema, but config.bal (lines 17-24) defines defaults for all of them (empty arrays, false, and 7). This forces users to explicitly specify these values even when the defaults are acceptable.

Consider removing these from the required array so users can rely on the Ballerina defaults.

Proposed fix
              "additionalProperties": false,
-             "required": [
-               "labels",
-               "members",
-               "includeDueDateFilter",
-               "dueDateDaysAhead"
-             ],
              "description": ""
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ballerina-integrator/trello-summary-email/.choreo/config-schema.json` around
lines 102 - 107, The JSON schema currently marks filterConfig fields "labels",
"members", "includeDueDateFilter", and "dueDateDaysAhead" as required even
though config.bal defines defaults for them; update the schema in
config-schema.json by removing those four property names from the "required"
array so they become optional and consumers can rely on the Ballerina defaults
defined in config.bal.

74-76: subjectPrefix and includeDateInSubject are required but have Ballerina defaults.

Per config.bal (lines 7-8), subjectPrefix defaults to "Trello Cards Summary" and includeDateInSubject defaults to true. Requiring these in the schema forces users to specify them unnecessarily.

Proposed fix
              "required": [
                "apiKey",
                "serverPrefix",
                "listId",
                "fromName",
-               "fromAddress",
-               "subjectPrefix",
-               "includeDateInSubject"
+               "fromAddress"
              ],
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ballerina-integrator/trello-summary-email/.choreo/config-schema.json` around
lines 74 - 76, The schema currently lists subjectPrefix and includeDateInSubject
as required, which conflicts with the defaults defined in config.bal; open
config-schema.json, find the "required" array that contains "subjectPrefix" and
"includeDateInSubject" and remove those two entries so they are optional, and
(optionally) add matching "default" values under their property definitions
(subjectPrefix: "Trello Cards Summary", includeDateInSubject: true) to keep
schema and Ballerina defaults consistent; ensure the property names match
exactly ("subjectPrefix", "includeDateInSubject") when editing.
ballerina-integrator/trello-summary-email/functions.bal (2)

131-140: Silent error handling may hide connectivity issues.

When the member API call fails (line 133-134), the error is silently swallowed. While this prevents a single failed member lookup from breaking the entire flow, it also hides potential issues like rate limiting or connectivity problems.

Consider logging the error or implementing a threshold for acceptable failures.

💡 Suggested improvement
                 trello:InlineResponse2001|error memberInfo = trelloClient->/members/[memberIdStr].get();
                 if memberInfo is trello:InlineResponse2001 {
                     string? fullName = memberInfo?.fullName;
                     if fullName is string {
                         memberNames.push(fullName);
                     }
+                } else {
+                    log:printWarn(string `Failed to fetch member info for ID: ${memberIdStr}`, 'error = memberInfo);
                 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ballerina-integrator/trello-summary-email/functions.bal` around lines 131 -
140, The member lookup currently swallows errors from the trelloClient call
(trelloClient->/members/[memberIdStr].get()), which can hide connectivity or
rate-limit issues; update the error handling around that call so that when the
result is an error you log the error (including memberIdStr and error details)
via your logger and increment a failure counter, and implement an early-abort or
threshold check (e.g., failCount > MAX_MEMBER_FAILURES) to stop or surface the
problem instead of silently continuing; ensure you still push valid fullName
values into memberNames when memberInfo is returned successfully.

445-479: Orphaned campaigns may accumulate on partial failures.

If putCampaignsIdContent (line 471) or postCampaignsIdActionsSend (line 478) fails after the campaign is created, the campaign remains in Mailchimp in a draft state. Over time, failed runs could leave orphaned campaigns.

Consider adding cleanup logic to delete the campaign if subsequent steps fail, or document this behavior so operators know to periodically clean up draft campaigns.

💡 Suggested approach with cleanup
function sendEmailSummary(string htmlContent) returns error? {
    // ... subject building ...
    
    mailchimp:Campaign1 campaign = check mailchimpClient->postCampaigns({...});
    
    string? campaignId = campaign?.id;
    if campaignId is () {
        return error("Failed to create campaign: Campaign ID is null");
    }

    do {
        _ = check mailchimpClient->putCampaignsIdContent(
            campaignId = campaignId,
            payload = { html: htmlContent }
        );
        _ = check mailchimpClient->postCampaignsIdActionsSend(campaignId = campaignId);
    } on fail error e {
        // Attempt cleanup - delete orphaned campaign
        error? deleteResult = mailchimpClient->deleteCampaignsId(campaignId = campaignId);
        if deleteResult is error {
            log:printWarn("Failed to clean up orphaned campaign", campaignId = campaignId);
        }
        return e;
    }
}

Note: Verify that deleteCampaignsId is available in the Mailchimp client.

Mailchimp API delete campaign endpoint
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ballerina-integrator/trello-summary-email/functions.bal` around lines 445 -
479, sendEmailSummary can leave orphaned Mailchimp campaigns if
putCampaignsIdContent or postCampaignsIdActionsSend fail after creating a
campaign; wrap the content/update/send sequence in a do/on fail block (or
try/catch equivalent) so that on any failure you call
mailchimpClient->deleteCampaignsId(campaignId) to attempt cleanup, log a warning
if deleteCampaignsId itself errors, and then rethrow/return the original error;
reference the existing campaignId variable, mailchimpClient,
putCampaignsIdContent, postCampaignsIdActionsSend, and add/deleteCampaignsId
calls accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@ballerina-integrator/trello-summary-email/.choreo/config-schema.json`:
- Around line 382-384: The schema contains invalid entries where "type": "" is
used (the anonymous object entries in the config-schema.json snippet); replace
each empty-string type with the correct JSON Schema type (one of string, number,
integer, boolean, array, object, or null) based on the surrounding schema
context, or remove the "type" property entirely if the type is intentionally
unspecified—apply this change to both occurrences matching the empty "type"
entries in the file.

In `@ballerina-integrator/trello-summary-email/.choreo/diagram.md`:
- Around line 1-17: The Mermaid diagram is missing the code fence and flowchart
direction header so it won't render; wrap the existing nodes (A, B, C, ... K and
the arrows) in a fenced code block and add the Mermaid flowchart declaration
(e.g., "mermaid" followed by "flowchart TD") before the nodes, then close the
fenced block at the end so the diagram (A --> B --> C ... E -- No --> K) renders
correctly.

In `@ballerina-integrator/trello-summary-email/.choreo/instructions.md`:
- Around line 40-54: Fix the numbering in the configuration list so it is
sequential: change the "3." before `filterConfig.members` to "2." and then
ensure the subsequent items (`filterConfig.includeDueDateFilter`,
`mailchimpConfig.includeDateInSubject`, `summaryConfig.grouping`,
`summaryConfig.staleCardDays`) are numbered 3–6 (or 3–7 if you prefer starting
at 1) consistently; verify the entries for `filterConfig.labels`,
`filterConfig.members`, `filterConfig.includeDueDateFilter`,
`mailchimpConfig.includeDateInSubject`, `summaryConfig.grouping`, and
`summaryConfig.staleCardDays` are numbered in correct order.

In `@ballerina-integrator/trello-summary-email/connections.bal`:
- Line 11: Replace the invalid shell-style comment starting with "#" (the line
containing "#Had to use a separate client for Trello API calls...") with a
Ballerina single-line comment using "//" (e.g., "//Had to use a separate client
for Trello API calls..."); search for any other occurrences of "#" used as
single-line comments in the same file and convert them to "//" to avoid
compilation errors in the Ballerina code.

In `@ballerina-integrator/trello-summary-email/functions.bal`:
- Around line 268-276: The HTML generation is inserting user-controlled Trello
fields raw, creating XSS risk; add an HTML-escape utility (e.g., escapeHtml)
that replaces &, <, >, ", ' with their entities and call it wherever user data
is interpolated into HTML: replace direct uses of card.name, card.description,
label (in the labelsHtml loop), member (in membersHtml), and group.groupName
(and the other HTML-building sites around lines 290-295 and 306-315) with
escapeHtml(field) so all user content is escaped before concatenation into the
email template.
- Around line 127-142: This loop in processCardFromJson that builds memberNames
from membersJson does an API call per member via
trelloClient->/members/[memberId].get(), causing N+1 calls; change it to either
(a) fetch all board members once (use /boards/{boardId}/members) and build a
map<memberId,fullName> to resolve ids in this loop, or (b) add a shared
memberCache (map<string>) at module scope or passed into
fetchTrelloCards/processCardFromJson and consult it before calling
trelloClient->/members/[memberId].get(), storing looked-up fullName in the cache
for reuse; update the code that references memberNames and membersJson
accordingly so no per-member remote call occurs inside the loop.
- Around line 342-350: The stale count is currently computed by iterating
groupedSummaries in generateEmailContent which double-counts cards that appear
in multiple GroupedSummary groups; change generateEmailContent signature to
accept a precomputed staleCount (int staleCount) or compute it from the original
flat CardSummary[] cards before grouping, and implement a helper
countStaleCards(CardSummary[] cards) that mirrors countOverdueCards: iterate the
flat cards array, increment when card.isStale is true, return the total, and
then use that value inside generateEmailContent instead of summing over
groupedSummaries.

---

Nitpick comments:
In `@ballerina-integrator/trello-summary-email/.choreo/config-schema.json`:
- Around line 137-144: The JSON schema currently lists all summaryConfig
properties ("grouping", "highlightOverdueCards", "showCardAge", "staleCardDays",
"showAttachmentCount", "showChecklistProgress") as required which conflicts with
the Ballerina config (config.bal) that provides defaults and a default empty
initializer for summaryConfig; update the schema by removing these property
names from the "required" array (or remove the "required" array for
summaryConfig entirely) so the fields become optional and the Ballerina defaults
can be used, leaving the property definitions intact to validate when provided.
- Around line 102-107: The JSON schema currently marks filterConfig fields
"labels", "members", "includeDueDateFilter", and "dueDateDaysAhead" as required
even though config.bal defines defaults for them; update the schema in
config-schema.json by removing those four property names from the "required"
array so they become optional and consumers can rely on the Ballerina defaults
defined in config.bal.
- Around line 74-76: The schema currently lists subjectPrefix and
includeDateInSubject as required, which conflicts with the defaults defined in
config.bal; open config-schema.json, find the "required" array that contains
"subjectPrefix" and "includeDateInSubject" and remove those two entries so they
are optional, and (optionally) add matching "default" values under their
property definitions (subjectPrefix: "Trello Cards Summary",
includeDateInSubject: true) to keep schema and Ballerina defaults consistent;
ensure the property names match exactly ("subjectPrefix",
"includeDateInSubject") when editing.

In `@ballerina-integrator/trello-summary-email/functions.bal`:
- Around line 131-140: The member lookup currently swallows errors from the
trelloClient call (trelloClient->/members/[memberIdStr].get()), which can hide
connectivity or rate-limit issues; update the error handling around that call so
that when the result is an error you log the error (including memberIdStr and
error details) via your logger and increment a failure counter, and implement an
early-abort or threshold check (e.g., failCount > MAX_MEMBER_FAILURES) to stop
or surface the problem instead of silently continuing; ensure you still push
valid fullName values into memberNames when memberInfo is returned successfully.
- Around line 445-479: sendEmailSummary can leave orphaned Mailchimp campaigns
if putCampaignsIdContent or postCampaignsIdActionsSend fail after creating a
campaign; wrap the content/update/send sequence in a do/on fail block (or
try/catch equivalent) so that on any failure you call
mailchimpClient->deleteCampaignsId(campaignId) to attempt cleanup, log a warning
if deleteCampaignsId itself errors, and then rethrow/return the original error;
reference the existing campaignId variable, mailchimpClient,
putCampaignsIdContent, postCampaignsIdActionsSend, and add/deleteCampaignsId
calls accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6cf54f04-7b6d-4a85-aa6d-5c0bad786640

📥 Commits

Reviewing files that changed from the base of the PR and between c7cb295 and ce4ed27.

📒 Files selected for processing (15)
  • .github/workflows/projects.json
  • ballerina-integrator/trello-summary-email/.choreo/config-schema.json
  • ballerina-integrator/trello-summary-email/.choreo/diagram.md
  • ballerina-integrator/trello-summary-email/.choreo/instructions.md
  • ballerina-integrator/trello-summary-email/.gitignore
  • ballerina-integrator/trello-summary-email/Ballerina.toml
  • ballerina-integrator/trello-summary-email/README.md
  • ballerina-integrator/trello-summary-email/agents.bal
  • ballerina-integrator/trello-summary-email/automation.bal
  • ballerina-integrator/trello-summary-email/config.bal
  • ballerina-integrator/trello-summary-email/connections.bal
  • ballerina-integrator/trello-summary-email/data_mappings.bal
  • ballerina-integrator/trello-summary-email/functions.bal
  • ballerina-integrator/trello-summary-email/main.bal
  • ballerina-integrator/trello-summary-email/types.bal

Comment on lines +382 to +384
{
"type": ""
}

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 | 🟠 Major

Invalid JSON Schema: empty string is not a valid type.

Lines 383 and 403 use "type": "" which is not valid in JSON Schema draft-07. This will cause schema validation errors. Valid type values are: string, number, integer, boolean, array, object, or null.

Proposed fix
                    {
-                     "type": ""
+                     "type": "null"
                    }

Apply this fix at both locations (lines 382-384 and 402-404).

Also applies to: 402-404

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ballerina-integrator/trello-summary-email/.choreo/config-schema.json` around
lines 382 - 384, The schema contains invalid entries where "type": "" is used
(the anonymous object entries in the config-schema.json snippet); replace each
empty-string type with the correct JSON Schema type (one of string, number,
integer, boolean, array, object, or null) based on the surrounding schema
context, or remove the "type" property entirely if the type is intentionally
unspecified—apply this change to both occurrences matching the empty "type"
entries in the file.

Comment on lines +1 to +17
A(["Begin"]):::startNode
B["Fetch Cards from <br/>Trello Boards & Lists"]:::processNode
C{"Are there Cards?"}:::decisionNode
D["Apply Filters<br/>(Labels / Members / Due Date)"]:::processNode
E{"Cards remaining<br/>after filtering?"}:::decisionNode
F["Group Cards<br/>(by List / Member / Label)"]:::processNode
G["Generate HTML<br/>Email Content"]:::processNode
H["Create Mailchimp<br/>Email Campaign"]:::processNode
I["Send Campaign to<br/>Mailchimp Audience"]:::processNode
J(["Complete"]):::endNode
K(["Skip - No Cards"]):::endNode

A --> B --> C
C -- Yes --> D --> E
C -- No --> K
E -- Yes --> F --> G --> H --> I --> J
E -- No --> K

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 | 🟡 Minor

Missing Mermaid flowchart declaration for proper rendering.

The diagram is missing the Mermaid code fence and flowchart direction declaration. Without these, the diagram won't render correctly in Markdown viewers.

Proposed fix
+```mermaid
+flowchart TD
    A(["Begin"]):::startNode
    B["Fetch Cards from <br/>Trello Boards & Lists"]:::processNode
    ...
    E -- No --> K
+```
📝 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
A(["Begin"]):::startNode
B["Fetch Cards from <br/>Trello Boards & Lists"]:::processNode
C{"Are there Cards?"}:::decisionNode
D["Apply Filters<br/>(Labels / Members / Due Date)"]:::processNode
E{"Cards remaining<br/>after filtering?"}:::decisionNode
F["Group Cards<br/>(by List / Member / Label)"]:::processNode
G["Generate HTML<br/>Email Content"]:::processNode
H["Create Mailchimp<br/>Email Campaign"]:::processNode
I["Send Campaign to<br/>Mailchimp Audience"]:::processNode
J(["Complete"]):::endNode
K(["Skip - No Cards"]):::endNode
A --> B --> C
C -- Yes --> D --> E
C -- No --> K
E -- Yes --> F --> G --> H --> I --> J
E -- No --> K
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ballerina-integrator/trello-summary-email/.choreo/diagram.md` around lines 1
- 17, The Mermaid diagram is missing the code fence and flowchart direction
header so it won't render; wrap the existing nodes (A, B, C, ... K and the
arrows) in a fenced code block and add the Mermaid flowchart declaration (e.g.,
"mermaid" followed by "flowchart TD") before the nodes, then close the fenced
block at the end so the diagram (A --> B --> C ... E -- No --> K) renders
correctly.

Comment thread ballerina-integrator/trello-summary-email/connections.bal Outdated
Comment thread ballerina-integrator/trello-summary-email/functions.bal Outdated
Comment thread ballerina-integrator/trello-summary-email/Ballerina.toml Outdated
Comment thread ballerina-integrator/trello-summary-email/config.bal Outdated
Comment thread ballerina-integrator/trello-summary-email/.choreo/config-schema.json Outdated
Comment thread ballerina-integrator/trello-summary-email/.choreo/diagram.md Outdated
@hasathcharu

hasathcharu commented Mar 13, 2026

Copy link
Copy Markdown
Contributor

Prebuilt Integration Checklist

  • .github/workflows/projects.json is updated with the new prebuilt integration path
  • Path in the .github/workflows/projects.json matches the project path exactly
  • Directory path is identical to the integration name in Ballerina.toml
  • README.MD is correctly structured
  • Configurations are organized by records based on vendor
  • choreo/config-schema.json exists and is up to date
  • choreo/instructions.md is correctly structured
  • choreo/diagram.md is correctly written and parsable by Mermaid

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

🧹 Nitpick comments (2)
ballerina-integrator/trello-summary-email/.choreo/config-schema.json (2)

20-25: Consider adding minItems: 1 for boardIds to prevent silent no-op.

If a user provides an empty boardIds array, validation passes but the integration silently produces no output (no boards processed in the foreach loop). Adding a minimum constraint would fail validation early with a clear error.

Proposed fix
                "boardIds": {
                  "type": "array",
                  "items": {
                    "type": "string"
-                 }
+                 },
+                 "minItems": 1
                },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ballerina-integrator/trello-summary-email/.choreo/config-schema.json` around
lines 20 - 25, The schema property "boardIds" currently allows an empty array
which causes a silent no-op; update the config-schema.json entry for the
"boardIds" property to include "minItems": 1 so validation fails when no board
IDs are supplied. Locate the "boardIds" schema block (the object with "type":
"array" and its "items": {"type": "string"}) and add the "minItems": 1
constraint alongside those keys to ensure at least one board ID is provided.

40-40: Empty description strings provide no value.

Multiple description fields are set to empty strings (e.g., lines 40, 77, 108, 145). Consider either adding meaningful descriptions for documentation purposes or removing the empty description keys entirely.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ballerina-integrator/trello-summary-email/.choreo/config-schema.json` at line
40, Several JSON Schema "description" properties are empty strings (e.g., the
"description" keys shown in the diff); either remove those empty "description"
keys or replace them with meaningful text for documentation. Locate the empty
"description" properties in the config-schema.json (the JSON Schema properties
around the examples in the diff) and for each empty value either delete the
"description" entry or supply a concise explanatory string that describes the
purpose of the property.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@ballerina-integrator/trello-summary-email/.choreo/config-schema.json`:
- Around line 100-108: The schema for the filterConfig record incorrectly marks
all fields as required, which conflicts with config.bal where filterConfig has
defaults (labels, members, includeDueDateFilter, dueDateDaysAhead) and is
optional; update the config-schema.json by removing the "required" array for the
filterConfig object (or alternatively add matching "default" entries for each
property) so that providing only a subset of fields in filterConfig is valid at
runtime—look for the filterConfig object definition in config-schema.json and
align it with the defaults in config.bal.
- Around line 136-145: The JSON schema marks all summaryConfig fields as
required even though config.bal defines defaults for summaryConfig (fields
grouping, highlightOverdueCards, showCardAge, staleCardDays,
showAttachmentCount, showChecklistProgress); update the schema to either remove
the "required" array for summaryConfig so users can override single fields, or
add "default" entries for each property (grouping, highlightOverdueCards,
showCardAge, staleCardDays, showAttachmentCount, showChecklistProgress) to match
the defaults in config.bal; make the change in the config-schema.json block that
defines summaryConfig to keep schema and config.bal consistent.
- Around line 68-76: The schema in config-schema.json incorrectly marks
subjectPrefix and includeDateInSubject as required while config.bal provides
defaults for them; either remove "subjectPrefix" and "includeDateInSubject" from
the "required" array in config-schema.json to match config.bal, or add matching
"default" entries to their property definitions (e.g., default "Trello Cards
Summary" for subjectPrefix and default true for includeDateInSubject) so the
JSON schema and the defaults in config.bal remain consistent.

---

Nitpick comments:
In `@ballerina-integrator/trello-summary-email/.choreo/config-schema.json`:
- Around line 20-25: The schema property "boardIds" currently allows an empty
array which causes a silent no-op; update the config-schema.json entry for the
"boardIds" property to include "minItems": 1 so validation fails when no board
IDs are supplied. Locate the "boardIds" schema block (the object with "type":
"array" and its "items": {"type": "string"}) and add the "minItems": 1
constraint alongside those keys to ensure at least one board ID is provided.
- Line 40: Several JSON Schema "description" properties are empty strings (e.g.,
the "description" keys shown in the diff); either remove those empty
"description" keys or replace them with meaningful text for documentation.
Locate the empty "description" properties in the config-schema.json (the JSON
Schema properties around the examples in the diff) and for each empty value
either delete the "description" entry or supply a concise explanatory string
that describes the purpose of the property.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e02ec091-57d9-4997-83d2-f3f4f052e0ff

📥 Commits

Reviewing files that changed from the base of the PR and between ce4ed27 and 3698153.

📒 Files selected for processing (1)
  • ballerina-integrator/trello-summary-email/.choreo/config-schema.json

Comment on lines +68 to +76
"required": [
"apiKey",
"serverPrefix",
"listId",
"fromName",
"fromAddress",
"subjectPrefix",
"includeDateInSubject"
],

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 | 🟠 Major

Schema requires fields that have defaults in config.bal.

subjectPrefix and includeDateInSubject are marked required here, but config.bal declares them with default values ("Trello Cards Summary" and true). Users providing a minimal config without these fields will pass runtime validation but fail schema validation.

Either remove these from the required array to match config.bal behavior, or add default values to the schema properties.

Option 1: Remove from required array
              "required": [
                "apiKey",
                "serverPrefix",
                "listId",
                "fromName",
-               "fromAddress",
-               "subjectPrefix",
-               "includeDateInSubject"
+               "fromAddress"
              ],
Option 2: Add default values to properties
                "subjectPrefix": {
-                 "type": "string"
+                 "type": "string",
+                 "default": "Trello Cards Summary"
                },
                "includeDateInSubject": {
-                 "type": "boolean"
+                 "type": "boolean",
+                 "default": true
                }
📝 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
"required": [
"apiKey",
"serverPrefix",
"listId",
"fromName",
"fromAddress",
"subjectPrefix",
"includeDateInSubject"
],
"required": [
"apiKey",
"serverPrefix",
"listId",
"fromName",
"fromAddress"
],
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ballerina-integrator/trello-summary-email/.choreo/config-schema.json` around
lines 68 - 76, The schema in config-schema.json incorrectly marks subjectPrefix
and includeDateInSubject as required while config.bal provides defaults for
them; either remove "subjectPrefix" and "includeDateInSubject" from the
"required" array in config-schema.json to match config.bal, or add matching
"default" entries to their property definitions (e.g., default "Trello Cards
Summary" for subjectPrefix and default true for includeDateInSubject) so the
JSON schema and the defaults in config.bal remain consistent.

Comment on lines +100 to +108
},
"additionalProperties": false,
"required": [
"labels",
"members",
"includeDueDateFilter",
"dueDateDaysAhead"
],
"description": ""

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 | 🟠 Major

All filterConfig fields marked required despite having defaults.

In config.bal, all filterConfig fields have default values (labels = [], members = [], includeDueDateFilter = false, dueDateDaysAhead = 7), and the entire record is optional. However, if a user provides filterConfig to override just one field, the schema requires all fields be specified.

Remove the required array or add default values to align with runtime behavior.

Proposed fix: Remove required array
              "additionalProperties": false,
-             "required": [
-               "labels",
-               "members",
-               "includeDueDateFilter",
-               "dueDateDaysAhead"
-             ],
              "description": ""
📝 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
},
"additionalProperties": false,
"required": [
"labels",
"members",
"includeDueDateFilter",
"dueDateDaysAhead"
],
"description": ""
},
"additionalProperties": false,
"description": ""
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ballerina-integrator/trello-summary-email/.choreo/config-schema.json` around
lines 100 - 108, The schema for the filterConfig record incorrectly marks all
fields as required, which conflicts with config.bal where filterConfig has
defaults (labels, members, includeDueDateFilter, dueDateDaysAhead) and is
optional; update the config-schema.json by removing the "required" array for the
filterConfig object (or alternatively add matching "default" entries for each
property) so that providing only a subset of fields in filterConfig is valid at
runtime—look for the filterConfig object definition in config-schema.json and
align it with the defaults in config.bal.

Comment on lines +136 to +145
"additionalProperties": false,
"required": [
"grouping",
"highlightOverdueCards",
"showCardAge",
"staleCardDays",
"showAttachmentCount",
"showChecklistProgress"
],
"description": ""

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 | 🟠 Major

All summaryConfig fields marked required despite having defaults.

Same issue as filterConfig: in config.bal, all fields have defaults (grouping = LIST, highlightOverdueCards = true, etc.), and the entire record is optional. Users who want to override a single field must still provide all six.

Remove the required array or add default values to each property.

Proposed fix: Remove required array
              "additionalProperties": false,
-             "required": [
-               "grouping",
-               "highlightOverdueCards",
-               "showCardAge",
-               "staleCardDays",
-               "showAttachmentCount",
-               "showChecklistProgress"
-             ],
              "description": ""
📝 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
"additionalProperties": false,
"required": [
"grouping",
"highlightOverdueCards",
"showCardAge",
"staleCardDays",
"showAttachmentCount",
"showChecklistProgress"
],
"description": ""
"additionalProperties": false,
"description": ""
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ballerina-integrator/trello-summary-email/.choreo/config-schema.json` around
lines 136 - 145, The JSON schema marks all summaryConfig fields as required even
though config.bal defines defaults for summaryConfig (fields grouping,
highlightOverdueCards, showCardAge, staleCardDays, showAttachmentCount,
showChecklistProgress); update the schema to either remove the "required" array
for summaryConfig so users can override single fields, or add "default" entries
for each property (grouping, highlightOverdueCards, showCardAge, staleCardDays,
showAttachmentCount, showChecklistProgress) to match the defaults in config.bal;
make the change in the config-schema.json block that defines summaryConfig to
keep schema and config.bal consistent.

@anjanaed
anjanaed requested a review from hasathcharu March 13, 2026 07:29
Comment thread ballerina-integrator/trello-summary-email/.gitignore Outdated

Copilot AI 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.

Pull request overview

Adds a new prebuilt Ballerina integration (ballerina-integrator/trello-summary-email) that pulls Trello cards, formats a grouped HTML digest, and sends it as a Mailchimp campaign—intended to run as a Devant automation.

Changes:

  • Introduces Trello fetching/filtering/grouping logic and Mailchimp campaign creation/sending.
  • Adds configuration model + Choreo schema/docs (README + Devant/Choreo instructions + diagram).
  • Registers the new integration in the GitHub workflow projects list.

Reviewed changes

Copilot reviewed 13 out of 15 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
ballerina-integrator/trello-summary-email/types.bal Defines summary/grouping data types used across the integration.
ballerina-integrator/trello-summary-email/functions.bal Implements Trello fetch/filter/grouping, HTML generation, and Mailchimp send logic.
ballerina-integrator/trello-summary-email/automation.bal Orchestrates end-to-end “fetch → group → render → send” workflow.
ballerina-integrator/trello-summary-email/main.bal CLI entrypoint for manual runs (logs config + triggers automation).
ballerina-integrator/trello-summary-email/connections.bal Declares Trello/Mailchimp clients used by the integration.
ballerina-integrator/trello-summary-email/config.bal Defines configurable records for Trello/Mailchimp/filter/summary settings.
ballerina-integrator/trello-summary-email/Ballerina.toml Adds the new Ballerina package manifest for the integration.
ballerina-integrator/trello-summary-email/README.md Documents setup, configuration, and Devant deployment steps.
ballerina-integrator/trello-summary-email/.choreo/config-schema.json Adds Choreo/Devant configuration schema for the integration.
ballerina-integrator/trello-summary-email/.choreo/instructions.md Adds Devant-facing usage/setup instructions.
ballerina-integrator/trello-summary-email/.choreo/diagram.md Adds workflow diagram for the integration.
ballerina-integrator/trello-summary-email/.gitignore Ignores build outputs and local config/dependency files.
ballerina-integrator/trello-summary-email/agents.bal Placeholder file (currently empty).
ballerina-integrator/trello-summary-email/data_mappings.bal Placeholder file (currently empty).
.github/workflows/projects.json Registers the new integration path for CI/workflow processing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ballerina-integrator/trello-summary-email/functions.bal Outdated
Comment thread ballerina-integrator/trello-summary-email/functions.bal Outdated
Comment on lines +73 to +75
"fromAddress",
"subjectPrefix",
"includeDateInSubject"

Copilot AI Mar 24, 2026

Copy link

Choose a reason for hiding this comment

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

mailchimpConfig.subjectPrefix and mailchimpConfig.includeDateInSubject are marked as required in the schema, but the Ballerina mailchimpConfig record provides defaults for both. This mismatch forces users to set values that should be optional and contradicts the README. Either remove these fields from the schema's required list or drop the defaults so schema + runtime expectations align.

Suggested change
"fromAddress",
"subjectPrefix",
"includeDateInSubject"
"fromAddress"

Copilot uses AI. Check for mistakes.
Comment thread ballerina-integrator/trello-summary-email/.choreo/instructions.md Outdated
hasathcharu
hasathcharu previously approved these changes Mar 25, 2026
Comment thread ballerina-integrator/trello-summary-email/.choreo/diagram.md Outdated
Comment thread ballerina-integrator/trello-summary-email/automation.bal Outdated
Comment thread ballerina-integrator/trello-summary-email/config.bal Outdated
Comment thread ballerina-integrator/trello-summary-email/config.bal Outdated
anjanaed and others added 8 commits April 28, 2026 15:34
…a.json

Co-authored-by: Haritha Hasathcharu <42366642+hasathcharu@users.noreply.github.com>
Co-authored-by: Haritha Hasathcharu <42366642+hasathcharu@users.noreply.github.com>
Co-authored-by: Haritha Hasathcharu <42366642+hasathcharu@users.noreply.github.com>
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.

4 participants