Commit 44678dc
committed
feat(coderd): org-scope chat model config schema
Stage 1 of CODAGT-709: chat_model_configs gains organization_id
(FK organizations, ON DELETE CASCADE) backfilled to the default org,
plus inert group_acl/user_acl jsonb columns seeded with the
everyone-in-org read entry. The single-default partial unique index
moves from ON ((1)) to ON (organization_id) with its predicate
unchanged, and an org lookup index is added.
Runtime behavior stays deployment-wide: the chatd default-config
cache is keyed by org with a default-org fallback (removed at the
cutover), old create/update/delete handlers pin every write to the
default org, and authorization checks are unchanged. The per-org
query variants (GetDefaultChatModelConfig, UnsetDefaultChatModelConfigs,
GetEnabledChatModelConfigsByOrg) are consumed by chatd so orgs stop
leaking into each other's resolution once rows diverge at the
explosion stage.
Refs CODAGT-7091 parent d57965e commit 44678dcCopy full SHA for 44678dc
30 files changed
+1,374-202Lines changed: 1374 additions & 202 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- coderd
- database
- dbauthz
- dbgen
- dbmetrics
- dbmock
- migrations
- testdata/fixtures
- queries
- x/chatd
Expand file treeCollapse file tree
Open diff view settings
Collapse file
coderd/database/check_constraint.go
Copy file name to clipboardExpand all lines: coderd/database/check_constraint.go+2Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file
coderd/database/dbauthz/dbauthz.go
Copy file name to clipboardExpand all lines: coderd/database/dbauthz/dbauthz.go+17-6Lines changed: 17 additions & 6 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
790 | 790 | |
791 | 791 | |
792 | 792 | |
| 793 | + |
| 794 | + |
| 795 | + |
| 796 | + |
793 | 797 | |
794 | 798 | |
795 | 799 | |
| ||
3743 | 3747 | |
3744 | 3748 | |
3745 | 3749 | |
3746 | | - |
| 3750 | + |
3747 | 3751 | |
3748 | | - |
3749 | | - |
| 3752 | + |
| 3753 | + |
3750 | 3754 | |
3751 | 3755 | |
3752 | 3756 | |
3753 | 3757 | |
3754 | 3758 | |
3755 | 3759 | |
3756 | | - |
| 3760 | + |
3757 | 3761 | |
3758 | 3762 | |
3759 | 3763 | |
| ||
3802 | 3806 | |
3803 | 3807 | |
3804 | 3808 | |
| 3809 | + |
| 3810 | + |
| 3811 | + |
| 3812 | + |
| 3813 | + |
| 3814 | + |
| 3815 | + |
3805 | 3816 | |
3806 | 3817 | |
3807 | 3818 | |
| ||
7254 | 7265 | |
7255 | 7266 | |
7256 | 7267 | |
7257 | | - |
| 7268 | + |
7258 | 7269 | |
7259 | 7270 | |
7260 | 7271 | |
7261 | | - |
| 7272 | + |
7262 | 7273 | |
7263 | 7274 | |
7264 | 7275 | |
|
Collapse file
coderd/database/dbauthz/dbauthz_test.go
Copy file name to clipboardExpand all lines: coderd/database/dbauthz/dbauthz_test.go+13-4Lines changed: 13 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1130 | 1130 | |
1131 | 1131 | |
1132 | 1132 | |
1133 | | - |
1134 | | - |
| 1133 | + |
| 1134 | + |
1135 | 1135 | |
1136 | 1136 | |
1137 | 1137 | |
| ||
1257 | 1257 | |
1258 | 1258 | |
1259 | 1259 | |
| 1260 | + |
| 1261 | + |
| 1262 | + |
| 1263 | + |
| 1264 | + |
| 1265 | + |
| 1266 | + |
| 1267 | + |
1260 | 1268 | |
1261 | 1269 | |
1262 | 1270 | |
| ||
1580 | 1588 | |
1581 | 1589 | |
1582 | 1590 | |
1583 | | - |
1584 | | - |
| 1591 | + |
| 1592 | + |
| 1593 | + |
1585 | 1594 | |
1586 | 1595 | |
1587 | 1596 | |
|
Collapse file
coderd/database/dbgen/dbgen.go
Copy file name to clipboardExpand all lines: coderd/database/dbgen/dbgen.go+21Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
178 | 178 | |
179 | 179 | |
180 | 180 | |
| 181 | + |
| 182 | + |
| 183 | + |
| 184 | + |
| 185 | + |
| 186 | + |
| 187 | + |
| 188 | + |
| 189 | + |
| 190 | + |
| 191 | + |
| 192 | + |
| 193 | + |
| 194 | + |
| 195 | + |
| 196 | + |
| 197 | + |
| 198 | + |
181 | 199 | |
182 | 200 | |
183 | 201 | |
| ||
189 | 207 | |
190 | 208 | |
191 | 209 | |
| 210 | + |
| 211 | + |
| 212 | + |
192 | 213 | |
193 | 214 | |
194 | 215 | |
|
Collapse file
coderd/database/dbmetrics/querymetrics.go
Copy file name to clipboardExpand all lines: coderd/database/dbmetrics/querymetrics.go+12-4Lines changed: 12 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file
coderd/database/dbmock/dbmock.go
Copy file name to clipboardExpand all lines: coderd/database/dbmock/dbmock.go+23-8Lines changed: 23 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file
+12-2Lines changed: 12 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file
coderd/database/foreign_key_constraint.go
Copy file name to clipboardExpand all lines: coderd/database/foreign_key_constraint.go+1Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file
coderd/database/migrations/000554_chat_model_config_organization.down.sql
Copy file name to clipboard+14Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
0 commit comments