Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-46605

Stash-pullrequest-builder-plugin has no variable for GIT URL

      Stash-pullrequest-builder-plugin requires that the user who configures a job types in the Git URL (e.g. `ssh://git@example.com/` prefix) to do the actual checkouts. It would be convenient if this value was also among the pre-set variables - or maybe two, for the http(s) and for git+ssh checkouts, if the latter can be requested from Stash. We certainly have http(s) "Stash hostname" for REST API usage, so that variable is easy to re-publish so it can be used in Git repository checkout configuration.

          [JENKINS-46605] Stash-pullrequest-builder-plugin has no variable for GIT URL

          Jim Klimov added a comment -

          Looked into stash restapi response - it does report the SSH URL. Apparently the HTTP Git operations can now be administratively forbidden, BTW. But our server does return two HREFs for each repo.

          Sample snippets follow (note the tildes and path components, or lack thereof, in different URLs pointing to same entity):

          • User's replica of a repo:

          {noformat}

          ...,"links":{"clone":

            [{"href":"http://StashJenkins@stash.com/scm/~username/reponame.git","name":"http"},

             {"href":"ssh://git@stash.com:7999/~username/reponame.git","name":"ssh"}],

          "self":[\{"href":"http://stash.com/users/username/repos/reponame/browse"}]}},...

          {noformat}

           

          • Project replica (the common upstream repo):

          {noformat}

          ..."links":{"clone":

            [{"href":"http://StashJenkins@stash.com/scm/projname/reponame.git","name":"http"},

             {"href":"ssh://git@stash.com:7999/projname/reponame.git","name":"ssh"}],

          "self":[\{"href":"http://stash.com/projects/PROJNAME/repos/reponame/browse"}]}},

          {noformat}

          For the latter case - note that our project name is upper-cased in web-GUI. While it seems that URLs are case-insensitive in practice, the "projname" is spelled lower-case in the clone URLs, and uppercase as it is originally - in the browse URL. Not sure if it practically matters in any version of Stash, so just in case FYI

          Jim Klimov added a comment - Looked into stash restapi response - it does report the SSH URL. Apparently the HTTP Git operations can now be administratively forbidden, BTW. But our server does return two HREFs for each repo. Sample snippets follow (note the tildes and path components, or lack thereof, in different URLs pointing to same entity): User's replica of a repo: {noformat} ...,"links":{"clone":   [{"href":"http://StashJenkins@stash.com/scm/~username/reponame.git","name":"http"},    {"href":"ssh://git@stash.com:7999/~username/reponame.git","name":"ssh"}], "self": [\{"href":"http://stash.com/users/username/repos/reponame/browse"}] }},... {noformat}   Project replica (the common upstream repo): {noformat} ..."links":{"clone":   [{"href":"http://StashJenkins@stash.com/scm/projname/reponame.git","name":"http"},    {"href":"ssh://git@stash.com:7999/projname/reponame.git","name":"ssh"}], "self": [\{"href":"http://stash.com/projects/PROJNAME/repos/reponame/browse"}] }}, {noformat} For the latter case - note that our project name is upper-cased in web-GUI. While it seems that URLs are case-insensitive in practice, the "projname" is spelled lower-case in the clone URLs, and uppercase as it is originally - in the browse URL. Not sure if it practically matters in any version of Stash, so just in case FYI

          Jim Klimov added a comment -

          Also posted an RFE to the github origins of the plugin : https://github.com/nemccarthy/stash-pullrequest-builder-plugin/issues/129

          Jim Klimov added a comment - Also posted an RFE to the github origins of the plugin : https://github.com/nemccarthy/stash-pullrequest-builder-plugin/issues/129

            jimklimov Jim Klimov
            jimklimov Jim Klimov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: