Page MenuHomePhabricator

Verify remote URI has URI nature when entered in Diffusion
Closed, ResolvedPublic

Description

I accidentally included a space before the protocol, " https://git.wikimedia.org/git/mediawiki/extensions/GettingStarted.git", possibly because it was originally "git clone https://git.wikimedia.org/git/mediawiki/extensions/GettingStarted.git" and I dropped the "git clone" but not the space.

This leads to the error:

Pull of "GETTINGSTARTED" failed: Command failed with error #128! COMMAND git clone --bare -- 'xxxxx' '/data/project/phabricator-git/GETTINGSTARTED' STDOUT Cloning into bare repository '/data/project/phabricator-git/GETTINGSTARTED'... STDERR fatal: I don't handle protocol ' https'

I had to re-read it before understanding the issue. It should be safe to at least left-trim the URL, and maybe trim both sides.

Event Timeline

mattflaschen raised the priority of this task from to Needs Triage.
mattflaschen updated the task description. (Show Details)
mattflaschen added a project: Phabricator.
mattflaschen added a subscriber: mattflaschen.
chad triaged this task as Low priority.Apr 29 2014, 1:46 AM
chad added projects: Badge Awarded, Diffusion.
chad added a subscriber: chad.
epriestley renamed this task from Trim remote URL for hosted elsewhere repositories to Verify remote URI has URI nature when entered in Diffusion.Apr 29 2014, 5:19 PM
epriestley claimed this task.

Looks like:

  • We make attempts to verify that what you've entered is a correctly structured URI.
  • The expectation is that you'll be stopped immediately for https://, hppt://, etc.
  • In doing this verification, we call parse_url(), which trims leading whitespace (!) during parsing. Oh, PHP.
  • However, git and other places where we might reasonably want to put a URI do not trim leading whitespace.

I'm going to make the parser more strict, since it can only hurt us to validate these as URIs when other systems are reasonably far more strict.

This should be fixed in HEAD. Thanks for the report! Let us know if you run into anything else.