-
Notifications
You must be signed in to change notification settings - Fork 5
feat(idl-v2): intoduce IDL V2 (spec, ast, parser, gen) and Sails Header (spec, routing, code gen) #1186
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
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: vobradovich <vadik.on@gmail.com>
…ted client (#1180) Co-authored-by: Sabaun Taraki <sabaun.dev@gmail.com> Co-authored-by: Mansur Azatbek <mansur62624@gmail.com> Co-authored-by: Mansur <52788547+m62624@users.noreply.github.com>
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 core interface definition and message handling mechanisms within the Sails framework. It introduces a robust IDL V2 for defining program and service structures and a new Sails Header for efficient, deterministic message routing. These foundational changes enhance the system's extensibility, developer experience, and compatibility with external tooling by providing clear, standardized protocols for interaction. Highlights
Ignored Files
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request primarily focuses on updating the sails-rs framework to a new IDL v2 specification and integrating a new message header format. Key changes include upgrading askama and related dependencies, introducing sails-idl-parser-v2 and sails-reflect-hash crates, and updating Cargo.toml files accordingly. The README.md has been revised to reflect the new 'Sails Header v1' payload encoding, which uses deterministic interface_id, entry_id, and route_idx for message routing. Benchmark IDL files and client generation logic have been refactored to align with the new IDL v2 format, including adding ReflectHash derives to various structs and enums for structural hashing. Several test files and examples have been updated to use the new message header for encoding/decoding and to correctly handle service routing via route_idx and interface_id instead of string-based routes. Documentation for IDL V2, Interface ID, and ReflectHash specifications has been added. Review comments highlighted the need to correct an example sorting order in the Interface ID spec, ensure enum names are included in structural hashes to prevent collisions, fix an inconsistency in the Sails Header v1 example regarding header length, refactor duplicated client generation code into a helper function, and correct a typo in the IDL V2 spec.
| 47 4D 01 0B 18 07 F6 E5 D4 C3 B2 A1 02 00 00 00 | ||
| ^magic ^ver ^hlen ^interface_id LE ^entry_id ^route ^reserved | ||
| ``` | ||
|
|
||
| Payload bytes follow immediately after byte offset 11. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a couple of inconsistencies in this example:
- The
hlen(header length) is shown as0B(11 bytes), but the specification states the base header is 16 bytes. It should be0x10. - The comment
Payload bytes follow immediately after byte offset 11is also incorrect due to the header size. It should be offset 16.
The same issue is present in Example B.
🔬 Benchmark Comparison
Legend
🤖 This comment was automatically generated by the benchmark comparison workflow at 62b8a73. |
🔬 Benchmark Comparison
Legend
🤖 This comment was automatically generated by the benchmark comparison workflow at f0ac4e5. |
This PR introduces significant enhancements to the Sails framework with IDL v2, focusing on routing by header in programs, services, and generated clients. Here's a breakdown of the changes:
This represents a major architectural shift in how Sails programs handle service routing, moving from a simple byte-route model to a more sophisticated header-based system with interface IDs for improved scalability and extensibility.