chore: Rename uploadstore packages for clarity#63931
Conversation
eseliger
left a comment
There was a problem hiding this comment.
I’m not sure I like this a lot - KV is already taken for redis in our codebase (search KeyValue symbol)
Also, searchkv to me sounds like the search metadata which is key value pairs.
|
Is KV really the right name for this? A more common name for the stores this abstracts over is a blobstore. Or even just s3 like. uploadstore is a bad name to be fair. Also search's convenience package around this doesn't need to match whatever name we pick here, it should probably match what search cares about in this case, which is a result store or blob store. |
|
I could very well live with |
|
@eseliger @keegancsmith thanks for the feedback, I did not consider the conflict with the redis-associated packages. I don't want to re-use
|
|
No strong opinion on (2) |
The most common usage in code referring to this package is referring to the
|
|
we could rename to |
|
AFAICT, we use the "Store" convention when it involves CRUD operations and "Client" when talking to 1st party and 3rd party services, so layering-wise, I think it would make sense for a Store to internally contain a Client based on whether it's talking to S3/GCS/blobstore. I want to avoid the name punning/duplication because that has been cited as a frequent source of confusion whenever we've had someone new join the team and on-board onto the backend codebase, as it's hard to keep track of the same name meaning different things in different parts of the code as you're jumping around. There's also this bit in Effective Go
|
|
Thoughts:
|
|
I don't think there is a single solution which will satisfy everyone, so I'm going to pick something in-between and merge it on Monday unless someone complains loudly.
This fixes the poor |
eseliger
left a comment
There was a problem hiding this comment.
Not that comfortable with object as that reminds me too much of JS's object and doesn't really convey to me that this is related to storage (and really, access to blobstore), but I'm happy to agree to disagree :)
internal/uploadstorepackage is renamed toobjectindicatingthat it is meant to provide a generic object storage wrapper.
search/exhaustive/uploadstorepackage is used in very few placesso I've merged into the
internal/searchpackage similar tointernal/embeddings.There are a few reasons to do the renaming.
The word
uploadin a more general context is ambiguous (just ininternal/) - in the codeintel context,it means "SCIP index" but it can also be interpreted generically ("upload of some data").
Better readability -
kv.Storeis much shorter thanuploadstore.Store. Additionally, weuse the term
StoreA LOT in the codebase, and usually, these refer to wrappers over sometables in some DB. However, we don't use key-value stores in lots of places, so previously
one needed to do extra mental-bookkeeping that "oh, uploadstore.Store is different from the other stores".
Making things worse, some of our code also has:
And code which says
uploadsstore.Store(notice the extras😢), which is actually a wrapperover some key DB tables like
lsif_uploads.Test plan
Covered by existing tests