Commit 49152ef
committed
Mattermost UI bridge: source filter + legacy backfill
PR archi-physics#543 already plumbed Mattermost conversations into the cross-source
list query, surfaced archi_service in the API response, and added the
sidebar badge. This PR fills the two remaining gaps:
scripts/backfill_mattermost_archi_service.py
Idempotent backfill for deployments that ran the Mattermost service
pre-PR-543. Heuristic: any conversation_metadata row whose client_id
matches 'mm_user_%' was created by ThreadContextManager and should
have archi_service = 'mattermost'. Defaults to dry-run; --apply
performs the UPDATE. Prints a sample of affected rows in either
mode so operators can sanity-check before applying.
src/interfaces/chat_app/app.py:list_conversations
Accept an optional ?source=all|chat|mattermost|api query parameter.
Rejects unknown values with a 400. Filters post-fetch so the
existing cross-source SQL stays unchanged. Also replaces a stray
print() error path with logger.error().
tests/unit/test_list_conversations_source_filter.py
10 cases covering the filter behaviour and validator. Uses a
pure-Python replica of the inline filter so no Flask/Postgres is
needed in CI.1 parent 59e6bcc commit 49152ef
3 files changed
Lines changed: 223 additions & 3 deletions
File tree
- scripts
- src/interfaces/chat_app
- tests/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5159 | 5159 | | |
5160 | 5160 | | |
5161 | 5161 | | |
| 5162 | + | |
| 5163 | + | |
5162 | 5164 | | |
5163 | 5165 | | |
5164 | | - | |
| 5166 | + | |
| 5167 | + | |
5165 | 5168 | | |
5166 | 5169 | | |
5167 | 5170 | | |
5168 | 5171 | | |
5169 | 5172 | | |
5170 | 5173 | | |
5171 | 5174 | | |
| 5175 | + | |
| 5176 | + | |
| 5177 | + | |
| 5178 | + | |
| 5179 | + | |
| 5180 | + | |
5172 | 5181 | | |
5173 | 5182 | | |
5174 | 5183 | | |
| |||
5184 | 5193 | | |
5185 | 5194 | | |
5186 | 5195 | | |
| 5196 | + | |
| 5197 | + | |
| 5198 | + | |
5187 | 5199 | | |
5188 | 5200 | | |
5189 | 5201 | | |
5190 | 5202 | | |
5191 | 5203 | | |
5192 | | - | |
| 5204 | + | |
5193 | 5205 | | |
5194 | 5206 | | |
5195 | 5207 | | |
| |||
5201 | 5213 | | |
5202 | 5214 | | |
5203 | 5215 | | |
5204 | | - | |
| 5216 | + | |
5205 | 5217 | | |
5206 | 5218 | | |
5207 | 5219 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
0 commit comments