Skip to content

feat: add organization resource #131

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

Merged
merged 19 commits into from
Nov 14, 2024
Merged

Conversation

aslilac
Copy link
Member

@aslilac aslilac commented Nov 5, 2024

No description provided.

@ethanndickson
Copy link
Member

ethanndickson commented Nov 6, 2024

I've got a bunch of boilerplate up on #49, feel free to steal and I'll close that PR. The test boilerplate and the member crud are probably the most useful

@aslilac
Copy link
Member Author

aslilac commented Nov 7, 2024

I've got a bunch of boilerplate up on #49, feel free to steal and I'll close that PR. The test boilerplate and the member crud are probably the most useful

oh rad! thank you, I hadn't noticed that PR!

@aslilac aslilac changed the title add organization resource feat: add organization resource Nov 7, 2024
@aslilac
Copy link
Member Author

aslilac commented Nov 7, 2024

I filled out the meat of this PR using your other branch as a reference. I'll work on the tests tomorrow–again basing off of your branch, but I want to try to use the statecheck package that you mentioned on the issue.

@aslilac aslilac marked this pull request as ready for review November 8, 2024 22:57
@aslilac
Copy link
Member Author

aslilac commented Nov 8, 2024

I've removed members from the org resource because I have some different ideas of how I want that to work. If it doesn't work out we can always go back to this, but in the meantime this is a solid bit that I'm definitely happy with.

Copy link
Member

@Emyrk Emyrk left a comment

Choose a reason for hiding this comment

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

LGTM 👍

I need to learn some of these terraform provider libs...

Copy link
Member

@ethanndickson ethanndickson left a comment

Choose a reason for hiding this comment

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

👍


var org codersdk.Organization
var err error
if data.ID.IsNull() {
Copy link
Member

@ethanndickson ethanndickson Nov 14, 2024

Choose a reason for hiding this comment

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

Your import test supplies a UUID into the name field, but Organization and OrganizationByName call the same endpoint, so I believe supporting imports by name will always allow you to import by ID? Hence why the import test is passing when it shouldn't. Setting the attributes at the bottom corrects the issue where the name is temporarily the UUID, so I don't think it's bug prone.

@aslilac aslilac merged commit 1ef2a69 into main Nov 14, 2024
13 checks passed
@aslilac aslilac deleted the lilac/add-organization-resource branch November 14, 2024 20:21
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