feat: migrate Newsletter Service#3505
feat: migrate Newsletter Service#3505princerajpoot20 wants to merge 18 commits intoasyncapi:masterfrom
Conversation
initial migration setup
📝 WalkthroughWalkthroughReplaces Mailchimp-based newsletter delivery with a Kit.com integration: removes Mailchimp module and dependency, adds a Kit broadcast helper and updated HTML template, and updates the GitHub Actions workflow to invoke the new Kit helper and use updated action versions and secrets. Changes
Sequence Diagram(s)sequenceDiagram
actor GHA as GitHub Actions
participant Loader as Event Loader
participant KitHelper as Kit Helper
participant KitAPI as Kit.com API
GHA->>Loader: listEvents()
Loader-->>GHA: events[]
alt no events
GHA->>GHA: Log "no events" and exit
else events found
GHA->>KitHelper: invoke helper with events
KitHelper->>KitHelper: validate KIT_API_KEY & KIT_MEETINGS_TAG_ID
KitHelper->>KitHelper: compute send_at (next day 11:00 UTC)
KitHelper->>KitHelper: build HTML content from events
KitHelper->>KitAPI: POST /v4/broadcasts (X-Kit-Api-Key, payload)
KitAPI-->>KitHelper: 2xx / error response
alt success
KitHelper->>GHA: Log scheduled
else failure
KitHelper->>GHA: core.setFailed(error)
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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: 2
🧹 Nitpick comments (1)
.github/workflows/send-events-newsletter.yml (1)
19-19: Consider upgrading Node.js version.Node.js 16 reached end-of-life in September 2023 and no longer receives security updates. Consider upgrading to Node.js 20 (LTS) for continued support and security patches.
⬆️ Proposed fix
with: - node-version: 16 + node-version: 20🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/send-events-newsletter.yml at line 19, The workflow currently pins the runner's Node version using the YAML key node-version: 16; update that value to the current LTS (node-version: 20) to restore security patches and support, then run CI locally or via the workflow to confirm no breaking changes; also search for other references to node-version: 16 (e.g., in job matrices or setup-node steps) and update them and any docs or action inputs that mention Node 16.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/create-event-helpers/kit/index.js:
- Around line 10-11: The code currently assigns MEETINGS_TAG_ID =
Number(process.env.KIT_MEETINGS_TAG_ID) and uses KIT_API_KEY without checks; add
explicit validation at module startup to ensure process.env.KIT_MEETINGS_TAG_ID
exists and parses to a finite number (otherwise throw/exit with a clear message)
and ensure process.env.KIT_API_KEY is present (otherwise throw/exit with a clear
message); reference the constants KIT_BASE, MEETINGS_TAG_ID and the environment
variables KIT_MEETINGS_TAG_ID and KIT_API_KEY when implementing the checks so
failures are descriptive and prevent silent NaNs or unauthenticated calls.
In @.github/workflows/send-events-newsletter.yml:
- Line 26: Update the GitHub Actions step that references the action identifier
"actions/github-script@v6" to use "actions/github-script@v7" so the workflow
matches other repos and uses the newer runner; locate the uses: entry in the
send-events-newsletter workflow (the line containing actions/github-script@v6)
and replace the version tag with `@v7`, then commit and verify the workflow runs
correctly.
---
Nitpick comments:
In @.github/workflows/send-events-newsletter.yml:
- Line 19: The workflow currently pins the runner's Node version using the YAML
key node-version: 16; update that value to the current LTS (node-version: 20) to
restore security patches and support, then run CI locally or via the workflow to
confirm no breaking changes; also search for other references to node-version:
16 (e.g., in job matrices or setup-node steps) and update them and any docs or
action inputs that mention Node 16.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 5452683b-983c-41a4-812e-9f8487690065
⛔ Files ignored due to path filters (1)
.github/workflows/create-event-helpers/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (5)
.github/workflows/create-event-helpers/kit/htmlContent.js.github/workflows/create-event-helpers/kit/index.js.github/workflows/create-event-helpers/mailchimp/index.js.github/workflows/create-event-helpers/package.json.github/workflows/send-events-newsletter.yml
💤 Files with no reviewable changes (2)
- .github/workflows/create-event-helpers/package.json
- .github/workflows/create-event-helpers/mailchimp/index.js
|
|
@asyncapi/bounty_team |



Related #2223 asyncapi/website#5127
Related PRs: asyncapi/.github#396 asyncapi/website#5292
Things need to be done before merge
Testing Evidence
Workflow run link on the forked repo. Looks good.
https://github.com/princerajpoot20/community/actions/runs/23986091777/job/69958173123
Email scheduled successfully.
Summary by CodeRabbit