Commit 87f6ed8
authored
feat: add default_org_member_roles to coderd_organization (#355)
<!-- Authored by Coder Agents on behalf of @Emyrk. -->
Refs
[PLAT-217](https://linear.app/codercom/issue/PLAT-217/rfc-for-gateway-accounts),
depends on coder/coder#25994.
Adds a `default_org_member_roles` set attribute to `coderd_organization`
so callers can override the deployment-wide default member roles per
organization.
- New attribute is Optional + Computed; omitting it leaves the
deployment defaults in place.
- Create flow follows the `workspace_sharing` precedent: post-create
`UpdateOrganization` PATCH when the user provides a value, since
`CreateOrganization` doesn't accept the field.
- Update flow plumbs the value through the existing `UpdateOrganization`
call as a `*[]string` so an unset attribute does not overwrite server
state.
- Bumps `coder/coder` to a SHA on the gateway-accounts stack and reacts
to coder/coder#24984, which migrated `UpdateTemplateMeta` fields from
values to optional pointers.
<details><summary>Agent context</summary>
- `internal/provider/organization_resource.go`: new field on the
resource model and schema, plus a `defaultOrgMemberRolesValueFromAPI`
helper that maps a nil slice to an empty set so the attribute always has
a known value.
- `internal/provider/organization_resource_test.go`: new acceptance step
under `enableExperimentalSteps` that sets the field to
`["organization-member", "organization-template-admin"]` and asserts
state. The happy-path test now enables the `minimum-implicit-member`
experiment alongside `workspace-sharing` since the server gates
non-default values behind it.
- `internal/provider/template_resource.go` and
`internal/provider/template_data_source_test.go`: react to
coder/coder#24984's pointer migration on `UpdateTemplateMeta`.
Mechanical conversions: `.ValueString()` becomes `.ValueStringPointer()`
etc., and `bool` literals get wrapped with `ptr.Ref(...)`.
- `docs/resources/organization.md`: regenerated via `make gen`.
</details>
---
<sub>Coder Agents on behalf of @Emyrk.</sub>1 parent f865ac1 commit 87f6ed8
3 files changed
Lines changed: 103 additions & 5 deletions
File tree
- docs/resources
- internal/provider
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
| |||
149 | 151 | | |
150 | 152 | | |
151 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
152 | 163 | | |
153 | 164 | | |
154 | 165 | | |
| |||
352 | 363 | | |
353 | 364 | | |
354 | 365 | | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
355 | 373 | | |
356 | 374 | | |
357 | 375 | | |
| |||
456 | 474 | | |
457 | 475 | | |
458 | 476 | | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
459 | 497 | | |
460 | 498 | | |
461 | 499 | | |
| |||
466 | 504 | | |
467 | 505 | | |
468 | 506 | | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
469 | 514 | | |
470 | 515 | | |
471 | 516 | | |
| |||
488 | 533 | | |
489 | 534 | | |
490 | 535 | | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
491 | 547 | | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
496 | 553 | | |
497 | 554 | | |
498 | 555 | | |
| |||
579 | 636 | | |
580 | 637 | | |
581 | 638 | | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
582 | 646 | | |
583 | 647 | | |
584 | 648 | | |
| |||
790 | 854 | | |
791 | 855 | | |
792 | 856 | | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
168 | 171 | | |
169 | 172 | | |
170 | 173 | | |
| |||
180 | 183 | | |
181 | 184 | | |
182 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
183 | 196 | | |
184 | 197 | | |
185 | 198 | | |
| |||
221 | 234 | | |
222 | 235 | | |
223 | 236 | | |
| 237 | + | |
| 238 | + | |
224 | 239 | | |
225 | 240 | | |
226 | 241 | | |
| |||
241 | 256 | | |
242 | 257 | | |
243 | 258 | | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
244 | 267 | | |
245 | 268 | | |
246 | 269 | | |
| |||
0 commit comments