Page MenuHomePhabricator

[services] Backup - Move Service Blob Client
ClosedPublic

Authored by karol on Mar 29 2022, 4:39 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 23, 11:48 AM
Unknown Object (File)
Sat, Nov 23, 10:01 AM
Unknown Object (File)
Tue, Nov 19, 7:12 PM
Unknown Object (File)
Fri, Nov 15, 6:23 AM
Unknown Object (File)
Tue, Nov 5, 6:05 PM
Unknown Object (File)
Oct 13 2024, 4:36 PM
Unknown Object (File)
Oct 13 2024, 4:36 PM
Unknown Object (File)
Oct 13 2024, 4:36 PM

Details

Summary

Depends on D3612

I think we should separate reactors' code and clients' code(there may be more clients in the future).

Test Plan
cd services
yarn run-backup-service

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Mar 29 2022, 4:52 AM
Harbormaster failed remote builds in B7669: Diff 10765!
tomek requested changes to this revision.Mar 31 2022, 9:52 AM

Shouldn't we also update the imports?

I'm not sure if Communication name is ok... it's not obvious why the client is moved from client directory to Communication. Also, Communication sounds like a place where e.g. reactors could live.
If we're planning to have both clients and servers here, then it might be fine. But if only the clients, then maybe just /src/client?

This revision now requires changes to proceed.Mar 31 2022, 9:52 AM
In D3532#97908, @palys-swm wrote:

Shouldn't we also update the imports?

CMake seems to handle them properly.

I'm not sure if Communication name is ok... it's not obvious why the client is moved from client directory to Communication. Also, Communication sounds like a place where e.g. reactors could live.
If we're planning to have both clients and servers here, then it might be fine. But if only the clients, then maybe just /src/client?

The idea was to store the reactor classes in the Reactors directory. But ServiceBlobClient is not a reactor class so I wanted to keep it in a separate location. src/client could work, but maybe something more descriptive, like src/grpc-client? So there's also an information for what that client will be used?

tomek requested changes to this revision.Apr 5 2022, 9:23 AM

I'm not sure if Communication name is ok... it's not obvious why the client is moved from client directory to Communication. Also, Communication sounds like a place where e.g. reactors could live.
If we're planning to have both clients and servers here, then it might be fine. But if only the clients, then maybe just /src/client?

The idea was to store the reactor classes in the Reactors directory. But ServiceBlobClient is not a reactor class so I wanted to keep it in a separate location. src/client could work, but maybe something more descriptive, like src/grpc-client? So there's also an information for what that client will be used?

Good idea! src/grpc-client will work well

This revision now requires changes to proceed.Apr 5 2022, 9:23 AM

changed dir name as discussed

services/backup/docker-server/contents/server/CMakeLists.txt
52

Why do you need to put all these subdirectories in the include path? This is much more confusing than including with the path relative to src, like #include "grpc-client/whatever.h".

services/backup/docker-server/contents/server/CMakeLists.txt
52

For me, it is better. I guess there would be a problem if we wanted to have two files of the same name in separate directories. But otherwise, what are the downsides of having includes with file names only?

Ok, I have to add the paths to CMake, but still, if I don't I can immediately see an error so I know what went wrong.
Such an approach avoids "include hell". It's all good if you include in the file that's in the root dir, but if you include in the file that is in the subdir from another file that is in another subdir, you end up with something like this:

#include "../../../Reactors/client/base-reactors/ClientBidiReactorBase.h"

For me it looks/works better to do it like this:

#include "ClientBidiReactorBase.h"

It's more readable, easier to maintain and easier to refactor if necessary.

This revision is now accepted and ready to land.Apr 6 2022, 6:44 AM