Variable references and safe deletion/renaming of variables
It would be nice if we could track the usage of project or global variables . They can be anywhere and there is nothing worst than having deployment time errors. Having references of the variables would allow variable renaming and safe deletion.

-
Jakub Januszkiewicz commented
https://octopusdeploy.uservoice.com/forums/170787-general/suggestions/6846954-find-variable-usage-across-all-projects-and-variab was closed with a limited implementation (tracking variable *sets* only). I'm copying my last response from that suggestion here, in hope that the Octopus Team will reconsider implementing this.
This is a small step forward, but it's not what was asked here. This request is specifically about variables, not variable sets, it even mentions sample use cases.
In my view, even if the usage report for a variable was incomplete, it would still be a killer feature.
Can you please support at least finding variable usage in the places that Octopus has control over, such as:
1. in any place where variable binding is supported, for example and especially:
- in default values of parameters in custom step templates,
- in parameter values when step templates are used in project process,
- in package references,
2. in scripts (e.g. for Powershell scripts I'd like it to find occurences of $OctopusParameters['My.Variable.Name']),
3. in other variables (e.g. when I have a variable Foo with value "Foo.#{Bar}" I would like the usage of variable Bar to show that it is used by variable Foo; I'm not sure if this is technically the same as 1).I understand you won't be able to find everything, but actually the only truly problematic thing I can think of is the example you gave: files sourced from packages. What other places are there that Octopus has no control over and cannot check? The "variables usages are embedded in strings" argument you give is not clear to me - do you mean the point #3 above? Why would that be a problem, it sounds like an easy thing to check.
You could put a big fat warning in the UI, so that everyone is aware that there are limitations of this feature, but I still think that the 3 points I listed above would cover a vast majority of use cases.
-
Tim May commented
Is this suggestion a duplicate of this one:
https://octopusdeploy.uservoice.com/forums/170787-general/suggestions/6846954-find-variable-usage-across-all-projects-and-variabAlso admins - I inadvertently flagged this as 'innappropirate' as opposed to 'duplicate'.
-
Karl commented
we also really badly need something related to version control for variables. With 140 projects we got bit quite often with someone inadvertently changing a variable in library step for 1 project and hosing another 3. Of course the devs never store old values anywhere... because "their stuff" is stored in git so its up to me to track down original value. Even thought they are all well aware of the issue it still pops up monthly. Its driving me nuts and this issue made it all the way to our CIO.
-
Keith Ramsey commented
I have been building this project of mine and I keep getting bit in the butt with what I see as a great limitation.
I have a step that sets a variable for Octopus to see in subsequent steps. I then have a subsequent step that uses that variable which includes its step name in the variable when I set it in the subsequent step.
Whenever I change a step's name, either one of two things happen:
1. Either I’m brilliant, or I magically remember that a subsequent step uses that step name and I remember which step that uses that variable and I fix it. (Actual occurrences of brilliance are disappointingly low.)
2. Or, what happens more often is that I forget that a subsequent step uses a variable with the step name of a previous step. My project fails an execution, and I have to hunt to find what happened.
I really need to remove the dependency to this problem. I know you can give me workarounds like putting variables in NuGet files and whatnot, but honestly, I want to structure my code and project the way I want to, and I don’t think I’m being too eccentric in wanting this.
Can someone please address it? I'd suggest giving a step a unique ID or something that allow me to move steps around, and rename steps.
Thanks for your consideration!
Keith