Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial object versioning support - retention of old generations if v…
…ersion is enabled, and getObject by generation (#60) * Object supporting updated/created/deleted date, as first step to support versions * Dockerfile reproducing with stages what drone is doing the CI, so we can reproduce locally. fmt-ed the files to pass the tests * rebase conflict issue - back to main golang image to run tests * rebase conflict issue - back to main golang image to run tests * attr related tests refactor * creation and modification dates should be generated and returned if not provided as inputs. Generation now also part of the output, following the same policy * some IaC state/config files we dont want to commit or embed in docker images * this allows us to create a bucket, for some extra manual tests * fmt, so docker build now passes * unifing gitignore. renaming some functions * storage interface we use in the backend now considering a bucket not just as an string, but an object that can have extra props. Introduced objectVersioning property in that layer, but still not being used * memory backend storing versionEnabled property as part of a type-struct that will keep the bucket objects and attributes, not just the name as we used to have. Some locks reviewed, as we can benefit from read locking in some functions. While createBucket used to always succeed, we have introduced a failure scenario: bucket already there and with different props than the new one being requested * versionEnabled bucket prop consumed by fakestorage package, exposed also to the bucket http endpoint for the server model, but only available and persisted for the memory engine * replacing a test that relies on the order of a listing by one that finds an occurrence in the output * WIP - developing tests for new getObject functions that accept specfic generation lookups, so we can implement multiple versions retention and verify that works * consolidatin backend object CRUD in one, looping for versioned and non versioned buckets * Introducing in bucket in memory an archive of objects as a second list, that lives in parallel to the active one. bucket in memory centralizing primitives to deal with two lists, considering if there is versioning, while the external functions consume them and deal with locking. * memory backends doing specific generation lookups, consdiering also the archived object list. fs backend refuses to work with specific generations * adding removal test in the backend reveals a bug. Fixed.. need to work to refactor/extend tests, also at fakestorage level * backend tests refactor. Now time to move to fakestorage and consume the versioning support there * dont see the point of this infra as code - not needed for the development in the end * that was pointing to IaC we have removed * minor test related refactors * reader against generation test, that surfaced a different handler needed to be modified to retrieve specific generations in that scenario * basic versioning and delete use cases mapped to fakestorage tests too, that again, surfaced some minor gaps. This starts to be potentially shareable * almost dummy change to retry build - node tests looks flaky. Minor doc update * if an object gets replaced by a new version, the archived one should have an according deletion date * bucket listing response was not considering versioning property * revisting logger usage - removing debugging stuff * minor fixes after rebase from latest master. Not checking acls in backend tests, as we currently do in master * this test duplicates too much the previous (versioning with multiple gens not affecting the normal behavior). We will consolidate and improve with the generations listing support * refactoring listing tests to reduce duplication and cover extra cases - after create on top of versioning or overwritting files should behave the same. That also prepares the ground for listing with versioning * generations in gcs are microseconds, so aligning the implementation * Update Dockerfile version bump Co-Authored-By: francisco souza <[email protected]> * pr feedback - promoting a CreateBucketWithOpts and keeping the old as it was, but deprecated * Update internal/backend/backend_test.go As suggested, we should mark test helpers to facilitate tracking where the original test is actually failing Co-Authored-By: francisco souza <[email protected]> * pr feedback - marking test helpers rather than passing descriptions to track where tets are failing. Keeping a few ones that are relevant as t.Log() * Update internal/backend/fs.go pr feedback - errors.New rather than fmt.Errorf Co-Authored-By: francisco souza <[email protected]> * Update internal/backend/fs.go pr feedback - errors.New replacing fmt.Errorf Co-Authored-By: francisco souza <[email protected]> * Update fakestorage/response.go pr feedback - no naked response Co-Authored-By: francisco souza <[email protected]> * Update fakestorage/response.go pr feedback - no naked response Co-Authored-By: francisco souza <[email protected]> * PR feedback * saving time and space reusing mod download from the tester layer, and we dont want to keep golangci-lint cache, as docker is invalidating the whole layer on changes, so its never reused but takes space
- Loading branch information