From 8a2ee34ae55323c307b3e540336b7f4db2442e3f Mon Sep 17 00:00:00 2001 From: Eric Fritz Date: Tue, 17 Jan 2023 09:54:04 -0600 Subject: [PATCH] codeintel: Revert codeintel-qa bucket until SCIP tests are relevant (#46578) --- dev/codeintel-qa/cmd/download/main.go | 4 ++-- .../internal/codeintel/uploads/transport/http/handler.go | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/dev/codeintel-qa/cmd/download/main.go b/dev/codeintel-qa/cmd/download/main.go index e32abcf4ee6..df8cb3538be 100644 --- a/dev/codeintel-qa/cmd/download/main.go +++ b/dev/codeintel-qa/cmd/download/main.go @@ -26,7 +26,7 @@ func main() { } const ( - bucketName = "codeintel-qa-indexes" + bucketName = "precise-code-intel-integration-testdata" relativeIndexesDir = "dev/codeintel-qa/testdata/indexes" ) @@ -89,7 +89,7 @@ func downloadAll(ctx context.Context, bucket *storage.BucketHandle, paths []stri } func downloadIndex(ctx context.Context, bucket *storage.BucketHandle, indexesDir, name string) (err error) { - targetFile := filepath.Join(indexesDir, strings.TrimSuffix(name, ".gz")) + targetFile := filepath.Join(indexesDir, "sourcegraph-testing."+strings.TrimSuffix(name, ".gz")) if ok, err := internal.FileExists(targetFile); err != nil { return err diff --git a/enterprise/internal/codeintel/uploads/transport/http/handler.go b/enterprise/internal/codeintel/uploads/transport/http/handler.go index 5f24191445c..9de63aaadf2 100644 --- a/enterprise/internal/codeintel/uploads/transport/http/handler.go +++ b/enterprise/internal/codeintel/uploads/transport/http/handler.go @@ -40,6 +40,11 @@ func newHandler( return uploads.UploadMetadata{}, statusCode, err } + contentType := r.Header.Get("Content-Type") + if contentType == "" { + contentType = "application/x-ndjson+lsif" + } + // Populate state from request return uploads.UploadMetadata{ RepositoryID: repositoryID, @@ -48,7 +53,7 @@ func newHandler( Indexer: getQuery(r, "indexerName"), IndexerVersion: getQuery(r, "indexerVersion"), AssociatedIndexID: getQueryInt(r, "associatedIndexId"), - ContentType: r.Header.Get("Content-Type"), + ContentType: contentType, }, 0, nil }