Add prebuilt integration to send Trello summary emails via Mailchimp - #59
Add prebuilt integration to send Trello summary emails via Mailchimp #59anjanaed wants to merge 18 commits into
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a new Ballerina integration project Changes
Sequence DiagramsequenceDiagram
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
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
summaryConfigfields are marked as required, butconfig.bal(lines 26-33) defines defaults for all of them. The entiresummaryConfigblock 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
filterConfigfields (labels,members,includeDueDateFilter,dueDateDaysAhead) are marked as required in the schema, butconfig.bal(lines 17-24) defines defaults for all of them (empty arrays,false, and7). This forces users to explicitly specify these values even when the defaults are acceptable.Consider removing these from the
requiredarray 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:subjectPrefixandincludeDateInSubjectare required but have Ballerina defaults.Per
config.bal(lines 7-8),subjectPrefixdefaults to"Trello Cards Summary"andincludeDateInSubjectdefaults totrue. 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) orpostCampaignsIdActionsSend(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
deleteCampaignsIdis 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
📒 Files selected for processing (15)
.github/workflows/projects.jsonballerina-integrator/trello-summary-email/.choreo/config-schema.jsonballerina-integrator/trello-summary-email/.choreo/diagram.mdballerina-integrator/trello-summary-email/.choreo/instructions.mdballerina-integrator/trello-summary-email/.gitignoreballerina-integrator/trello-summary-email/Ballerina.tomlballerina-integrator/trello-summary-email/README.mdballerina-integrator/trello-summary-email/agents.balballerina-integrator/trello-summary-email/automation.balballerina-integrator/trello-summary-email/config.balballerina-integrator/trello-summary-email/connections.balballerina-integrator/trello-summary-email/data_mappings.balballerina-integrator/trello-summary-email/functions.balballerina-integrator/trello-summary-email/main.balballerina-integrator/trello-summary-email/types.bal
| { | ||
| "type": "" | ||
| } |
There was a problem hiding this comment.
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.
| 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 |
There was a problem hiding this comment.
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.
| 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.
|
Prebuilt Integration Checklist
|
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (2)
ballerina-integrator/trello-summary-email/.choreo/config-schema.json (2)
20-25: Consider addingminItems: 1forboardIdsto prevent silent no-op.If a user provides an empty
boardIdsarray, 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
descriptionfields are set to empty strings (e.g., lines 40, 77, 108, 145). Consider either adding meaningful descriptions for documentation purposes or removing the emptydescriptionkeys 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
📒 Files selected for processing (1)
ballerina-integrator/trello-summary-email/.choreo/config-schema.json
| "required": [ | ||
| "apiKey", | ||
| "serverPrefix", | ||
| "listId", | ||
| "fromName", | ||
| "fromAddress", | ||
| "subjectPrefix", | ||
| "includeDateInSubject" | ||
| ], |
There was a problem hiding this comment.
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.
| "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.
| }, | ||
| "additionalProperties": false, | ||
| "required": [ | ||
| "labels", | ||
| "members", | ||
| "includeDueDateFilter", | ||
| "dueDateDaysAhead" | ||
| ], | ||
| "description": "" |
There was a problem hiding this comment.
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.
| }, | |
| "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.
| "additionalProperties": false, | ||
| "required": [ | ||
| "grouping", | ||
| "highlightOverdueCards", | ||
| "showCardAge", | ||
| "staleCardDays", | ||
| "showAttachmentCount", | ||
| "showChecklistProgress" | ||
| ], | ||
| "description": "" |
There was a problem hiding this comment.
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.
| "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.
There was a problem hiding this comment.
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.
| "fromAddress", | ||
| "subjectPrefix", | ||
| "includeDateInSubject" |
There was a problem hiding this comment.
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.
| "fromAddress", | |
| "subjectPrefix", | |
| "includeDateInSubject" | |
| "fromAddress" |
…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>
a820ebd to
7c0e8fa
Compare
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
Summary by CodeRabbit
New Features
Documentation
Chores