Skip to content

feat: add default_org_member_roles to coderd_organization#355

Draft
Emyrk wants to merge 1 commit into
mainfrom
feat/org-default-member-roles
Draft

feat: add default_org_member_roles to coderd_organization#355
Emyrk wants to merge 1 commit into
mainfrom
feat/org-default-member-roles

Conversation

@Emyrk
Copy link
Copy Markdown
Member

@Emyrk Emyrk commented Jun 5, 2026

Refs PLAT-217, 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 feat!: patchTemplateMeta to use optional fields coder#24984, which migrated UpdateTemplateMeta fields from values to optional pointers.
Agent context
  • 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 feat!: patchTemplateMeta to use optional fields 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.

Coder Agents on behalf of @Emyrk.

@linear-code
Copy link
Copy Markdown

linear-code Bot commented Jun 5, 2026

PLAT-217

Comment thread internal/provider/organization_resource.go Outdated
Comment thread internal/provider/organization_resource.go Outdated
Adds a new `default_org_member_roles` set attribute to the `coderd_organization`
resource so callers can override the deployment-wide default member roles per
organization. The attribute is set after `CreateOrganization` (the create
endpoint doesn't accept it) and through `UpdateOrganization` thereafter.

Also bumps coder/coder to a SHA that contains the gateway-accounts stack
(coder/coder#25994) and reacts to coder/coder#24984, which migrated
UpdateTemplateMeta fields from values to optional pointers.
@Emyrk Emyrk force-pushed the feat/org-default-member-roles branch from 979b9c7 to 9a54ce7 Compare June 5, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant