Adds polymorphic relationships for Workspaces, Tokens, and RunTriggers#816
Adds polymorphic relationships for Workspaces, Tokens, and RunTriggers#816
Conversation
There was a problem hiding this comment.
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
|
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.