Restrict Addon to only specific repositories in Account

atlassian-connect

#1

Hi

I am working on creating a new bitbucket addon. I am creating a new repoPage. I would like to make sure this repoPage is only displayed on specific repositories of the user and not in all repositories. How can I do this using conditions?

The documentation for conditions is not really helpful for this.

{
  "key": "Atlassian-CI-Integration",
  "baseUrl": "https://73a2f78a.ngrok.io",
  "name": "Atlassian Connect Integration",
  "description": "An LV Connect Addon",
  "authentication": {
    "type": "jwt"
  },
  "modules": {
  "oauthConsumer":{
  	"clientId": "<<secure id>>"
  },
  
  "repoPage": [
            {
                "url": "/squad-pull-requests?repoPath={repo_path}",
                "name": {
                    "value": "Pull requests - Squads"
                },
                "location": "org.bitbucket.repository.navigation",
                "key": "squad-pull-requests",
                "params": {
                    "auiIcon": "aui-iconfont-devtools-pull-request"
                },
                "weight": 1,
                "conditions": [
				    {
				        "condition": "equals",
				        "params": {
				            "entity": "repository",
				            "propertyKey": "full_name",
				            "value": "lv_digital/code-commerce"
				        }
				    }
				]
            }
        ]
  },
  "lifecycle": {
    "installed": "/installed",
    "uninstalled": "/uninstalled"
  },
  "scopes": ["account", "repository","pullrequest"],
  "contexts": ["account"]
  
}

After installing the add-on I am not able to view the repoPage on the code-commerce repository also. If I remove the condition then the repoPage appears on all the repositories.


#2

If I understand what you’re trying to do (repo-level installation not account) then that is not possible. We only have “install this add-on for my account (e.g. for every repo I own).” However, you can hide your add-on (for example: only show the add-on when a file “foo” is present in the repo).