Skip to content

Fix SSH-based authentication with code hosts for Batch Changes

Warren Gifford requested to merge mrn/fix-ssh-authentication into main

Created by: mrnugget

This fixes a regression that was introduced with #20799.

PR #20799 changed vcs.ParseURL in a way that resulted in the scheme of the returned url to be a blank string "" instead of "ssh" if the input URL was a git-style URL

Given a URL like [email protected]:sourcegraph/automation-testing.git the previous version of vcs.ParseURL would return "ssh" but the new version returns "".

In the createCommitFromPatch method that's changed in this commit we determine whether to use SSH-key authentication based on whether the schema is "ssh".

The result is that the check has been false for every git-style URL since #20799 was merged.

The fix is to use the helper that was introduced in #20799 but not rolled out to every place where we check for the scheme.

Customer issue: https://github.com/sourcegraph/customer/issues/558

cc @sourcegraph/repo-management so you're aware of the helper

Merge request reports

Loading