-
Notifications
You must be signed in to change notification settings - Fork 102
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
Adds polymorphic relationships for Workspaces, Tokens, and RunTriggers #816
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems great. I know it's "do not merge," but I'll register my approval for future reference.
If you're really feeling fired up, the one polymorphic relation that I REALLY got bit by lacking in the past was Workspace.LockedBy
. I wanted to use it to give a more reliable error description when building out the saved cloud plans apply action in terraform core, but had to give up and give a "usually probably right" error instead.
I think the options for locked-by are user/team/run -- org token can't lock a workspace.
e55c49a
to
4bf9c38
Compare
@nfagerlund What a stroke of luck! Adding |
🙌🏼!! (I had a hunch aiming it at something I tried to use in anger would turn up something interesting 😅) |
e090626
to
a78dac9
Compare
`LockedBy` and `CreatedBy` are new fields, but deprecates `Sourceable` on the `RunTrigger` model
a78dac9
to
c618384
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 -- Awesome work!
Reminder to the contributor that merged this PR: if your changes have added important functionality or fixed a relevant bug, open a follow-up PR to update CHANGELOG.md with a note on your changes. |
This PR adds support for polymorphic fields that already exist in the API to Workspaces (locked-by), AuthenticationTokens (created-by), and RunTriggers (sourceable)
The purpose is to illustrate how the underlying jsonapi feature is used in go-tfe and also to run the upstream PR against a more elaborate test suite.
It uses this dependency PR so that should be merged and released before this PR is merged.