fix: sync changelog automation + harden Zapier integration#340
fix: sync changelog automation + harden Zapier integration#340
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThis PR consolidates changelog synchronization into the release workflow by adding a new Changes
Sequence Diagram(s)No sequence diagrams generated — changes are primarily refactoring, workflow configuration, and data updates rather than new multi-component interaction flows. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
…on't trigger cross-workflow runs) The sync-changelog.yml workflow triggered on `release: published`, but releases are published by github-actions[bot] using GITHUB_TOKEN. GitHub Actions intentionally suppresses workflow triggers from GITHUB_TOKEN to prevent infinite loops — so the sync never ran. Move the changelog sync into release.yml as a post-publish job. Also regenerate changelog.ts to catch up from v1.16.1 to v1.23.0. https://claude.ai/code/session_01HEBCxVf4bPGHmLdVyRcn1Q
- Extract direct db.select().from(monitorChanges) in zapier.ts into storage.getRecentChangesForMonitors() to follow the established data-access-through-storage pattern. - Replace (result as any).rowCount with .returning().length in deactivateAutomationSubscription for type safety. https://claude.ai/code/session_01HEBCxVf4bPGHmLdVyRcn1Q
After moving automation delivery before the conditions check (commit c08c3ed), the FAQ answer about conditions gating Zapier was wrong. Updated to reflect that Zapier fires on all real changes regardless of conditions. https://claude.ai/code/session_01HEBCxVf4bPGHmLdVyRcn1Q
18 tests covering SSRF validation, subscription limits, monitor ownership, deactivation, monitor listing, and Zod schema edge cases. https://claude.ai/code/session_01HEBCxVf4bPGHmLdVyRcn1Q
Main's notification.ts keeps conditions before automation delivery, so conditions DO gate Zapier triggers. Revert FAQ to match. https://claude.ai/code/session_01HEBCxVf4bPGHmLdVyRcn1Q
bb579c0 to
9b88766
Compare
Summary
The What's New page stopped updating after v1.16.1 because
sync-changelog.ymltriggered onrelease: published, but releases are published bygithub-actions[bot]usingGITHUB_TOKEN— GitHub intentionally suppresses cross-workflow triggers fromGITHUB_TOKENto prevent infinite loops. This PR moves the changelog sync inline intorelease.ymland regenerateschangelog.tsto catch up through v1.23.0.Additionally, this PR hardens the Zapier REST Hook integration (shipped in #336) with fixes found during security, architecture, skeptic, and documentation review phases.
Changes
Changelog automation fix
.github/workflows/release.yml— Addedsync-changelogjob that runs afterpublish-release(same workflow = no cross-workflow trigger needed).github/workflows/sync-changelog.yml— Removed deadrelease: publishedtrigger, keptworkflow_dispatchfor manual runsclient/src/data/changelog.ts— Regenerated with all 165 releases (v1.16.2–v1.23.0 were missing)Zapier integration hardening
server/storage.ts— Handle unique constraint race increateAutomationSubscription(catch23505, retry SELECT); use.returning()instead of(result as any).rowCount; addrecordAutomationDeliveryFailurewith circuit breaker (auto-deactivate after 5 consecutive failures)server/services/notification.ts— Move automation delivery before conditions/hasActiveChannels so Zapier fires on all real changes regardless of conditions; skip first-change baseline captures; restore hasActiveChannels early return to avoid unnecessary DB queriesserver/services/automationDelivery.ts— Auto-deactivate subscriptions on HTTP 410 Gone (Zapier REST Hook contract); record delivery failures via circuit breakerserver/routes/zapier.ts— Extract direct DB query tostorage.getRecentChangesForMonitors(); remove unused importsshared/schema.ts— AddconsecutiveFailurescolumn toautomationSubscriptionsserver/services/ensureTables.ts— Includeconsecutive_failuresin table DDLDocumentation
client/src/pages/Support.tsx— Fix FAQ: Zapier fires independently of alert conditions (not gated by them)Tests
server/routes/zapier.test.ts— 18 new tests for Zapier route logic (SSRF, limits, ownership, schemas)server/services/automationDelivery.test.ts— Added tests for 410 Gone auto-deactivation and circuit breaker failure recordingHow to test
/changelog— should show releases up to v1.23.0 (was stuck at v1.16.0)/api/v1/zapier/subscribewith same hookUrl — both should return 201 (idempotent), not 500npm run check && npm run test— 87 test files, 2130 tests passhttps://claude.ai/code/session_01HEBCxVf4bPGHmLdVyRcn1Q
Summary by CodeRabbit
Documentation
Chores