pulumi/pkg/backend/filestate
bors[bot] ff7337e87a
Merge #12496
12496: filestate/projectStore: Optimize ListReferences r=abhinav a=abhinav

ListReferences for project layout is currently inefficient.
It roughly does the equivalent of:

    for proj in bucket.List(stacksDir)
        for ref in bucket.List(stacksDir + "/" + proj):
            # ...

This is fine for local, file-based storage,
but super inefficient for S3 or Azure.
The reason this was written as above is because we treat the bucket
as a directory tree in listBucket.

This changes projectStore.ListReferences to use the underlying
bucket.List method directly--without setting the Delimiter.
This treats the bucket as a flat file list instead of a hierarchy,
and we can extract project and stack names from it in one go.


Co-authored-by: Abhinav Gupta <abhinav@pulumi.com>
2023-04-01 04:22:52 +00:00
..
backend.go refactor(filestate): Don't use t.Setenv in tests 2023-03-31 16:29:06 -07:00
backend_legacy_test.go test(filestate): Add legacy copies of migrated tests 2023-03-31 13:21:30 -07:00
backend_test.go refactor(filestate): Don't use t.Setenv in tests 2023-03-31 16:29:06 -07:00
bucket.go filestate: Re-add project support 2023-03-31 13:21:36 -07:00
bucket_test.go filestate: Plumb context through constructor 2023-03-13 13:24:32 -07:00
doc.go Document Go packages (#6009) 2021-01-11 11:07:59 -07:00
lock.go filestate/lock: Fix path matching on Windows 2023-03-31 16:29:04 -07:00
meta.go refactor(filestate): Don't use t.Setenv in tests 2023-03-31 16:29:06 -07:00
meta_test.go refactor(filestate): Don't use t.Setenv in tests 2023-03-31 16:29:06 -07:00
snapshot.go filestate/internal: Use stack reference, not name 2023-03-16 14:44:33 -07:00
stack.go filestate/internal: Use stack reference, not name 2023-03-16 14:44:33 -07:00
state.go refactor(filestate): Don't use t.Setenv in tests 2023-03-31 16:29:06 -07:00
state_test.go filestate: Re-add project support 2023-03-31 13:21:36 -07:00
store.go filestate/projectStore: Optimize ListReferences 2023-03-31 20:47:11 -07:00
store_test.go filestate: Re-add project support 2023-03-31 13:21:36 -07:00