Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

codeintel: Provide hint on auth error #1079

Merged
merged 2 commits into from
May 10, 2024
Merged

codeintel: Provide hint on auth error #1079

merged 2 commits into from
May 10, 2024

Conversation

varungandhi-src
Copy link
Contributor

Fixes https://linear.app/sourcegraph/issue/GRAPH-579/print-warning-on-unusual-syntax-for-src-access-token

Test plan

Manually tested against HEAD.

❯ SRC_ENDPOINT=https://sourcegraph.test:3443 ~/Code/src-cli/src code-intel upload
💡 Inferred arguments
   repo: github.com/sourcegraph/conc
   commit: 5f936abd7ae87036af1f75c95fb9d0daaf00116b
   root:
   file: index.scip
   indexer: scip-go
   indexerVersion: 0.1

✅ Index compressed
💡 Indexed compressed (0.38MB -> 0.05MB).
❌ Failed to upload index file
invalid token format

A Sourcegraph access token must be provided via SRC_ACCESS_TOKEN for uploading SCIP/LSIF data.
For more details, see https://sourcegraph.com/docs/cli/how-tos/creating_an_access_token.
❯ SRC_ACCESS_TOKEN=foobar SRC_ENDPOINT=https://sourcegraph.test:3443 ~/Code/src-cli/src code-intel upload
💡 Inferred arguments
   repo:
   commit:
   root:
   file: index.scip
   indexer:
   indexerVersion:

invalid token format

A Sourcegraph access token must be provided via SRC_ACCESS_TOKEN for uploading SCIP/LSIF data.
However, the provided access token does not match expected format; was it truncated?
Typically the access token looks like sgp_<40 hex chars> or sgp_<instance-id>_<40 hex chars>.
For more details, see https://sourcegraph.com/docs/cli/how-tos/creating_an_access_token.

@varungandhi-src varungandhi-src requested a review from a team as a code owner May 10, 2024 12:39
Copy link

@bahrmichael bahrmichael left a comment

Choose a reason for hiding this comment

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

LGTM, feel free to merge once the checks are green

@varungandhi-src
Copy link
Contributor Author

There is a test failure due to a data race which is unrelated to this patch. Run go test ./... locally works OK, so I'm going to merge this. 😐

@varungandhi-src varungandhi-src merged commit b24f883 into main May 10, 2024
3 of 8 checks passed
@varungandhi-src varungandhi-src deleted the vg/warn-token branch May 10, 2024 13:03
@bahrmichael
Copy link

There is a test failure due to a data race which is unrelated to this patch. Run go test ./... locally works OK, so I'm going to merge this. 😐

That's okay with me. The data race seems to come from tests using reflection for mocking, and production code doing other stuff. There appears to be no data race within the production code, only between test and production code. I traced the data race back to ad1b36a#diff-0a603732f0f49068408f58001aca08acd789cc8f3c1abb75db951824fe681ca5.

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.

2 participants