Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add coderd_organization data source #33

Merged
merged 1 commit into from
Jul 22, 2024

Conversation

ethanndickson
Copy link
Member

@ethanndickson ethanndickson commented Jul 17, 2024

Whilst not really part of the MVP, this makes managing groups through Terraform (such as for our integration tests) a lot nicer, since we can reference the default organisation as a data source.
It does, however, require bumping the coder version to v2.13.

@ethanndickson ethanndickson force-pushed the 07-17-feat_add_coderd_group_data_source branch from 29ca20a to 614c77f Compare July 17, 2024 07:57
@ethanndickson ethanndickson force-pushed the 07-17-feat_add_coderd_organization_data_source branch from f95a970 to 695f2f4 Compare July 17, 2024 07:57
@ethanndickson ethanndickson force-pushed the 07-17-feat_add_coderd_group_data_source branch from 614c77f to 393c5a9 Compare July 17, 2024 08:12
@ethanndickson ethanndickson force-pushed the 07-17-feat_add_coderd_organization_data_source branch from 695f2f4 to 7dc20eb Compare July 17, 2024 08:12
@ethanndickson ethanndickson marked this pull request as ready for review July 17, 2024 08:13
@ethanndickson
Copy link
Member Author

Failing CI is due to the v2.13 tag being deleted and recreated, see Slack.

},
"is_default": schema.BoolAttribute{
MarkdownDescription: "Whether the organization is the default organization of the deployment. This field will be populated if the organization is found by ID or name.",
Optional: true,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a comment on the UX of this in #34

Optional: true,
Computed: true,
},
"is_default": schema.BoolAttribute{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think is_default is going to become irrelevant very shortly, so we should just stick to ID and name since those will stick around. When orgs get actually released I don't think there will be a "default org" anymore as the concept only exists for placing users into the only existing org.

For now you should just allow id = "default" (rather than name = "default")

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though it'll be irrelevant shortly, we need to stick with it for the time being. Terraform will always complain if you try to set an attribute to a value that differs from what it was configured to. In this case, we'd need to have a special case to not write the actual ID of the org to the id attribute.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just going to keep the is_default for now, and we'll end up finalizing it with the rest of the organization implementation.

@ethanndickson ethanndickson force-pushed the 07-17-feat_add_coderd_group_data_source branch from 393c5a9 to 1894bd6 Compare July 18, 2024 13:26
@ethanndickson ethanndickson force-pushed the 07-17-feat_add_coderd_organization_data_source branch from 7dc20eb to 24a0fe9 Compare July 18, 2024 13:26
@ethanndickson ethanndickson force-pushed the 07-17-feat_add_coderd_group_data_source branch from 1894bd6 to 355058d Compare July 18, 2024 13:50
@ethanndickson ethanndickson force-pushed the 07-17-feat_add_coderd_organization_data_source branch from 24a0fe9 to 962336f Compare July 18, 2024 13:50
@ethanndickson ethanndickson force-pushed the 07-17-feat_add_coderd_group_data_source branch from 355058d to bef1946 Compare July 19, 2024 12:39
@ethanndickson ethanndickson force-pushed the 07-17-feat_add_coderd_organization_data_source branch from 962336f to adb48de Compare July 19, 2024 12:40
@ethanndickson ethanndickson force-pushed the 07-17-feat_add_coderd_group_data_source branch from bef1946 to 62ed2be Compare July 19, 2024 12:42
@ethanndickson ethanndickson force-pushed the 07-17-feat_add_coderd_organization_data_source branch 2 times, most recently from e313323 to 63f4357 Compare July 19, 2024 12:44
@ethanndickson ethanndickson changed the base branch from 07-17-feat_add_coderd_group_data_source to main July 19, 2024 12:44
@ethanndickson ethanndickson force-pushed the 07-17-feat_add_coderd_organization_data_source branch from 63f4357 to ae0d572 Compare July 19, 2024 12:45
@ethanndickson ethanndickson force-pushed the 07-17-feat_add_coderd_organization_data_source branch from ae0d572 to aa86273 Compare July 22, 2024 12:59
@ethanndickson ethanndickson merged commit 17513d7 into main Jul 22, 2024
13 checks passed
@deansheather deansheather deleted the 07-17-feat_add_coderd_organization_data_source branch July 26, 2024 07:15
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.

3 participants