Is there any way to retrieve the update ID via an ...
# automation-api
Is there any way to retrieve the update ID via an
after running
? The update ID is what I get returned from this platform REST call:{{.Organization}}/{{.Project}}/{{.Stack}}/updates?output-type=service&pageSize=10&page=1
There is a version field that is exposed via
pulumi stack history --json
Does that match up with the ID you're looking for? If so it would be easy to add that to update summary.
@lemon-agent-27707 yes, it is indeed that version field I’m after. How fast could you get that in in the Go Automation API? With that in place, I don’t need to do another call via the REST API to found out.
I am heads down on some other things this week unfortunately. Should be a simple change, just adding the field here (and a test) so it gets parsed out of the payload: Contributions welcome, otherwise open a bug and we can get it triaged.
@lemon-agent-27707 acceptance tests are all green on my PR. You mentioned to add a test. I could do it, but wouldn’t I be just testing the Go JSON deserialization?
The change looks great! Thanks for the contribution. Without a test of some sort, one must pull the branch, write an example, and manually verify that the field does indeed get populated. I agree that the value of a test here isn't massive, but it would be quite easy to add something along the lines of:
Copy code
assert.Greater(t, res.Summary.Version, 0)
To this test: