Filter and Variable scoping issue

paul.farry's Avatar

paul.farry

11 Sep, 2017 02:46 AM

I'm trying to understand if I've encountered a bug or if it's mean't to be as designed.

Lets assume I have 3 environments. Dev, Test, Prod (The number really doesn't matter)

I have a variable

MyVariable = avalue (No Scope) and Save.

Now I go to the filter in the Project Variables and Select Scope and Choose "DEV"

MyVariable is displayed.

Now if I edit the Variable and set it's Scope to "DEV" and Save.

Now I go to the filter in the Project Variables and Select Scope and Choose "DEV"

MyVariable is displayed.

If I now go and edit the Variable one final time and Remove the Scope (X) and Save

Now I go to the filter in the Project Variables and Select Scope and Choose "DEV"

MyVariable is not displayed.

The only way to get this variable to show again is to delete it and create it again without ever having the scope applied.

Is this behaviour as expected?

  1. Support Staff 1 Posted by Kenneth Bates on 12 Sep, 2017 01:01 AM

    Kenneth Bates's Avatar

    Hi Paul,

    Thanks for getting in touch! I'm sorry you're hitting this unexpected behavior. Changing the scope on variables shouldn't prevent the variable from being displayed. I haven't been able to reproduce this, however I'm not positive I fully understand what you're seeing. Could you provide some more information to ensure I test this accurately?

    Would you be able to attach screenshots or a gif showing this behavior in action?
    It could also come down to this user's permissions. Could you provide an export of the permissions for this specific user as described in the following doc page?
    https://octopus.com/docs/administration/managing-users-and-teams/us...

    I look forward to getting to the bottom of this one. :)

    Kind regards,

    Kenny

  2. 2 Posted by paul.farry on 12 Sep, 2017 04:40 AM

    paul.farry's Avatar

    The user doing this is in the System Adminstrator role.

    Version: Octopus 3.15.6

    In the attached Paint.Net File .. Turn on each layer in order corresponding to the steps below.
    Step 01: Create project - Select Variables
    Step 02: Create variable (no Scope) Save
    Step 03: No Filtering selected
    Step 04: Select Filter Choose DV, Filter
    Step 05: Variable Is Displayed
    Step 06: Modify variable, select DV for Scope , Save
    Step 07: Scope DV is now displayed in the variable List
    Step 08: Select Filter Choose DV, Filter
    Step 09: Variable Displayed with DV scope on Variable and Filter
    Step 10: Modify variable that has the DV scope
    Step 11: Remove the scope from Step 10. Apply
    Step 12: Variable Displayed with No Scope now display but not Saved. Choose Save
    Step 13: Variable Displayed with No Scope
    Step 14: Select Filter, Choose DV , Filter
    Step 15: Our Filter has applied, but our Variable no longer displays

  3. 3 Posted by paul.farry on 12 Sep, 2017 04:52 AM

    paul.farry's Avatar

    an additional thing i noticed when looking at the API.

    A variable that is scope and then removed has a Scope : with an Empty array for the environment, whilst a variable that has never been scoped doesn't have this issue.

    {
      "Id": "variableset-Projects-61",
      "OwnerId": "Projects-61",
      "Version": 4,
      "Variables": [
        {
          "Id": "7827f97f-515d-de6d-9d87-0dda2aaff9ef",
          "Name": "MyVariable",
          "Value": "aValue",
          "Scope": {
            "Environment": []
          },
        },
        {
          "Id": "2aa98106-0d13-d5d6-7fa8-d9f3a510947c",
          "Name": "MyVariableNoScope",
          "Value": "1111",
          "Scope": {},
        }
    
  4. Support Staff 4 Posted by Kenneth Bates on 14 Sep, 2017 12:36 AM

    Kenneth Bates's Avatar

    Hi,

    Thanks for following up with that additional information! I've been able to reproduce this issue where changing the scope of a variable while using the filter is causing the variable to not be displayed. In my case, it's not actually deleting the variables but instead only failing to display them. Can you confirm if the variable still exists after refreshing the variables page without using the filter?

    I've tested this in our new UI which is set for release in 4.0, where the issue seems to be resolved with the new variable editor. I appreciate you taking the time to report this, and I'm terribly sorry for the confusion caused by it. I've raised the following issue which you can track here.
    https://github.com/OctopusDeploy/Issues/issues/3795

    Let me know if you have any further questions going forward!

    Kind regards,

    Kenny

  5. 5 Posted by paul.farry on 14 Sep, 2017 03:11 AM

    paul.farry's Avatar

    Yes, the variable still exists if the filter is not there. From what I can see it’s a UI/Save issue.

  6. Support Staff 6 Posted by Kenneth Bates on 15 Sep, 2017 01:00 AM

    Kenneth Bates's Avatar

    Hi Paul,

    Thanks for confirming that - I'm happy to hear it's not actually deleting the variables in your environment as well. It's just a UI issue which will be resolved in 4.0. Thanks for taking the time to let us know about it, and I'm sorry for the confusion this has caused!

    Don't hesitate to reach out if you have any further questions or concerns in the future.

    Kind regards,

    Kenny

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac