git review assumes the wrong port

Bug #1075751 reported by Adam
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
git-review
Fix Released
Medium
Cedric Brandily

Bug Description

git review tool assumes the port is 22 when no port is found [1]. This behavior is faulty because many users have a ".ssh/config" file which defines the port and user. So, the git review tool should not try to fill in empty url information.

[1] https://github.com/openstack-ci/git-review/blob/master/git-review#L297

olaph (zxkuqyb)
Changed in git-review:
assignee: nobody → matthew wagoner (matthew-wagoner)
James E. Blair (corvus)
Changed in git-review:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to git-review (master)

Fix proposed to branch: master
Review: https://review.openstack.org/18392

Changed in git-review:
status: Triaged → In Progress
Revision history for this message
Marcin Cieślak (saperski) wrote :

Given that git-review operates on a already checked-out clone, there must be some remote already to reach the repository (might be https one though:)

If we were doing some special guessing of the repository parameters (like no .gitreview file AND only https remote given), ONLY in this case I would assume that the default port is 29418 (but still subject to remote testing).

In general (in future) I believe git-review should do the following:

1) Unless we have a very probable coordinates of the repository, a list of candidate repos should be built and tried in sequence.

2) After the remote is tested to be working, it should be used without any assumptions. If working repository does not match any of the current remotes, a new one ("gerrit") could be created.

Other than that, ANY assumption about the SSH port number should be removed, and (user, host, port, path) part should be treated as the opaque identifier of the repository, that gets interpreted as little as possible.

Most of the code in the change set 5720 tried to eradicate various ad-hoc assumptions about the repository and how it should be reached.

This is a long way to go and we should get rid of tremendous code duplication around calling SSH first, fixing also other SSH-related bugs on the way.

Jeremy Stanley (fungi)
Changed in git-review:
status: In Progress → Confirmed
Changed in git-review:
status: Confirmed → In Progress
Jeremy Stanley (fungi)
Changed in git-review:
assignee: olaph (zxkuqyb) → nobody
status: In Progress → Confirmed
Revision history for this message
@Spazm (granny-launchpad) wrote :

fix proposed for branch master: https://review.openstack.org/#/c/43248/

* improves handling of port=None ssh urls for ssh and scp commands
* removes the port=22 assignment
* bonus: adds parsing for [ridiculous] bare ssh urls like gerrit:project.git

Changed in git-review:
assignee: nobody → Cedric Brandily (cbrandily)
Changed in git-review:
status: Confirmed → In Progress
Revision history for this message
Cedric Brandily (cbrandily) wrote :
Changed in git-review:
status: In Progress → Fix Committed
Jeremy Stanley (fungi)
Changed in git-review:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.