microsoft/azure-pipelines-task-lib

visibleRule validation failing for custom extension

Closed this issue · 3 comments

Environment

azure-pipelines-task-lib version: 4.4.0

Issue Description

My task.json follows the schema for visibleRule, but when uploading the .vsix into Marketplace, I keep receiving this error:
Task definition visible rule is invalid. It should be of format "A <validconditionhere> B".

Please see a portion of my task.json below. There seems to be other similar issues that weren't responded to in 90 days and went stale. Starting a new thread here. I've tried A == B, A=B as well, but nothing seems to be successful.

Expected behaviour

Successful publishing of the extension, with certain input fields hidden dependent on "auth_type".

Actual behaviour

The task builds, but publishing to Marketplace fails.

Steps to reproduce

  1. Implement "visibleRule": (some condition here for previous input variables, i.e. auth_type = msal)
  2. Build .vsix
  3. Upload packaged .vsix into Visual Studio Marketplace
  4. Receive Error

Logs

"inputs": [
    {
      "name": "profile",
      "type": "pickList",
      "label": "Upload Profile",
      "required": true,
      "defaultValue": "prod",
      "helpMarkDown": "Pick a profile configuration for your package upload. Defaults to prod.",
      "options": {
        "prod": "prod",
        "tuxdev": "tuxdev",
        "ppe": "ppe"
      }
    },
    {
      "name": "auth_type",
      "type": "pickList",
      "label": "Auth Type",
      "required": true,
      "defaultValue": "msal",
      "helpMarkDown": "Please choose the authentication type for your package upload. Defaults to msal.",
      "options": {
        "msal": "msal",
        "msi": "msi"
      }
    },
    {
      "name": "msal_SNIAuth",
      "type": "pickList",
      "label": "Subject Name Issuer Auth",
      "required": false,
      "helpMarkDown": "Please choose whether to use Subject Name Issue Auth. Leave blank if using msi.",
      "options": {
        "msal-sniauth": "True",
        "no-msal-sniauth": "False"
      },
      "visibleRule": "auth_type = msal"
    },

Hi @acheng-01 thanks for reporting. I reproduced the issue, and then was able to upload the extension after I changed the input name from "auth_type" to "authType". Could you please check if it works for you?

@aleksandrlevochkin Thank you for the recommendation. I changed associated variable name to camelcase and it now works.

My question now is: for the sake of naming consistency, is this going to be a permanent change or are there plans to change it back to the underline convention? My worry is that the extension UI will stop functioning again at some point if you change it back. If it is permanent, I will have to change the naming convention for all the other variables I have in the task.json (and their references in the .ts file).

Please let me know, thanks!

This issue has had no activity in 90 days. Please comment if it is not actually stale