Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit ab9587a

Browse files
cleanup: Remove 'Dump' terminology from backend (#61131)
'Dump' really meant an uploads that is a 'completed' state, and hence is eligible for various operations such as 'Find references' This patch makes that explicit by removing the term 'Dump' from the backend in favor of 'CompletedUpload'
1 parent 2fd375f commit ab9587a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1949
-1904
lines changed

cmd/frontend/graphqlbackend/codeintel.autoindexing.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ type IndexSteps {
406406
index: IndexStep!
407407

408408
"""
409-
Execution log entry related to uploading the dump produced by the indexing step.
409+
Execution log entry related to uploading the index produced by the indexing step.
410410
This field be missing if the upload step had not been executed.
411411
"""
412412
upload: ExecutionLogEntry

internal/codeintel/autoindexing/internal/background/dependencies/job_dependency_indexing_scheduler_test.go

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ func TestDependencyIndexingSchedulerHandler(t *testing.T) {
3636
mockUploadsSvc.GetUploadByIDFunc.SetDefaultReturn(shared.Upload{ID: 42, RepositoryID: 50, Indexer: "lsif-go"}, true, nil)
3737
mockUploadsSvc.ReferencesForUploadFunc.SetDefaultReturn(mockScanner, nil)
3838

39-
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{DumpID: 42, Scheme: "gomod", Name: "https://github.com/sample/text", Version: "v2.2.0"}}, true, nil)
40-
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{DumpID: 42, Scheme: "gomod", Name: "https://github.com/sample/text", Version: "v3.2.0"}}, true, nil)
41-
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{DumpID: 42, Scheme: "gomod", Name: "https://github.com/cheese/burger", Version: "v3.2.2"}}, true, nil)
42-
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{DumpID: 42, Scheme: "gomod", Name: "https://github.com/cheese/burger", Version: "v2.2.1"}}, true, nil)
43-
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{DumpID: 42, Scheme: "gomod", Name: "https://github.com/cheese/burger", Version: "v4.2.3"}}, true, nil)
44-
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{DumpID: 42, Scheme: "gomod", Name: "https://github.com/sample/text", Version: "v1.2.0"}}, true, nil)
45-
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{DumpID: 42, Scheme: "gomod", Name: "https://github.com/banana/world", Version: "v0.0.1"}}, true, nil)
39+
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{UploadID: 42, Scheme: "gomod", Name: "https://github.com/sample/text", Version: "v2.2.0"}}, true, nil)
40+
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{UploadID: 42, Scheme: "gomod", Name: "https://github.com/sample/text", Version: "v3.2.0"}}, true, nil)
41+
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{UploadID: 42, Scheme: "gomod", Name: "https://github.com/cheese/burger", Version: "v3.2.2"}}, true, nil)
42+
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{UploadID: 42, Scheme: "gomod", Name: "https://github.com/cheese/burger", Version: "v2.2.1"}}, true, nil)
43+
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{UploadID: 42, Scheme: "gomod", Name: "https://github.com/cheese/burger", Version: "v4.2.3"}}, true, nil)
44+
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{UploadID: 42, Scheme: "gomod", Name: "https://github.com/sample/text", Version: "v1.2.0"}}, true, nil)
45+
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{UploadID: 42, Scheme: "gomod", Name: "https://github.com/banana/world", Version: "v0.0.1"}}, true, nil)
4646
mockScanner.NextFunc.SetDefaultReturn(shared.PackageReference{}, false, nil)
4747

4848
mockGitserverReposStore := NewMockGitserverRepoStore()
@@ -135,13 +135,13 @@ func TestDependencyIndexingSchedulerHandlerCustomer(t *testing.T) {
135135
mockUploadsSvc.GetUploadByIDFunc.SetDefaultReturn(shared.Upload{ID: 42, RepositoryID: 50, Indexer: "lsif-go"}, true, nil)
136136
mockUploadsSvc.ReferencesForUploadFunc.SetDefaultReturn(mockScanner, nil)
137137

138-
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{DumpID: 42, Scheme: "gomod", Name: "https://github.com/sample/text", Version: "v2.2.0"}}, true, nil)
139-
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{DumpID: 42, Scheme: "gomod", Name: "https://github.com/sample/text", Version: "v3.2.0"}}, true, nil)
140-
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{DumpID: 42, Scheme: "gomod", Name: "https://github.com/cheese/burger", Version: "v3.2.2"}}, true, nil)
141-
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{DumpID: 42, Scheme: "gomod", Name: "https://github.com/cheese/burger", Version: "v2.2.1"}}, true, nil)
142-
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{DumpID: 42, Scheme: "gomod", Name: "https://github.com/cheese/burger", Version: "v4.2.3"}}, true, nil)
143-
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{DumpID: 42, Scheme: "gomod", Name: "https://github.com/sample/text", Version: "v1.2.0"}}, true, nil)
144-
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{DumpID: 42, Scheme: "gomod", Name: "https://github.com/banana/world", Version: "v1.2.0"}}, true, nil)
138+
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{UploadID: 42, Scheme: "gomod", Name: "https://github.com/sample/text", Version: "v2.2.0"}}, true, nil)
139+
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{UploadID: 42, Scheme: "gomod", Name: "https://github.com/sample/text", Version: "v3.2.0"}}, true, nil)
140+
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{UploadID: 42, Scheme: "gomod", Name: "https://github.com/cheese/burger", Version: "v3.2.2"}}, true, nil)
141+
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{UploadID: 42, Scheme: "gomod", Name: "https://github.com/cheese/burger", Version: "v2.2.1"}}, true, nil)
142+
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{UploadID: 42, Scheme: "gomod", Name: "https://github.com/cheese/burger", Version: "v4.2.3"}}, true, nil)
143+
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{UploadID: 42, Scheme: "gomod", Name: "https://github.com/sample/text", Version: "v1.2.0"}}, true, nil)
144+
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{UploadID: 42, Scheme: "gomod", Name: "https://github.com/banana/world", Version: "v1.2.0"}}, true, nil)
145145
mockScanner.NextFunc.SetDefaultReturn(shared.PackageReference{}, false, nil)
146146

147147
// simulate github.com/banana/world not being known to the instance
@@ -239,8 +239,8 @@ func TestDependencyIndexingSchedulerHandlerRequeueNotCloned(t *testing.T) {
239239
mockUploadsSvc.GetUploadByIDFunc.SetDefaultReturn(shared.Upload{ID: 42, RepositoryID: 50, Indexer: "lsif-go"}, true, nil)
240240
mockUploadsSvc.ReferencesForUploadFunc.SetDefaultReturn(mockScanner, nil)
241241

242-
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{DumpID: 42, Scheme: "gomod", Name: "https://github.com/sample/text", Version: "v3.2.0"}}, true, nil)
243-
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{DumpID: 42, Scheme: "gomod", Name: "https://github.com/cheese/burger", Version: "v4.2.3"}}, true, nil)
242+
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{UploadID: 42, Scheme: "gomod", Name: "https://github.com/sample/text", Version: "v3.2.0"}}, true, nil)
243+
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{UploadID: 42, Scheme: "gomod", Name: "https://github.com/cheese/burger", Version: "v4.2.3"}}, true, nil)
244244
mockScanner.NextFunc.SetDefaultReturn(shared.PackageReference{}, false, nil)
245245

246246
mockGitserverReposStore := NewMockGitserverRepoStore()
@@ -301,8 +301,8 @@ func TestDependencyIndexingSchedulerHandlerSkipNonExistant(t *testing.T) {
301301
mockUploadsSvc.GetUploadByIDFunc.SetDefaultReturn(shared.Upload{ID: 42, RepositoryID: 50, Indexer: "lsif-go"}, true, nil)
302302
mockUploadsSvc.ReferencesForUploadFunc.SetDefaultReturn(mockScanner, nil)
303303

304-
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{DumpID: 42, Scheme: "gomod", Name: "https://github.com/sample/text", Version: "v3.2.0"}}, true, nil)
305-
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{DumpID: 42, Scheme: "gomod", Name: "https://github.com/cheese/burger", Version: "v4.2.3"}}, true, nil)
304+
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{UploadID: 42, Scheme: "gomod", Name: "https://github.com/sample/text", Version: "v3.2.0"}}, true, nil)
305+
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{UploadID: 42, Scheme: "gomod", Name: "https://github.com/cheese/burger", Version: "v4.2.3"}}, true, nil)
306306
mockScanner.NextFunc.SetDefaultReturn(shared.PackageReference{}, false, nil)
307307

308308
mockGitserverReposStore := NewMockGitserverRepoStore()
@@ -400,10 +400,10 @@ func TestDependencyIndexingSchedulerHandlerNoExtsvc(t *testing.T) {
400400
mockUploadsSvc.ReferencesForUploadFunc.SetDefaultReturn(mockScanner, nil)
401401
mockScanner.NextFunc.PushReturn(shared.PackageReference{
402402
Package: shared.Package{
403-
DumpID: 42,
404-
Scheme: dependencies.JVMPackagesScheme,
405-
Name: "banana",
406-
Version: "v1.2.3",
403+
UploadID: 42,
404+
Scheme: dependencies.JVMPackagesScheme,
405+
Name: "banana",
406+
Version: "v1.2.3",
407407
},
408408
}, true, nil)
409409
mockGitserverReposStore.GetByNamesFunc.PushReturn(map[api.RepoName]*types.GitserverRepo{

internal/codeintel/autoindexing/internal/background/dependencies/job_dependency_sync_scheduler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func (h *dependencySyncSchedulerHandler) Handle(ctx context.Context, logger log.
125125
log.Error(err),
126126
log.String("name", packageReference.Name),
127127
log.String("version", packageReference.Version),
128-
log.Int("dumpId", packageReference.DumpID))
128+
log.Int("uploadID", packageReference.UploadID))
129129
continue
130130
}
131131
pkg := *pkgRef

internal/codeintel/autoindexing/internal/background/dependencies/job_dependency_sync_scheduler_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func TestDependencySyncSchedulerJVM(t *testing.T) {
2727
mockScanner := NewMockPackageReferenceScanner()
2828
mockUploadsSvc.ReferencesForUploadFunc.SetDefaultReturn(mockScanner, nil)
2929
mockUploadsSvc.GetUploadByIDFunc.SetDefaultReturn(shared.Upload{ID: 42, RepositoryID: 50, Indexer: "scip-java"}, true, nil)
30-
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{DumpID: 42, Scheme: dependencies.JVMPackagesScheme, Name: "name1", Version: "v2.2.0"}}, true, nil)
30+
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{UploadID: 42, Scheme: dependencies.JVMPackagesScheme, Name: "name1", Version: "v2.2.0"}}, true, nil)
3131

3232
handler := dependencySyncSchedulerHandler{
3333
uploadsSvc: mockUploadsSvc,
@@ -78,7 +78,7 @@ func TestDependencySyncSchedulerGomod(t *testing.T) {
7878
mockScanner := NewMockPackageReferenceScanner()
7979
mockUploadsSvc.ReferencesForUploadFunc.SetDefaultReturn(mockScanner, nil)
8080
mockUploadsSvc.GetUploadByIDFunc.SetDefaultReturn(shared.Upload{ID: 42, RepositoryID: 50, Indexer: "lsif-go"}, true, nil)
81-
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{DumpID: 42, Scheme: "gomod", Name: "name1", Version: "v2.2.0"}}, true, nil)
81+
mockScanner.NextFunc.PushReturn(shared.PackageReference{Package: shared.Package{UploadID: 42, Scheme: "gomod", Name: "name1", Version: "v2.2.0"}}, true, nil)
8282

8383
handler := dependencySyncSchedulerHandler{
8484
uploadsSvc: mockUploadsSvc,

internal/codeintel/codenav/iface.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88
)
99

1010
type UploadService interface {
11-
GetDumpsWithDefinitionsForMonikers(ctx context.Context, monikers []precise.QualifiedMonikerData) (_ []shared.Dump, err error)
11+
GetCompletedUploadsWithDefinitionsForMonikers(ctx context.Context, monikers []precise.QualifiedMonikerData) (_ []shared.CompletedUpload, err error)
1212
GetUploadIDsWithReferences(ctx context.Context, orderedMonikers []precise.QualifiedMonikerData, ignoreIDs []int, repositoryID int, commit string, limit int, offset int) (ids []int, recordsScanned int, totalCount int, err error)
13-
GetDumpsByIDs(ctx context.Context, ids []int) (_ []shared.Dump, err error)
14-
InferClosestUploads(ctx context.Context, repositoryID int, commit, path string, exactPath bool, indexer string) (_ []shared.Dump, err error)
13+
GetCompletedUploadsByIDs(ctx context.Context, ids []int) (_ []shared.CompletedUpload, err error)
14+
InferClosestUploads(ctx context.Context, repositoryID int, commit, path string, exactPath bool, indexer string) (_ []shared.CompletedUpload, err error)
1515
}

internal/codeintel/codenav/internal/lsifstore/document_metadata.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,13 @@ WHERE
131131
LIMIT 1
132132
`
133133

134-
func convertSCIPRangesToLocations(ranges []*scip.Range, dumpID int, path string) []shared.Location {
134+
func convertSCIPRangesToLocations(ranges []*scip.Range, uploadID int, path string) []shared.Location {
135135
locations := make([]shared.Location, 0, len(ranges))
136136
for _, r := range ranges {
137137
locations = append(locations, shared.Location{
138-
DumpID: dumpID,
139-
Path: path,
140-
Range: translateRange(r),
138+
UploadID: uploadID,
139+
Path: path,
140+
Range: translateRange(r),
141141
})
142142
}
143143

internal/codeintel/codenav/internal/lsifstore/document_metadata_test.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -156,22 +156,22 @@ func TestGetRanges(t *testing.T) {
156156
)
157157

158158
var (
159-
nonEmptyDefinitionLocations = []shared.Location{{DumpID: testSCIPUploadID, Path: path, Range: newRange(15, 16, 15, 24)}}
160-
tDefinitionLocations = []shared.Location{{DumpID: testSCIPUploadID, Path: path, Range: newRange(15, 25, 15, 26)}}
161-
valueDefinitionLocations = []shared.Location{{DumpID: testSCIPUploadID, Path: path, Range: newRange(15, 28, 15, 33)}}
159+
nonEmptyDefinitionLocations = []shared.Location{{UploadID: testSCIPUploadID, Path: path, Range: newRange(15, 16, 15, 24)}}
160+
tDefinitionLocations = []shared.Location{{UploadID: testSCIPUploadID, Path: path, Range: newRange(15, 25, 15, 26)}}
161+
valueDefinitionLocations = []shared.Location{{UploadID: testSCIPUploadID, Path: path, Range: newRange(15, 28, 15, 33)}}
162162

163163
nonEmptyReferenceLocations = []shared.Location{}
164164
tReferenceLocations = []shared.Location{
165-
{DumpID: testSCIPUploadID, Path: path, Range: newRange(15, 35, 15, 36)},
166-
{DumpID: testSCIPUploadID, Path: path, Range: newRange(15, 39, 15, 40)},
167-
{DumpID: testSCIPUploadID, Path: path, Range: newRange(15, 73, 15, 74)},
168-
{DumpID: testSCIPUploadID, Path: path, Range: newRange(15, 77, 15, 78)},
165+
{UploadID: testSCIPUploadID, Path: path, Range: newRange(15, 35, 15, 36)},
166+
{UploadID: testSCIPUploadID, Path: path, Range: newRange(15, 39, 15, 40)},
167+
{UploadID: testSCIPUploadID, Path: path, Range: newRange(15, 73, 15, 74)},
168+
{UploadID: testSCIPUploadID, Path: path, Range: newRange(15, 77, 15, 78)},
169169
}
170170
valueReferenceLocations = []shared.Location{
171-
{DumpID: testSCIPUploadID, Path: path, Range: newRange(15, 64, 15, 69)},
172-
{DumpID: testSCIPUploadID, Path: path, Range: newRange(16, 13, 16, 18)},
173-
{DumpID: testSCIPUploadID, Path: path, Range: newRange(16, 38, 16, 43)},
174-
{DumpID: testSCIPUploadID, Path: path, Range: newRange(16, 48, 16, 53)},
171+
{UploadID: testSCIPUploadID, Path: path, Range: newRange(15, 64, 15, 69)},
172+
{UploadID: testSCIPUploadID, Path: path, Range: newRange(16, 13, 16, 18)},
173+
{UploadID: testSCIPUploadID, Path: path, Range: newRange(16, 38, 16, 43)},
174+
{UploadID: testSCIPUploadID, Path: path, Range: newRange(16, 48, 16, 53)},
175175
}
176176

177177
nonEmptyImplementationLocations = []shared.Location(nil)

internal/codeintel/codenav/internal/lsifstore/locations_by_position.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func (s *store) GetBulkMonikerLocations(ctx context.Context, tableName string, u
7676
totalCount += len(monikerLocations.Locations)
7777
}
7878
trace.AddEvent("TODO Domain Owner",
79-
attribute.Int("numDumps", len(locationData)),
79+
attribute.Int("numUploads", len(locationData)),
8080
attribute.Int("totalCount", totalCount))
8181

8282
max := totalCount
@@ -94,9 +94,9 @@ outer:
9494
}
9595

9696
locations = append(locations, shared.Location{
97-
DumpID: monikerLocations.DumpID,
98-
Path: row.URI,
99-
Range: newRange(row.StartLine, row.StartCharacter, row.EndLine, row.EndCharacter),
97+
UploadID: monikerLocations.UploadID,
98+
Path: row.URI,
99+
Range: newRange(row.StartLine, row.StartCharacter, row.EndLine, row.EndCharacter),
100100
})
101101

102102
if len(locations) >= limit {
@@ -176,9 +176,9 @@ func (s *store) getLocations(
176176
for _, monikerLocation := range monikerLocations {
177177
for _, row := range monikerLocation.Locations {
178178
locations = append(locations, shared.Location{
179-
DumpID: monikerLocation.DumpID,
180-
Path: row.URI,
181-
Range: newRange(row.StartLine, row.StartCharacter, row.EndLine, row.EndCharacter),
179+
UploadID: monikerLocation.UploadID,
180+
Path: row.URI,
181+
Range: newRange(row.StartLine, row.StartCharacter, row.EndLine, row.EndCharacter),
182182
})
183183
}
184184
}
@@ -492,7 +492,7 @@ func deduplicateLocations(locations []shared.Location) []shared.Location {
492492

493493
func locationKey(l shared.Location) string {
494494
return fmt.Sprintf("%d:%s:%d:%d:%d:%d",
495-
l.DumpID,
495+
l.UploadID,
496496
l.Path,
497497
l.Range.Start.Line,
498498
l.Range.Start.Character,
@@ -555,7 +555,7 @@ func (s *store) GetMinimalBulkMonikerLocations(ctx context.Context, tableName st
555555
totalCount += len(monikerLocations.Locations)
556556
}
557557
trace.AddEvent("TODO Domain Owner",
558-
attribute.Int("numDumps", len(locationData)),
558+
attribute.Int("numUploads", len(locationData)),
559559
attribute.Int("totalCount", totalCount))
560560

561561
max := totalCount
@@ -573,9 +573,9 @@ outer:
573573
}
574574

575575
locations = append(locations, shared.Location{
576-
DumpID: monikerLocations.DumpID,
577-
Path: row.URI,
578-
Range: newRange(row.StartLine, row.StartCharacter, row.EndLine, row.EndCharacter),
576+
UploadID: monikerLocations.UploadID,
577+
Path: row.URI,
578+
Range: newRange(row.StartLine, row.StartCharacter, row.EndLine, row.EndCharacter),
579579
})
580580

581581
if len(locations) >= limit {

0 commit comments

Comments
 (0)