Page MenuHomePhabricator

[services] Backup - Improve code style in create new backup reactor
ClosedPublic

Authored by karol on Apr 19 2022, 1:57 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jul 1, 2:53 AM
Unknown Object (File)
Sun, Jun 30, 5:55 PM
Unknown Object (File)
Sun, Jun 30, 12:29 PM
Unknown Object (File)
Sun, Jun 30, 12:17 PM
Unknown Object (File)
Sun, Jun 30, 10:03 AM
Unknown Object (File)
Sun, Jun 30, 10:03 AM
Unknown Object (File)
Sun, Jun 30, 10:03 AM
Unknown Object (File)
Sun, Jun 30, 10:03 AM

Details

Summary

Depends on D3776

Add append holder logic to the create new backup reactor. In a case, the data already exists when creating a new backup, we're just going to add a holder to the existing blob.

https://linear.app/comm/issue/ENG-672/create-addreferencetohashbyholder-in-the-blob-service

Test Plan

compile the service

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ashoat requested changes to this revision.Apr 19 2022, 10:56 AM

Please spend more time thinking about writing readable code. I've repeatedly given you feedback about indentation and control flow. I want to stop having to repeat the same feedback over and over... I really need you to grok and internalize the feedback you're being given

services/backup/docker-server/contents/server/src/Reactors/server/CreateNewBackupReactor.h
136–154 ↗(On Diff #11595)

Let's find a way to reduce indentation here

This revision now requires changes to proceed.Apr 19 2022, 10:56 AM

Please spend more time thinking about writing readable code. I've repeatedly given you feedback about indentation and control flow. I want to stop having to repeat the same feedback over and over... I really need you to grok and internalize the feedback you're being given

Hey! Thanks for the feedback but honestly I don't think repeating this stuff is necessary. As you observed in D3738, there must be something wrong with the clang-format. In such a case I don't see a point of looking at the following diffs only to spot such problems - it's kind of obvious they'll be there. So in this case, please don't put the blame on me, I understood the comments in D3738 and it's enough for me to take a look at this.

There is a task for this: https://linear.app/comm/issue/ENG-915/services-fix-clang-paths

It's true I should've probably done this earlier but on the other hand, I had to wait for D3485 (which was blocked by Jim's absence) because that changes the directory structure.

I'm going to take care of this soon. Please, do not review any following diffs until then just looking at the coding style, I'm aware of the problem.

To be clear, the feedback isn't about clang-format – it's about unnecessarily deeply nested structures of control flow. This sort of stuff

Ok, sorry I misunderstood here.

tomek added inline comments.
services/backup/docker-server/contents/server/src/Reactors/server/CreateNewBackupReactor.h
63 ↗(On Diff #11700)

Can we be more specific about the holder here

tomek added inline comments.
services/backup/docker-server/contents/server/src/Reactors/server/CreateNewBackupReactor.h
63 ↗(On Diff #11700)

This diff was updated, but just due to the rebase. Please remember to address this before landing.

This revision is now accepted and ready to land.Apr 21 2022, 10:12 AM
karol retitled this revision from [services] Backup - Add append holder logic to create new backup reactor to [services] Backup - improve code style in create new backup reactor.Apr 22 2022, 3:37 AM
karol edited the test plan for this revision. (Show Details)
karol retitled this revision from [services] Backup - improve code style in create new backup reactor to [services] Backup - Improve code style in create new backup reactor.

yet one more rebase

rebase incoming

fix invalid rebase

ashoat added 1 blocking reviewer(s): tomek.

Don't feel super strongly about the inline comment, but I do think it makes readability worse. Curious for @palys-swm's perspective

services/backup/docker-server/contents/server/src/Reactors/server/CreateNewBackupReactor.h
114–119 ↗(On Diff #11800)

What is the point of this change? Isn't it logically equivalent? I think it hurts readability...

tomek added inline comments.
services/backup/docker-server/contents/server/src/Reactors/server/CreateNewBackupReactor.h
113–119 ↗(On Diff #11800)
114–119 ↗(On Diff #11800)

Yeah, I agree. It looks like the initial revision had a deeply nested structure. It was improved and then rebased a couple of times. The end result doesn't introduce any significant changes, so keeping it-else-if construction makes the most sense.

This revision is now accepted and ready to land.Apr 26 2022, 4:22 AM
This revision was landed with ongoing or failed builds.Apr 26 2022, 4:43 AM
This revision was automatically updated to reflect the committed changes.