Skip to content

Commit fc8d4b9

Browse files
committed
updates so notifcations to certain repos only goto my announce channel so they dont floood regular notfications
1 parent cf080bf commit fc8d4b9

2 files changed

Lines changed: 36 additions & 19 deletions

File tree

CLAUDE.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ file_put_contents(__DIR__.'/../log/'.date('Ymd_His').'_'.$EventType
3838
json_encode($log, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES));
3939
// 3. Route by event type — $Builder->build() called before switch
4040
switch ($EventType) {
41-
case 'push': /* ... */ SendToChat('notifications', $Msg, $useRC, $useTeams); break;
42-
default: SendToChat('notifications', $Msg, $useRC, $useTeams); break;
41+
case 'push': /* ... */ SendToChat($channelName, $Msg, $useRC, $useTeams); break;
42+
default: SendToChat($channelName, $Msg, $useRC, $useTeams); break;
4343
}
4444
```
4545

@@ -49,6 +49,8 @@ switch ($EventType) {
4949
SendToChat(string $Where, array $Payload, bool $useRC = true, bool $useTeams = true): bool
5050
```
5151
- `$Where` maps to `$chatChannels['rocketchat'][$Where]` and `$chatChannels['teams'][$Where]`
52+
- Pre-switch sets `$channelName = 'notifications'` (or `'int-dev-announce'` for `sugarcraft/*` and `detain/scoop-emulators` / `detain/detain` / `detain/sugarcraft`); pass it as `$Where`
53+
- Pre-switch defaults: `$useRC = false`, `$useTeams = true` — set `$useRC = true` per-case to enable Rocket Chat
5254
- Teams payload wraps `$Payload['text']` in `['type' => 'message', 'message' => ...]`
5355
- Always set `$useRC`/`$useTeams` flags per-case; some repos skip Teams (see `issues` case)
5456

@@ -78,7 +80,6 @@ Each event type has a directory under `tests/events/{event_name}/` containing:
7880
- `JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES` on all `json_encode` calls in `web/github.php`
7981
- PHP CS Fixer enforces `@PSR2` + `@PHP74Migration`; run before committing
8082

81-
<!-- caliber:managed:pre-commit -->
8283
## Before Committing
8384

8485
Run `caliber refresh` before creating git commits to keep docs in sync with code changes.
@@ -87,11 +88,24 @@ After it completes, stage any modified doc files before committing:
8788
```bash
8889
caliber refresh && git add CLAUDE.md .claude/ .cursor/ .github/copilot-instructions.md AGENTS.md CALIBER_LEARNINGS.md 2>/dev/null
8990
```
90-
<!-- /caliber:managed:pre-commit -->
91-
92-
<!-- caliber:managed:learnings -->
9391
## Session Learnings
9492

9593
Read `CALIBER_LEARNINGS.md` for patterns and anti-patterns learned from previous sessions.
9694
These are auto-extracted from real tool usage — treat them as project-specific rules.
97-
<!-- /caliber:managed:learnings -->
95+
96+
<!-- caliber:managed:model-config -->
97+
## Model Configuration
98+
99+
Recommended default: `claude-sonnet-4-6` with high effort (stronger reasoning; higher cost and latency than smaller models).
100+
Smaller/faster models trade quality for speed and cost — pick what fits the task.
101+
Pin your choice (`/model` in Claude Code, or `CALIBER_MODEL` when using Caliber with an API provider) so upstream default changes do not silently change behavior.
102+
103+
<!-- /caliber:managed:model-config -->
104+
105+
<!-- caliber:managed:sync -->
106+
## Context Sync
107+
108+
This project uses [Caliber](https://github.com/caliber-ai-org/ai-setup) to keep AI agent configs in sync across Claude Code, Cursor, Copilot, and Codex.
109+
Configs update automatically before each commit via `caliber refresh`.
110+
If the pre-commit hook is not set up, run `/setup-caliber` to configure everything automatically.
111+
<!-- /caliber:managed:sync -->

web/github.php

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,15 @@
5858
//http_response_code(200);
5959
//exit;
6060

61-
62-
63-
$useRC = true;
61+
$useRC = false;
6462
$useTeams = true;
63+
$channelName = 'notifications'
64+
/* if (in_array($EventType, ['star', 'watch'])) {
65+
$useTeams = false;
66+
}*/
6567
if (explode('/', $RepositoryName)[0] == 'sugarcraft' || in_array($RepositoryName, ['detain/scoop-emulators', 'detain/detain', 'detain/sugarcraft'])) {
66-
$useTeams = false;
68+
$channelName = 'int-dev-announce';
69+
//$useTeams = false;
6770
}
6871
switch ($EventType) {
6972
case 'issues':
@@ -98,7 +101,7 @@
98101
}
99102

100103
$Msg['text'] = $ChatMsg;
101-
SendToChat('notifications', $Msg, $useRC, $useTeams);
104+
SendToChat($channelName, $Msg, $useRC, $useTeams);
102105
break;
103106

104107
case 'pull_request':
@@ -147,7 +150,7 @@
147150
}
148151

149152
$Msg['text'] = $ChatMsg;
150-
SendToChat('notifications', $Msg, $useRC, $useTeams);
153+
SendToChat($channelName, $Msg, $useRC, $useTeams);
151154
break;
152155

153156
case 'push':
@@ -187,7 +190,7 @@
187190
}
188191

189192
$Msg['text'] = $ChatMsg;
190-
SendToChat('notifications', $Msg, $useRC, $useTeams);
193+
SendToChat($channelName, $Msg, $useRC, $useTeams);
191194
break;
192195

193196
case 'check_suite':
@@ -211,7 +214,7 @@
211214
}
212215

213216
$Msg['text'] = $ChatMsg;
214-
//SendToChat('notifications', $Msg, $useRC, $useTeams);
217+
//SendToChat($channelName, $Msg, $useRC, $useTeams);
215218
break;
216219

217220
case 'workflow_run':
@@ -244,7 +247,7 @@
244247
}
245248

246249
$Msg['text'] = $ChatMsg;
247-
//SendToChat('notifications', $Msg, $useRC, $useTeams);
250+
//SendToChat($channelName, $Msg, $useRC, $useTeams);
248251
break;
249252
case 'gollum':
250253
$Pages = $Message['pages'] ?? [];
@@ -267,7 +270,7 @@
267270
. "on [{$RepositoryName}](https://github.com/{$RepositoryName}).";
268271
}
269272
$Msg['text'] = $ChatMsg;
270-
SendToChat('notifications', $Msg, $useRC, $useTeams);
273+
SendToChat($channelName, $Msg, $useRC, $useTeams);
271274
break;
272275

273276
case 'status':
@@ -296,7 +299,7 @@
296299
$ChatMsg .= "\n> _{$CommitMsg}_";
297300
}
298301
$Msg['text'] = $ChatMsg;
299-
SendToChat('notifications', $Msg, $useRC, $useTeams);
302+
SendToChat($channelName, $Msg, $useRC, $useTeams);
300303
break;
301304

302305
default:
@@ -305,7 +308,7 @@
305308
. "on [{$RepositoryName}](https://github.com/{$RepositoryName}).";
306309

307310
$Msg['text'] = $ChatMsg;
308-
SendToChat('notifications', $Msg, $useRC, $useTeams);
311+
SendToChat($channelName, $Msg, $useRC, $useTeams);
309312
break;
310313
}
311314
/*

0 commit comments

Comments
 (0)