Skip to content

feat: no longer accept the endpoint on the command line#1274

Open
peterguy wants to merge 2 commits intomainfrom
peterguy/remove-endpoint-in-command-line
Open

feat: no longer accept the endpoint on the command line#1274
peterguy wants to merge 2 commits intomainfrom
peterguy/remove-endpoint-in-command-line

Conversation

@peterguy
Copy link
Contributor

The endpoint on the command line always had to match SRC_ENDPOINT, which defaults to https://sourcegraph.com; there was no point to supporting the command-line argument.

This could be considered a "breaking change" because the error The configured endpoint is [SRC_ENDPOINT], not [command-line-arg]. Will no longer show up.

It has been replaced by a usage error: src login no longer accepts a URL argument; set SRC_ENDPOINT instead

Before:
CleanShot 2026-03-16 at 20 50 07@2x

After:
CleanShot 2026-03-16 at 20 50 36@2x

Test plan

CI tests updated.

@peterguy peterguy self-assigned this Mar 17, 2026
@peterguy peterguy requested a review from a team March 17, 2026 03:52
@burmudar
Copy link
Contributor

burmudar commented Mar 17, 2026

I think we should keep --endpoint. gh supports a similar arg with gh auth login --hostname enterprise.internal

SRC_ENDPOINT should only be used when you don't specify --endpoint. If SRC_ENDPOINT and --endpoint are specified - we should print a warning and say that we are going to use --endpoint over SRC_ENDPOINT.

I think for agents it also might be easier to use --endpoint, for instance to first set SRC_ENDPOINT and then src login requires two tool calls while src login --endpoint http://sourcegraph.example.com requires one.

Also just to diagnose things quickly on your own you might have SRC_ENDPOINT defined to sg.prod but then you quickly want to verify against staging sg.staging now you have to export SRC_ENDPOINT=sg.internal; src login; export SRC_ENDPOINT=sg.prod; whereas you could just from the start do src login --endpoint sg.internal.

@keegancsmith
Copy link
Member

Agreed, we should keep it but change the enforcement. I don't know why that existed before? Maybe it should only warn if SRC_ENDPOINT is set

Copy link
Member

@keegancsmith keegancsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned in the comments, lets not remove it but rather change what we do with the argument.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants