jenkins-x / jx

Jenkins X provides automated CI+CD for Kubernetes with Preview Environments on Pull Requests using Cloud Native pipelines from Tekton
https://jenkins-x.io/
Apache License 2.0
4.58k stars 788 forks source link

Wrong token generation URL for Bitbucket Server #6819

Closed AntoineFr closed 4 years ago

AntoineFr commented 4 years ago

Summary

When I use the command jx create quickstart after the installation, it asks me my git username, then provides an URL to generate a git token.
The URL that is presented to generate this token works well for GitHub but not for BitBucket Server.

Steps to reproduce the behavior

Install Jenkins X with BitBucket Server :

cluster:
  gitKind: bitbucketserver
  gitName: bitbucket
  gitServer: https://git.xxx.fr

Then try to create a repository with jx create quickstart.

Expected behavior

The correct URL to generate a token is displayed. I think it should be https://git.xxx.fr/plugins/servlet/access-tokens/add

Actual behavior

The wrong URL is displayed (it uses the same format as GitHub).

? select the quickstart you wish to create php-helloworld
Using Git provider git.xxx.fr at https://git.xxx.fr
? git.xxx.fr username: xxx
To be able to create a repository on git.xxx.fr we need an API Token
Please click this URL and generate a token 
https://git.xxx.fr/settings/tokens/new?scopes=repo,read:user,read:org,user:email,write:repo_hook,delete_repo

Then COPY the token and enter it below:

Jx version

The output of jx version is:

NAME               VERSION
jx                 2.0.1202
Kubernetes cluster v1.17.2
kubectl            v1.16.0
helm client        Client: v2.16.3+g1ee0254
git                2.17.1
Operating System   Ubuntu 18.04.4 LTS

Jenkins type

Kubernetes cluster

On premise

Operating system / Environment

Distributor ID: Ubuntu
Description:    Ubuntu 18.04.4 LTS
Release:    18.04
Codename:   bionic
httpete commented 4 years ago

I am hitting the same thing. If someone could point me to where this is in the code I could try to fix it.

abayer commented 4 years ago

So what's happening here is that it's not realizing the appropriate git kind and is falling back on GitHub. We've got the right URL configured, it just doesn't know to use it. I'm not entirely clear on how it should be doing this, so I'll come back to this soon.

jenkins-x-bot commented 4 years ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with /close. Provide feedback via https://jenkins-x.io/community. /lifecycle stale

jenkins-x-bot commented 4 years ago

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity. If this issue is safe to close now please do so with /close. Provide feedback via https://jenkins-x.io/community. /lifecycle rotten

jenkins-x-bot commented 4 years ago

Rotten issues close after 30d of inactivity. Reopen the issue with /reopen. Mark the issue as fresh with /remove-lifecycle rotten. Provide feedback via https://jenkins-x.io/community. /close

jenkins-x-bot commented 4 years ago

@jenkins-x-bot: Closing this issue.

In response to [this](https://github.com/jenkins-x/jx/issues/6819#issuecomment-706735541): >Rotten issues close after 30d of inactivity. >Reopen the issue with `/reopen`. >Mark the issue as fresh with `/remove-lifecycle rotten`. >Provide feedback via https://jenkins-x.io/community. >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [jenkins-x/lighthouse](https://github.com/jenkins-x/lighthouse/issues/new?title=Command%20issue:) repository.