pipecd icon indicating copy to clipboard operation
pipecd copied to clipboard

Bitbucket links under deployment are broken

Open alexander-bruun opened this issue 3 years ago • 1 comments

What happened: I deployed a test deployment with a pod, service and ingress (could be anything), when I then press on the configured deployment and press on the following buttons: Latest deployment more details - it redirects me to a broken bitbucket url Configuration Directory config (icon) - redirects me to a broken bitbucket url

What you expected to happen: When pressing more details i am redirected to the commit that was used to deploy the files. When pressing config showing me the config file content.

How to reproduce it:

  1. Deploy PipeCD with Bitbucket (in our case on-prem),
  2. Connect a PipeD to PipeCD
  3. Make a deployment within the PipeCD UI
  4. Press the buttons within the deployment text statuses
  5. Get redirected to invalid bitbucket urls

Environment:

  • piped version: Chart: 0.15.2
  • control-plane version: Chart: 0.15.1
  • Others: Bitbucket Server (On prem)

alexander-bruun avatar Sep 01 '21 07:09 alexander-bruun

Nice catch, we have not handled the case of on-prem bitbucket server is set as repo host for now.

	switch u.Host {
	case "github.com", "gitlab.com":
		subPath = "commit"
	case "bitbucket.org":
		subPath = "commits"
	default:
		// TODO: Allow users to specify git host
		//   Currently, the same subPath as Github is applied for all of unsupported hosts,
		//   to support GHE where its host could be customized
		subPath = "commit"
	}

ref: https://github.com/pipe-cd/pipe/blob/master/pkg/git/url.go#L40-L50

khanhtc1202 avatar Sep 01 '21 09:09 khanhtc1202