Page MenuHomePhabricator

[services] Tunnelbroker - Initialization function exposed to Rust
ClosedPublic

Authored by max on Oct 20 2022, 7:34 AM.
Tags
None
Referenced Files
F3361255: D5429.id18104.diff
Sun, Nov 24, 3:57 PM
F3360553: D5429.diff
Sun, Nov 24, 1:22 PM
Unknown Object (File)
Thu, Nov 21, 6:29 AM
Unknown Object (File)
Sat, Nov 16, 4:10 AM
Unknown Object (File)
Wed, Nov 13, 8:07 AM
Unknown Object (File)
Fri, Nov 8, 3:56 PM
Unknown Object (File)
Fri, Nov 8, 10:42 AM
Unknown Object (File)
Fri, Nov 8, 12:35 AM

Details

Summary

This diff is a part of the flat diffs stack to transform the current Tunnelbroker project into a Rust app by calling the current C++ codebase from Rust. The related transition task is ENG-1072.

This diff introduces creating a Tunnelbroker.h header file which will be exposed and run in Rust main application entry point at main.rs (D5432) which contains an initialization function that calls the initialization functions from the former server.cpp.

Related Linear task: ENG-2092

CI Notice:
The CI will fail on this and further diffs until the D5461 where the changes to CI build commands are made.
This stack will be landed all in one to prevent CI from failing on diffs out of this stack.

Test Plan

1. CI Testing:
These diff changes are included as a part of the stack in the later D5461 diff, where the changes to CI build commands are made. The CI succeded on the D5461 which reflects that this changes are passing the build.

2. Manually testing:
These diff changes can be tested in the middle of the stack at D5436. To test it patch to D5436 using arc patch D5436, run nix develop. Go to tunnelbroker service directory services/tunnelbroker and run the Cargo building process cargo build or cargo run.
The Rust application will be successfully built.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

max held this revision as a draft.
max edited the test plan for this revision. (Show Details)
max added reviewers: varun, marcin. max added 1 blocking reviewer(s): jon.
max published this revision for review.Oct 20 2022, 8:22 AM
max edited the test plan for this revision. (Show Details)
This revision is now accepted and ready to land.Oct 25 2022, 5:39 PM
This revision now requires review to proceed.Oct 26 2022, 2:23 AM
tomek added inline comments.
services/tunnelbroker/src/libcpp/Tunnelbroker.cpp
17–34 ↗(On Diff #17712)

Were we checking this in the original version? I think this check is beneficial, but we still need to check if a table exists when performing operations later.

This revision is now accepted and ready to land.Oct 27 2022, 4:15 AM
max added inline comments.
services/tunnelbroker/src/libcpp/Tunnelbroker.cpp
17–34 ↗(On Diff #17712)

Were we checking this in the original version? I think this check is beneficial, but we still need to check if a table exists when performing operations later.

We were checking it when the gRPC handler was constructed. It doesn't make sense to me to check the table on every operations because the operation will fail anyway if table doesn't exists.
We are checking tables at the start because database operation can be invoked later, but we want to know are the table exists at the start of the app to fail if they are not.

max marked an inline comment as done.

Rebasing on parent changes.

Changing function name from initialization to initialize, based on the comment https://phab.comm.dev/D5432#162406.

This revision was landed with ongoing or failed builds.Nov 7 2022, 5:52 AM
This revision was automatically updated to reflect the committed changes.