Arc is sensitive to GitHub URI casing

A member of my team had cloned our company’s repository with the wrong casing, e.g. if the repository is really git@github.com:ACME/supersecret he cloned git@github.com:acme/supersecret. Everything seemed to work but when sending out a diff using arc, the push to staging step was a no-op, which was easy to miss and resulted in our remote build setup not getting triggered.

Repro steps:

$ arc version
arcanist db1959900a644d9b28064ec479af3296331d2a4f (4 Nov 2019)
libphutil 1750586fdc50a6cd98adba4aa2f5a7649bd91dbe (30 Sep 2019)
  1. Take any existing GitHub repository already hooked up with Phabricator.
  2. In .git/config edit the origin url and change the casing arbitrarily.
  3. Verify that git fetch etc still works (GitHub is not sensitive to project name casing).
  4. Run arc which, see that it fails to identify the repository.
  5. Make a commit and send it out for review with arc diff. Because arc can’t identify the repository, it doesn’t push the changes to our configured staging area. But the diff gets created successfully and associated with the correct repository in the Differential UI - I’m guessing this is done by parent commit hash because it works even if I make the URL in .git/config garbage.

(If needed I can write up full repro-from-zero steps but I expect the above is easier.)

Ideas:
a. Can the repository detection logic be made consistent between arc and the serverside?
b. If not, can GitHub perhaps be special-cased so that project URIs are not case sensitive?

I did my testing on a Mac in case it matters, but I don’t think filesystem case sensitivity factors in here.

Thanks!

Can you post the (redacted) output of arc which in that repository?

Sure! Output with incorrect casing in .git/config:

$ arc which
REPOSITORY
To identify the repository associated with this working copy, arc followed this process:

    Configuration value "repository.callsign" is empty.

    This repository has no VCS UUID (this is normal for git/hg).

    The remote URI for this working copy is
    "git@github.com:acme/supersecret".

    No repositories matched the query. Check that your configuration is
    correct, or use "repository.callsign" to select a repository explicitly.

This working copy is not associated with any repository.

Output with correct casing:

$ arc which
REPOSITORY
To identify the repository associated with this working copy, arc followed this process:

    Configuration value "repository.callsign" is empty.

    This repository has no VCS UUID (this is normal for git/hg).

    The remote URI for this working copy is
    "git@github.com:ACME/supersecret".

    Found a unique matching repository.

This working copy is associated with the supersecret repository.

Thanks.

I think your best bet for now is to just add both URIs to the repository phabricator-side (IO type “None” and Display “Never”); I think it would let the URI-based resolving work correctly, and I’m guessing there are only 2 forms ever likely to be used (either as-shown in gh, or all-lowercase).