Giter VIP home page Giter VIP logo

Comments (4)

uturunku1 avatar uturunku1 commented on August 17, 2024 1

I have an update on this issue. The change you suggested will be included as part of this PR: https://github.com/hashicorp/go-tfe/pull/294/files . So no need to open a separate PR. Thank you for offering the help though!

from go-tfe.

uturunku1 avatar uturunku1 commented on August 17, 2024

@rmadamanchi Hi and thank you for bringing this up! If you are interested in working on this change, we definitely welcome your initiative. As you are making your changes and if you need assistance, please feel free to ping me directly on your PR and I'll come to your help! Does that sound good?

from go-tfe.

alex-ikse avatar alex-ikse commented on August 17, 2024

You have added the include field for locked-by, but not changed the jsonapi struct model to read the LockedBy relationship. So this relationship is unusable

from go-tfe.

nfagerlund avatar nfagerlund commented on August 17, 2024

Previous commenter is correct โ€”ย this is still an outstanding omission from the API! In fact, I just ran into a situation in Terraform's cloud integration where I needed it and couldn't have it. ๐Ÿ˜… I'm going to re-open this, and make sure it gets a dupe on our jira board.

A notable difficulty with implementing this: locked_by is a polymorphic relationship in the API, and can be one of:

  • Team
  • User
  • Run
  • empty

(I just checked, and yes, org tokens are not allowed to lock a workspace, they get 404 even if they can read the ws.)

So, the actual value of the LockedBy relationship field on the struct will probably have to be a new "faked-up sum type", similar to what I was doing with cloud plan files in Terraform core:

  • Struct with three private fields, one for each concrete type.
  • Three getter methods that return something like (*tfe.User, bool), to push users to check the ok value before trying to interact with the returned value.
  • Workspace LockedBy field has a nil pointer for the whole shebang if it ain't locked.

from go-tfe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.