Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-20020

(REST) As an admin, I would like to test repository connection from REST API

    • 0
    • 2
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      Issue

      Currently, Bamboo does not provide an endpoint listing repositories (https://jira.atlassian.com/browse/BAM-20007 - (REST) No endpoint available for retrieving Linked Repository ID(s)). Even after gathering the repository ID information, extracted from Bamboo UI or web scraping, testing repository connection still need to much effort from users through REST API.

      How to repository test connection

      Based on Bamboo REST API documentation, there is an endpoint (http://myhost.com:8085/bamboo/rest/api/latest/repository/testConnection [PUT]) in which should provide this information easily, however, it is required to provide not only the repository ID information but also the pluginKey and repositoryURL (when testing connection against Git repository as Repository Host)

      # replace "5341185" with "repository id"
      # replace "file:///nothing" with repository URL
      
      curl -k -u admin:admin \
           -H 'Content-type: application/json' \
           -H 'Accept: application/json' \
           -d '{"repositoryId":"5341185","selectedRepository":"com.atlassian.bamboo.plugins.atlassian-bamboo-plugin-git:gitv2","repository.git.repositoryUrl":"file:///nothing"}' \
           -X PUT http://localhost:8085/rest/api/latest/repository/testConnection
      
      • selectedRepository attribute from payload is not available in Bamboo's UI, making it difficult for user to make use of the endpoint
      • repository.git.repositoryUrl since providing repositoryID information, repository URL seems to be a redundant attribute since repository IDs are unique across Bamboo

      Suggestion

      The endpoint should only consume the repository ID, e.g:

      curl -k -u admin:admin \
           -H 'Accept: application/json' \
           -X PUT http://localhost:8085/rest/api/latest/repository/{repositoryId}/testConnection
      

      As response, Bamboo should provide information about the repository, e.g:

      {
      	"repositoryID": "1234567890",
      	"repositoryName": "Name given in Bamboo"
      	"repositoryHost": "Git",
      	"repositoryURL": "ssh://git@hostname/proj/repository.git",
      	"branch": "master",
      	"testConnection": "Successful"
      }
      

            [BAM-20020] (REST) As an admin, I would like to test repository connection from REST API

            Martyna Wojtas (Inactive) made changes -
            Resolution New: Timed out [ 10 ]
            Status Original: Gathering Interest [ 11772 ] New: Closed [ 6 ]
            Martyna Wojtas (Inactive) made changes -
            Labels Original: pse-request New: bamboo-bugs-grooming pse-request
            Katherine Yabut made changes -
            Workflow Original: JAC Suggestion Workflow [ 3019249 ] New: JAC Suggestion Workflow 3 [ 3599704 ]
            Owen made changes -
            Workflow Original: Confluence Workflow - Public Facing v4 [ 2752360 ] New: JAC Suggestion Workflow [ 3019249 ]
            Jan Majkutewicz (Inactive) made changes -
            Remote Link New: This issue links to "Page (Confluence)" [ 393738 ]
            SET Analytics Bot made changes -
            Support reference count Original: 1 New: 2
            Rafael Sperafico (Inactive) made changes -
            Remote Link New: This issue links to "Page (Confluence)" [ 387204 ]
            Krystian Brazulewicz made changes -
            UIS New: 0
            SET Analytics Bot made changes -
            Support reference count New: 1
            Rafael Sperafico (Inactive) made changes -
            Description Original: h3. Issue

            Currently, Bamboo does not provide an endpoint listing repositories (https://jira.atlassian.com/browse/BAM-20007 - *(REST) No endpoint available for retrieving Linked Repository ID(s)*). Even after gathering the repository ID information, extracted from Bamboo UI or web scraping, testing repository connection still need to much effort from users.
            h3. How to repository test connection

            Based on Bamboo REST API documentation, there is an endpoint ([http://myhost.com:8085/bamboo/rest/api/latest/repository/testConnection] [PUT]) in which should provide this information easily, however, it is required to provide not only the *repository ID* information but also the *pluginKey* and *repositoryURL* (_when testing connection against Git repository as Repository Host_)
            {noformat}
            # replace "5341185" with "repository id"
            # replace "file:///nothing" with repository URL

            curl -k -u admin:admin \
                 -H 'Content-type: application/json' \
                 -H 'Accept: application/json' \
                 -d '{"repositoryId":"5341185","selectedRepository":"com.atlassian.bamboo.plugins.atlassian-bamboo-plugin-git:gitv2","repository.git.repositoryUrl":"file:///nothing"}' \
                 -X PUT http://localhost:8085/rest/api/latest/repository/testConnection
            {noformat}
            * *selectedRepository* attribute from payload is not available in Bamboo's UI, making it difficult for user to make use of the endpoint
            * *repository.git.repositoryUrl* since providing repositoryID information, repository URL seems to be a redundant attribute since repository IDs are unique across Bamboo

            h3. Suggestion

            The endpoint should only consume the repository ID, e.g:
            {noformat}
            curl -k -u admin:admin \
                 -H 'Accept: application/json' \
                 -X PUT http://localhost:8085/rest/api/latest/repository/{repositoryId}/testConnection
            {noformat}
            As response, Bamboo should provide information about the repository, e.g:
            {noformat}
            {
            "repositoryID": "1234567890",
            "repositoryName": "Name given in Bamboo"
            "repositoryHost": "Git",
            "repositoryURL": "ssh://git@hostname/proj/repository.git",
            "branch": "master",
            "testConnection": "Successful"
            }
            {noformat}
            New: h3. Issue

            Currently, Bamboo does not provide an endpoint listing repositories (https://jira.atlassian.com/browse/BAM-20007 - *(REST) No endpoint available for retrieving Linked Repository ID(s)*). Even after gathering the repository ID information, extracted from Bamboo UI or web scraping, testing repository connection still need to much effort from users through REST API.
            h3. How to repository test connection

            Based on Bamboo REST API documentation, there is an endpoint ([http://myhost.com:8085/bamboo/rest/api/latest/repository/testConnection] [PUT]) in which should provide this information easily, however, it is required to provide not only the *repository ID* information but also the *pluginKey* and *repositoryURL* (_when testing connection against Git repository as Repository Host_)
            {noformat}
            # replace "5341185" with "repository id"
            # replace "file:///nothing" with repository URL

            curl -k -u admin:admin \
                 -H 'Content-type: application/json' \
                 -H 'Accept: application/json' \
                 -d '{"repositoryId":"5341185","selectedRepository":"com.atlassian.bamboo.plugins.atlassian-bamboo-plugin-git:gitv2","repository.git.repositoryUrl":"file:///nothing"}' \
                 -X PUT http://localhost:8085/rest/api/latest/repository/testConnection
            {noformat}
            * *selectedRepository* attribute from payload is not available in Bamboo's UI, making it difficult for user to make use of the endpoint
            * *repository.git.repositoryUrl* since providing repositoryID information, repository URL seems to be a redundant attribute since repository IDs are unique across Bamboo

            h3. Suggestion

            The endpoint should only consume the repository ID, e.g:
            {noformat}
            curl -k -u admin:admin \
                 -H 'Accept: application/json' \
                 -X PUT http://localhost:8085/rest/api/latest/repository/{repositoryId}/testConnection
            {noformat}
            As response, Bamboo should provide information about the repository, e.g:
            {noformat}
            {
            "repositoryID": "1234567890",
            "repositoryName": "Name given in Bamboo"
            "repositoryHost": "Git",
            "repositoryURL": "ssh://git@hostname/proj/repository.git",
            "branch": "master",
            "testConnection": "Successful"
            }
            {noformat}

              Unassigned Unassigned
              rsperafico Rafael Sperafico (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: