microsoft / azure-devops-extension-sdk

Client SDK for developing Azure DevOps extensions
MIT License
125 stars 39 forks source link

How to control extension's build result tab visibility #85

Open fkpama opened 1 year ago

fkpama commented 1 year ago

Hi,

I am developing an extension that adds a tab for business specific reports in the build result page

{
      "id": "<contribution_id>",
      "description": "Tab Description",
      "type": "ms.vss-build-web.build-results-tab",
      "targets": [
        "ms.vss-build-web.build-results-view"
      ],
      "properties":
      {
        "uri": "<path-to-html>.html",
        "name": "<name>",
        "dynamic": true,
        "supportsTasks": ["<Task_ID>"]
      }
    }
]

and opened an issue in the documentation repository but after a day of research, it doesn't look like that tab's visibility (like the test result tab does, so apparently technically possible), can be controlled since the contribution's uri / html file is only included after the user clicked on the tab, giving the extension a chance to call register at that moment, and the SDK doesn't seem to care about the registered object for tabs anyway.

The best "supported" solution I could come up with so far is adding the constraint on the build task generating the reports, but that's not sufficient since it only checks for the task in the build definition and I would like to show the tab only if reports are actually generated (again, like the test results tabs is doing)

What I ended up doing to satisfy my client is controlling it via a preview feature and reloading the page after checking that the tab should be available, but that solution is far from ideal. Can you confirm what I'm trying to achieve is not possible via the SDK?

Thanks