also looking at this
feat(events): one notification story — fire every declared event, trim setup to its real job
#1449
14 files
+308
-81
| @@ -1149,7 +1149,7 @@ const result = await migrator.migrateFromRenovate('renovate.json') | ||
| 1149 | 1149 | |
| 1150 | 1150 | ## Integration Ecosystem |
| 1151 | 1151 | |
| 1152 | Buddy includes an extensible plugin system that enables integrations with popular collaboration and project management tools. | |
| 1152 | Buddy includes a setup-time plugin system that notifies your collaboration tools when `buddy setup` completes. (Runtime events — scans, pull requests, merges — go through the `notifications` key in `buddy.config.ts` instead; that is the system a new integration should hook into.) | |
| 1153 | 1153 | |
| 1154 | 1154 | ### Built-in Integrations |
| 1155 | 1155 | |
| @@ -1167,8 +1167,7 @@ echo "https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK" > .buddy/slack-webhoo | ||
| 1167 | 1167 | |
| 1168 | 1168 | - Rich setup completion notifications |
| 1169 | 1169 | - Repository and project details |
| 1170 | - Error notifications for setup failures | |
| 1171 | - Configurable channel and username | |
| 1170 | - Reads the webhook from the env var, or from the `.buddy/slack-webhook` file | |
| 1172 | 1171 | |
| 1173 | 1172 | #### Discord Integration |
| 1174 | 1173 | |
| @@ -1214,8 +1213,7 @@ Create custom integrations by defining plugins in `.buddy/plugins/`: | ||
| 1214 | 1213 | "version": "1.0.0", |
| 1215 | 1214 | "enabled": true, |
| 1216 | 1215 | "triggers": [ |
| 1217 | { "event": "setup_complete" }, | |
| 1218 | { "event": "validation_error" } | |
| 1216 | { "event": "setup_complete" } | |
| 1219 | 1217 | ], |
| 1220 | 1218 | "hooks": [ |
| 1221 | 1219 | { |
| @@ -1240,13 +1238,14 @@ hooks run, and the plugin file chooses the URL. | ||
| 1240 | 1238 | |
| 1241 | 1239 | ### Plugin Events |
| 1242 | 1240 | |
| 1243 | | Event | Description | Context | | |
| 1244 | |-------|-------------|---------| | |
| 1245 | | `pre_setup` | Before setup begins | Initial configuration | | |
| 1246 | | `post_setup` | After setup completes | Full setup context | | |
| 1247 | | `step_complete` | After each setup step | Step-specific progress | | |
| 1248 | | `validation_error` | When validation fails | Error details and recovery | | |
| 1249 | | `setup_complete` | Final setup completion | Complete project context | | |
| 1241 | Setup fires exactly one event: **`setup_complete`**, once, when setup finishes | |
| 1242 | — in interactive and non-interactive runs alike. Triggers naming anything else | |
| 1243 | still load (files written against the retired `pre_setup` / `post_setup` / | |
| 1244 | `step_complete` / `validation_error` vocabulary are tolerated) but never fire. | |
| 1245 | ||
| 1246 | For runtime notifications — scans, pull requests, merges — use the | |
| 1247 | `notifications` key in `buddy.config.ts`: an exported webhook env var alone | |
| 1248 | does nothing at runtime. | |
| 1250 | 1249 | |
| 1251 | 1250 | ### Programmatic Usage |
| 1252 | 1251 | |