Launchpad can't import git branches from BitBucket

Bug #1154797 reported by Guilherme Salgado on 2013-03-13
34
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Launchpad code imports
Low
Unassigned

Bug Description

bitbucket now gives a 404 when Launchpad tries to mirror a branch. They do that because the User-Agent used by LP doesn't include the 'git/' string, and they don't seem to be willing to change that (https://bitbucket.org/site/master/issue/6666/).

I guess we need to change the User-Agent in LP if we want to continue importing git branches from bitbucket.

Erik van Zijst (erik-van-zijst) wrote :

Just to make it clear why that is the case: we have to rely on the user-agent string to decide whether to serve an HTML page for the repo, or redirect the request to our git-server.

Guilherme Salgado (salgado) wrote :

I wonder how this used to work in the past... Maybe the URLs ending in .git (e.g https://bitbucket.org/noaaport/npemwin.git) always redirected to the git-server regardless of the user-agent?

Erik van Zijst (erik-van-zijst) wrote :

Nope, the routing for git has always been on user-agent.
*Maybe* mercurial routing looked at the path at some point in the past, but with Git this should never have worked.

William Grant (wgrant) wrote :

My examples in comment #4 of https://answers.launchpad.net/launchpad/+question/218551 seem pretty unambiguous. If the URL ends in .git, why can't it just forward to the git backends regardless of User-Agent?

Perhaps I should write a web browser named "digit"!

summary: - Launchpad is no longer able to import bitbucket branches
+ Launchpad can't import git branches from BitBucket
Changed in launchpad:
status: New → Triaged
importance: Undecided → Low
tags: added: bzr code-import
Erik van Zijst (erik-van-zijst) wrote :

> If the URL ends in .git, why can't it just forward to the git backends regardless of User-Agent?

Because we allow dots in repo names, so does "/erik/repo.git" mean that you want to clone "/erik/repo" or browse "/erik/repo.git"?

In all fairness, we could probably do a better job by looking at the path. Most if not all paths accessed by git don't map to Bitbucket URL patterns.

Jelmer Vernooij (jelmer) wrote :

Git shouldn't be accessing the repository URL itself, just /info/refs and various other paths under it.

You should be able able to use the Content-Type header to tell smart git clients apart - which should be all git clients that are not ancient.

Colin Watson (cjwatson) on 2021-01-05
affects: launchpad → lp-codeimport
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related questions