Page MenuHomePhabricator

[services] Tunnelbroker - Changing the `ConfigManager` load function to include the sandbox condition
ClosedPublic

Authored by max on Jul 26 2022, 4:06 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Oct 17, 10:02 PM
Unknown Object (File)
Thu, Oct 17, 10:02 PM
Unknown Object (File)
Thu, Oct 17, 10:02 PM
Unknown Object (File)
Thu, Oct 17, 10:02 PM
Unknown Object (File)
Thu, Oct 17, 10:02 PM
Unknown Object (File)
Thu, Oct 17, 10:02 PM
Unknown Object (File)
Thu, Oct 17, 10:01 PM
Unknown Object (File)
Sep 17 2024, 3:28 PM

Details

Summary

Changing the ConfigManager.load() function to include the sandbox config condition to avoid duplications and fix some of the tests.

Test Plan

Run build with tests: yarn run-tunnelbroker-service-in-sandbox or build inside the Docker container with the export COMM_TEST_SERVICES=1 command before the cmake command.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

max held this revision as a draft.
max published this revision for review.Jul 26 2022, 4:10 AM
max edited the summary of this revision. (Show Details)
max added reviewers: tomek, karol.
tomek requested changes to this revision.EditedJul 26 2022, 5:55 AM

What do you think about introducing this change in load method of config manager? (to avoid the duplication)

This revision now requires changes to proceed.Jul 26 2022, 5:55 AM

How did it work before without an argument provided?

In D4638#133143, @tomek wrote:

What do you think about introducing this change in load method of config manager? (to avoid the duplication)

The main changes are already done (landed) in D4129. It's a follow-up fix! I've missed this and some of the tests failed. This diff is a fix.

In D4638#133161, @max wrote:
In D4638#133143, @tomek wrote:

What do you think about introducing this change in load method of config manager? (to avoid the duplication)

The main changes are already done (landed) in D4129. It's a follow-up fix! I've missed this and some of the tests failed. This diff is a fix.

Ok, got it. After seeing this code I think it would be better to remove the parameter from load method and move the if there. Current solution requires adding this logic to every test case - this isn't maintainable. If the change from this diff was included in D4129 I would suggest the same. Can we do this?

This revision is now accepted and ready to land.Jul 26 2022, 6:26 AM

Changing the ConfigManager.load() function to include the sandbox config condition to avoid duplications and fix some of the tests.

This revision is now accepted and ready to land.Jul 26 2022, 7:28 AM
max requested review of this revision.EditedJul 26 2022, 7:30 AM
max retitled this revision from [services] Tunnelbroker - Fix tests build due to the ConfigManager changes to [services] Tunnelbroker - Changing the `ConfigManager` load function to include the sandbox condition.
max edited the summary of this revision. (Show Details)
In D4638#133182, @tomek wrote:
In D4638#133161, @max wrote:
In D4638#133143, @tomek wrote:

What do you think about introducing this change in load method of config manager? (to avoid the duplication)

The main changes are already done (landed) in D4129. It's a follow-up fix! I've missed this and some of the tests failed. This diff is a fix.

Ok, got it. After seeing this code I think it would be better to remove the parameter from load method and move the if there. Current solution requires adding this logic to every test case - this isn't maintainable. If the change from this diff was included in D4129 I would suggest the same. Can we do this?

I've checked the function usage and yes we can do this instead. Good catch, thanks! The load() function was changed and the old function moved to the private space and renamed to loadConfigFile().

tomek added inline comments.
services/tunnelbroker/src/server.cpp
43 ↗(On Diff #15003)

We should keep tunnelbroker because argv[0] can contain a lot of noise, e.g. path.

This revision is now accepted and ready to land.Jul 27 2022, 4:47 AM
max marked an inline comment as done.

Using 'tunnelbroker' in InitLogging(...).

services/tunnelbroker/src/server.cpp
43 ↗(On Diff #15003)

We should keep tunnelbroker because argv[0] can contain a lot of noise, e.g. path.

Agree with that. Thanks, @tomek.

This revision was landed with ongoing or failed builds.Jul 27 2022, 8:42 AM
This revision was automatically updated to reflect the committed changes.