ScopeSpecification.Rank() replacement?

Recently (November 2019) the ScopeSpecification.Rank() method in Octopus.Client was flagged as deprecated. The linked documentation in the deprecation message doesn’t do a good job of explaining what I can use to replace it.

We have logic to look at the variables, determine which ones might apply (based on environment/step/roles), and then sort by ScopeSpecification.Rank() to determine which value will be applied when deploying

Does Octopus have an API I can call to determine what a variable value will be for a given step/machine/environment at deploy time? If not, how am I supposed to replace the Rank() call to determine this?

1 Like

Hey Andrew,

I’ve reached out to our engineering team to get the context behind marking that method as Obsolete. I’ll get back to you with that information.

In the meantime, would you mind sharing a little more about your scenario? What are you trying to achieve?

There is the variable preview page in the project in Octopus:

How close is this to what you want?

We have our own UI sitting in front of Octopus for users to approve deploys to production (by calling the Octopus API). The deploy path for a certain component is kept as a variable in Octopus. The UI looks up the value of that variable in test and production; inspects the contents of those two paths; and then warns the user before deploying to prod if the deployment is going to restart a specific service.

Unfortunately, since these variables are scoped to roles, that screen doesn’t give us the information we need.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.