ockam icon indicating copy to clipboard operation
ockam copied to clipboard

Refactor `ockam portal ...` commands into `ockam tcp-...` commands

Open mrinalwadhwa opened this issue 2 years ago • 5 comments

We currently have:

ockam portal create tcp-inlet ..
ockam portal create tcp-outlet ...

We want to change these to:

ockam tcp-inlet create ...
ockam tcp-outlet create ...

Without changing their behavior.

These commands are defined here: https://github.com/build-trust/ockam/blob/develop/implementations/rust/ockam/ockam_command/src/portal/create.rs


Related: #3076 #3078


We love helping new contributors! If you have questions or need help as you work on your first Ockam contribution, please leave a comment on this discussion. If you're looking for other issues to contribute to, checkout issues labeled - https://github.com/build-trust/ockam/labels/good%20first%20issue or https://github.com/build-trust/ockam/labels/help%20wanted

mrinalwadhwa avatar Jul 31 '22 03:07 mrinalwadhwa

Hi I'd be interested in trying to do this. Would this require reworking the portal subcommand (by removing it?) would this mean creating tcp-inlet and tcp-outlet folders in the ockam_command/src folder? as the portal subcommand is being removed (as the only enum is used to point to the create command for these two right now).

Hwatwasthat avatar Aug 05 '22 14:08 Hwatwasthat

@Hwatwasthat thank you for taking this on 🥳

Would this require reworking the portal subcommand (by removing it?)

Yes

would this mean creating tcp-inlet and tcp-outlet folders in the ockam_command/src folder? as the portal subcommand is being removed (as the only enum is used to point to the create command for these two right now).

Let's create:

ockam_command/
  src/
    tcp/
      mod.rs
      inlet/
        mod.rs
        create.rs
      outlet/
        mod.rs
        create.rs        

We want to keep the folders because we'll add other commands soon. Keeping them under a tcp/ folder would be nice because we want to in the near future make TCP functionality a plugin so all of them living in one folder would be helpful.

this also applied to tcp-connection and tcp-listener in https://github.com/build-trust/ockam/issues/3076

mrinalwadhwa avatar Aug 05 '22 15:08 mrinalwadhwa

@Hwatwasthat note in https://github.com/build-trust/ockam/pull/3140 for https://github.com/build-trust/ockam/issues/3076 @anuvratsingh started the ockam_command/src/tcp/* directory structure.

The inlet & outlet directories for tcp-inlet & tcp-outlet command will live there as well. Let me know in case you have any questions.

mrinalwadhwa avatar Aug 07 '22 00:08 mrinalwadhwa

Hey @mrinalwadhwa, there is a TODO: Add delete, list, show subcommands, which I might be able to do, so should I do that in tcp inlet/outlet or in portal which would be refactored later on?

lameferret avatar Aug 07 '22 20:08 lameferret

@anuvratsingh I think if you create them directly under tcp/inlet and tcp/outlet then it would lead to less conflicts irrespective of the order in which the PRs are created

mrinalwadhwa avatar Aug 07 '22 20:08 mrinalwadhwa

@Hwatwasthat 👋 checking back to see if you need help with this or have any questions about the issue? If you don't have time to work on it, that's okay too, we'll open it up for others to explore.

mrinalwadhwa avatar Aug 11 '22 05:08 mrinalwadhwa

Hey, yeah I've gotten a bit busier than expected! I'll keep an eye on it and do out anyway for the practice but open it up so it might get done faster if I can't find the time to do it.

On Thu, 11 Aug 2022, 06:23 Mrinal Wadhwa, @.***> wrote:

@Hwatwasthat https://github.com/Hwatwasthat 👋 checking back to see if you need help with this or have any questions about the issue? If you don't have time to work on it, that's okay too, we'll open it up for others to explore.

— Reply to this email directly, view it on GitHub https://github.com/build-trust/ockam/issues/3077#issuecomment-1211563418, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHDI7P347GDYRXXDULTD7RDVYSE45ANCNFSM55EHLGJA . You are receiving this because you were mentioned.Message ID: @.***>

Hwatwasthat avatar Aug 12 '22 10:08 Hwatwasthat

Thank you, when you have time to do some for practice / get familiar with the code. Have a look at the new issue in the https://github.com/build-trust/ockam/labels/good%20first%20issue label.

mrinalwadhwa avatar Aug 12 '22 10:08 mrinalwadhwa