Skip to content

src-cli src extensions copy command doesn't work with -get-curl flag

Created by: dadlerj

Reported by https://app.hubspot.com/contacts/2762526/company/1686989427

The src extensions copy command doesn't work with the -get-curl flag, as it actually executes two commands (but only prints the first of two). Additionally, while it prints the correct first command, it DOESN'T maintain the custom config that's added in the app (i.e., where it uses sourcegraph.com instead of the typical Sourcegraph endpoint): https://sourcegraph.com/github.com/sourcegraph/src-cli/-/blob/cmd/src/extensions_copy.go#L75:3.

So the user in question tried to run the curl command, got an error (since it was hitting their own instance instead of sourcegraph.com) and nothing worked at all.

Unfortunately this user can't use the src cli itself, due to using a "bogus" cert on their Sourcegraph instance. They use curl -k instead.

Due to our current use of a bogus cert, we cannot use the command directly at the moment. I receive the following error:

Post "https://<externalUrl>/.api/graphql": x509: cannot validate certificate for <externalUrl> because it doesn't contain any IP SANs

This is why I added the -k flag.