feat: add default_org_member_roles to coderd_organization#355
Draft
Emyrk wants to merge 1 commit into
Draft
Conversation
Emyrk
commented
Jun 5, 2026
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.
979b9c7 to
9a54ce7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs PLAT-217, depends on coder/coder#25994.
Adds a
default_org_member_rolesset attribute tocoderd_organizationso callers can override the deployment-wide default member roles per organization.workspace_sharingprecedent: post-createUpdateOrganizationPATCH when the user provides a value, sinceCreateOrganizationdoesn't accept the field.UpdateOrganizationcall as a*[]stringso an unset attribute does not overwrite server state.coder/coderto a SHA on the gateway-accounts stack and reacts to feat!: patchTemplateMeta to use optional fields coder#24984, which migratedUpdateTemplateMetafields from values to optional pointers.Agent context
internal/provider/organization_resource.go: new field on the resource model and schema, plus adefaultOrgMemberRolesValueFromAPIhelper 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 underenableExperimentalStepsthat sets the field to["organization-member", "organization-template-admin"]and asserts state. The happy-path test now enables theminimum-implicit-memberexperiment alongsideworkspace-sharingsince the server gates non-default values behind it.internal/provider/template_resource.goandinternal/provider/template_data_source_test.go: react to feat!: patchTemplateMeta to use optional fields coder#24984's pointer migration onUpdateTemplateMeta. Mechanical conversions:.ValueString()becomes.ValueStringPointer()etc., andboolliterals get wrapped withptr.Ref(...).docs/resources/organization.md: regenerated viamake gen.Coder Agents on behalf of @Emyrk.