You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
return"The provided Sourcegraph access token does not match the expected format (sgp_<40 hex chars> or sgp_<instance-id>_<40 hex chars>). Was it copied incorrectly or truncated?"
278
264
}
279
-
} else {
280
-
actionableHints=append(actionableHints,
281
-
"Verification is supported for the following code hosts: github.com, gitlab.com.",
282
-
"Please request support for additional code host verification at https://github.com/sourcegraph/sourcegraph/issues/4967.",
283
-
)
265
+
return"The Sourcegraph access token may be invalid, expired, or you may be connecting to the wrong Sourcegraph instance."
266
+
}
267
+
ifisForbidden {
268
+
return"You may not have sufficient permissions on this Sourcegraph instance."
269
+
}
270
+
return""
271
+
}
272
+
273
+
// codeHostTokenHints returns hints about GitHub or GitLab tokens.
[]string{"This Sourcegraph instance has enforced auth for SCIP uploads."},
288
-
actionableHints,
289
-
[]string{"For more details, see https://docs.sourcegraph.com/cli/references/code-intel/upload."},
290
-
), "\n")}
284
+
// gitHubTokenHint returns a hint about the GitHub token.
285
+
// Only called when gitHubToken is set or repo starts with "github.com".
286
+
funcgitHubTokenHint(isUnauthorizedbool) string {
287
+
ifcodeintelUploadFlags.gitHubToken=="" {
288
+
returnfmt.Sprintf("No -github-token was provided. If this Sourcegraph instance enforces code host authentication, retry with -github-token=<token> for a token with access to %s.", codeintelUploadFlags.repo)
289
+
}
290
+
ifisUnauthorized {
291
+
return"The supplied -github-token may be invalid."
292
+
}
293
+
return"The supplied -github-token may lack the required permissions."
291
294
}
292
295
293
-
// emergencyOutput creates a default Output object writing to standard out.
// gitLabTokenHint returns a hint about the GitLab token.
297
+
// Only called when gitLabToken is set or repo starts with "gitlab.com".
298
+
funcgitLabTokenHint(isUnauthorizedbool) string {
299
+
ifcodeintelUploadFlags.gitLabToken=="" {
300
+
returnfmt.Sprintf("No -gitlab-token was provided. If this Sourcegraph instance enforces code host authentication, retry with -gitlab-token=<token> for a token with access to %s.", codeintelUploadFlags.repo)
301
+
}
302
+
ifisUnauthorized {
303
+
return"The supplied -gitlab-token may be invalid."
304
+
}
305
+
return"The supplied -gitlab-token may lack the required permissions."
296
306
}
297
307
298
-
funcmergeStringSlices(ss...[]string) []string {
299
-
varcombined []string
300
-
for_, s:=rangess {
301
-
combined=append(combined, s...)
308
+
// uploadFailureReason returns the server's response body if available, or a
309
+
// generic reason derived from the HTTP status code.
0 commit comments