Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(rust): change the type of the name and from arguments to Address #8719

Open
wants to merge 1 commit into
base: adrian/args-updates-portal-commands
Choose a base branch
from

Conversation

takaebato
Copy link
Contributor

@takaebato takaebato commented Dec 22, 2024

Current behavior

  • The outlet commands in tcp, influx, and kafka use String type for the name and from arguments.

Proposed changes

Fixes #8710

  • This PR changes the type of the name and from arguments in tcp, influx, and kafka to Address.

I’d appreciate any feedback!

Checks

  • All commits in this Pull Request are signed and Verified by Github.
  • All commits in this Pull Request follow the Ockam commit message convention.
  • There are no Merge commits in this Pull Request. Ockam repo maintains a linear commit history. We merge Pull Requests by rebasing them onto the develop branch. Rebasing to the latest develop branch and force pushing to your Pull Request branch is okay.
  • I have read and accept the Ockam Community Code of Conduct.
  • I have read and accepted the Ockam Contributor License Agreement by adding my Git/Github details in a row at the end of the CONTRIBUTORS.csv file in a separate pull request to the build-trust/ockam repository. The easiest way to do this is to edit the CONTRIBUTORS.csv file in the github web UI and create a separate Pull Request, this will mark the commit as verified.

@takaebato takaebato force-pushed the takaebato/change-command-arg-type branch 6 times, most recently from 41a6d47 to 2071b22 Compare December 22, 2024 14:07
@takaebato takaebato force-pushed the takaebato/change-command-arg-type branch from 2071b22 to b67b6ee Compare December 22, 2024 14:10
@@ -34,16 +35,16 @@ pub struct CreateCommand {
/// Examples are `/service/my-outlet` or `my-outlet`.
/// If not provided, `/service/kafka_outlet` will be used.
/// You will need this address when creating a Kafka Inlet using `ockam kafka-inlet create`.
#[arg(default_value_t = kafka_default_outlet_addr(), value_parser = extract_address_value)]
pub name: String,
#[arg(default_value = DefaultAddress::KAFKA_OUTLET, value_parser = extract_address)]
Copy link
Contributor Author

@takaebato takaebato Dec 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used default_value = DefaultAddress::KAFKA_OUTLET instead of the Address type like default_value_t = Address::from(DefaultAddress::KAFKA_OUTLET) because the latter outputs 0#kafka_outlet as the default value of name in the message of the kafka-outlet create --help command, which seems undesirable.

@takaebato takaebato marked this pull request as ready for review December 22, 2024 14:48
@takaebato takaebato requested a review from a team as a code owner December 22, 2024 14:48
@takaebato takaebato mentioned this pull request Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant