feat: macros program & service routing by InterfaceId#1176
feat: macros program & service routing by InterfaceId#1176vobradovich wants to merge 23 commits intomaster-idl-v2from
program & service routing by InterfaceId#1176Conversation
Summary of ChangesHello @vobradovich, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request overhauls the internal routing and metadata handling within the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a significant and valuable refactoring of the program and service routing mechanism, moving from string-based routes to a more robust and type-safe system based on InterfaceId. The changes are extensive, touching macros, core logic, and examples, and appear to be well-executed. My review has identified a few areas for improvement, including a typo in a public constant, some commented-out tests that should be re-enabled to prevent regressions, a misleading test name, and some dead code in generated snapshots. Addressing these points will help ensure the quality and maintainability of this new feature.
|
|
||
| #[test] | ||
| fn message_header_try_read_fails_insufficient_bytes() { | ||
| fn message_header_try_read_fails_invalid_magic() { |
There was a problem hiding this comment.
The test message_header_try_read_fails_insufficient_bytes was renamed to message_header_try_read_fails_invalid_magic. However, the test case let bytes = [0x47, 0x4D, 1, 15, 1, 2, 3, 4, 5, 6, 7, 8, 210, 4]; has a length of 14, which is less than MINIMAL_HLEN (16). The try_read_bytes function first checks for length, so it will fail with Insufficient bytes for header. The test name is misleading. It should probably be ..._insufficient_bytes or the test case should be updated to test for invalid magic bytes with sufficient length.
| if let Ok(sig) = TryInto::<[u8; 4]>::try_into(&input[..4]) { | ||
| if let Some(idx) = __METHOD_SIGS.iter().position(|s| s == &sig) { | ||
| let (route, method) = __METHOD_ROUTES[idx]; | ||
| let (interface_id, entry_id, route_idx) = __METHOD_ROUTES[idx]; | ||
| } | ||
| } |
There was a problem hiding this comment.
No description provided.