Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

visibleRule validation failing for custom extension #1023

Closed
acheng-01 opened this issue Feb 17, 2024 · 3 comments
Closed

visibleRule validation failing for custom extension #1023

acheng-01 opened this issue Feb 17, 2024 · 3 comments

Comments

@acheng-01
Copy link

acheng-01 commented Feb 17, 2024

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"
    },
@aleksandrlevochkin
Copy link
Contributor

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?

@acheng-01
Copy link
Author

acheng-01 commented Feb 20, 2024

@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!

Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants