Skip to content

up-rust 0.4 compatibility #12

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

Merged
merged 12 commits into from
Feb 12, 2025
Merged

up-rust 0.4 compatibility #12

merged 12 commits into from
Feb 12, 2025

Conversation

AnotherDaniel
Copy link
Contributor

This change set makes up-subscription-rust compatible with the current release versions of up-spec and up-rust (up-rust v0.4.0). There are many modified lines of code, which radiate out from a breaking API change that was introduced with up-spec 1.6.0-alpha.4, namely the removal of the subscriber/source URI from the SubscriberInfo message.

This change broke the entire frontend of up-subscription, and most of the test mocks that went with that, so more than half the codebase needed to be touched. Reworking all this offered an opportunity to pull in the RpcClient/RpcServer goodness that has been added to up-rust recently.

The result feels more concise and streamlined in many places, but there is work to be done around configuring the up-transport modules offered by up-subscription-cli, and substantial changes to make usubscription-rust functionally compliant with the latest revision of the USubscription specification. This will happen in upcoming PRs.

@AnotherDaniel AnotherDaniel added the bug Something isn't working label Feb 5, 2025
@AnotherDaniel AnotherDaniel self-assigned this Feb 5, 2025
@sophokles73
Copy link

I assume that the three commits can/should be squashed into one?

@AnotherDaniel
Copy link
Contributor Author

Yes - wanted to wait if something else comes up, but on merging these can be squashed.

Copy link

@sophokles73 sophokles73 left a comment

Choose a reason for hiding this comment

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

In general, I have some problems understanding your approach to defining/using Rust modules, i.e. IMHO cohesion could be improved and coupling between modules could be reduced quite a bit.

The request handling code in subscription_manager should be refactored to use dedicated functions for handling/implementing the individual operations in order to improve readability and maintainability.

Copy link

@sophokles73 sophokles73 left a comment

Choose a reason for hiding this comment

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

LGTM

.inspect_err(|e| panic!("Error setting up Zenoh transport: {}", e.get_message()))
.unwrap(),
),
_ => None,

Choose a reason for hiding this comment

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

why don't you panic right here instead of explicitly checking next, if the transport is None?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because that results in an unreachable code warning for everyone after the match expression - I've had it like that for the last week, this was the reason for all the intermediate builds failing.

@AnotherDaniel AnotherDaniel merged commit b613d30 into main Feb 12, 2025
11 checks passed
@AnotherDaniel AnotherDaniel deleted the SubscriberInfo_changes branch February 12, 2025 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants