[BUG] Unable to update a project variable that is binded
Matroxt opened this issue · comments
Description
Using tenants.UpdateVariables(), I don't appear to be able to update the value of a given variable if it is binded.
Steps To Reproduce
- Create a project variable
- Set a value and bind that new variable to another one
- Try to update the value using the Golang SDK.
- I've been using
core.NewPropertyValue()
, thenUpdateVariables()
- I've been using
- Notice that the value didn't change.
Expected Behavior
The value is updated with the desired one.
Any Logs and/or Other Supporting Information
The SDK doesn't return any errors
Environment and/or Versions
- Octopus Server Version:
2022.3.10723
- Go Version:
go1.19.1 darwin/arm64
Hi @Matroxt ,
I have not being able to recreate your issue, but I have extended one of the tests to validate an update to a tenant variable with a binding syntax (#179). This is currently passing, but maybe I have not got the exact same scenario that you are having trouble with.
Are you able to provide a code example and an explanation of the setup that you are having trouble with?
Thanks
Hi,
I ended up circumventing the problem by first deleting the template ID with delete(vars.ProjectVariables[projID].Variables[envID], template.ID)
, pushing back vars
to Octopus, then updating the value and pushing it back to Octopus. Basically two UpdateVariables()
calls.
Probably not the answer you were looking for, but I don't have much time in this end of the year to figure out why it's not working, sorry about that.
We can close this if you want to avoid cluttering the issue board.