feat(e2e)!: fold module into simple_e2e crate#123
Draft
JustinKovacich wants to merge 2 commits into
Draft
Conversation
Cargo.toml already declares `license = "MIT OR Apache-2.0"` via SPDX; this materializes the actual text in the repo so downstream consumers, distros, and license scanners see the canonical templates rather than relying on the SPDX line alone. Same content as simple_e2e's license files. Copyright © 2026 MicroVision, Inc. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replaces the ~2000 lines of E2E implementation (CRC tables, profile
types, state machines, registry storage) with re-exports from the
sibling `simple_e2e` crate. `simple_someip::e2e` becomes a thin shim
keeping only what's genuinely SOME/IP-flavored:
* `E2EKey` — `(service_id, method_or_event_id)` pair plus
`from_message_id` constructor.
* `E2ERegistry` — pre-bound `simple_e2e::registry::Registry<E2EKey, 32>`.
* `CheckStatus` — owned snapshot of `simple_e2e::registry::CheckOutcome`
that crosses async channels (the underlying `CheckOutcome` borrows
the input buffer, so `ReceivedMessage` can't store it directly).
* `to_return_code` — SOME/IP-specific E2E status → wire-byte mapping
that previously lived on `E2ECheckStatus`.
Everything else is `pub use simple_e2e::…`.
# Motivation
`simple_someip` and `simple_e2e` had grown parallel taxonomies for the
same protocol — different enum names, different variant lists, different
error types. The split forced `iris_someip_messages` to maintain a
`compat` bridge with `got: 0, expected: 0` placeholder hazards (because
`simple_someip::e2e::E2ECheckStatus::CrcError` was tagless, while
`simple_e2e::profile4::ValidateError::CrcMismatch` carries real values).
This fold ends the parallel taxonomy and unblocks deletion of that
bridge in the downstream `dft` PR.
# Breaking changes (intentional, will tag as 0.8.0)
* `E2ECheckStatus` removed → use `CheckStatus`, which is
profile-discriminated and carries the rich underlying status enums
(real `got` / `expected` fields on `Invalid(...)`).
* `E2EProfile::Profile5WithHeader(config)` removed → use
`Profile5 { config, include_upper_header: IncludeUpperHeader::Yes }`.
Header inclusion is a per-binding option, not a third protocol variant.
* `e2e::Error` now aliases `simple_e2e::registry::ProtectError`.
Wire-validation outcomes (`TooShort` / `LengthMismatch` /
`DataIdMismatch` / `CrcMismatch`) surface via `CheckStatus::Invalid(_)`
rather than the error chain — they aren't failures of the check
operation itself, they're outcomes of it.
* `Client::register_e2e` / `Server::register_e2e` now return
`Result<(), E2ERegistryFull>`. The previous silent-drop-on-full was
a footgun; capacity must be handled explicitly.
# Tests
* `e2e::tests::*` — the new shim's smoke tests round-trip P4 through
the registry and verify `CheckStatus::to_return_code` mapping
(Ok→1, CrcMismatch→2, TooShort→6 BadArgument).
* `tests/client_server.rs::test_e2e_protect_on_publish_and_check_on_receive`
passes — proves the wire-format protect → wire-format check round-trip
through the SOME/IP transport still works end-to-end.
The remaining `tests/client_server.rs` tests have intermittent UDP/SD
port-conflict flakiness when run in parallel — pre-existing, unrelated
to this fold; verified by isolating each test, which passes.
# Dependency note
`simple_e2e` is currently a path dep (`path = "../simple_e2e"`).
Before publishing simple_someip 0.8.0 to crates.io, this must swap to
`version = "0.1"` once simple_e2e is published. The CHANGELOG entry
flags this.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors simple_someip::e2e to stop carrying its own E2E implementation and instead re-export the shared implementation from the new simple_e2e crate, keeping only SOME/IP-specific keying (E2EKey) and an owned check-status snapshot (CheckStatus) for cross-task storage.
Changes:
- Replace the in-tree E2E implementation (CRC helpers, configs, state, registry, protect/check logic) with
simple_e2ere-exports and a small SOME/IP shim. - Update client/server APIs and tests to use
CheckStatusand to handleregister_e2ereturningResult<(), E2ERegistryFull>. - Add Apache-2.0 and MIT license texts and document the breaking changes in the changelog.
Reviewed changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Cargo.toml | Adds simple_e2e dependency (currently as a path dependency). |
| Cargo.lock | Records simple_e2e as a new dependency. |
| src/e2e/mod.rs | Turns e2e into a thin shim: re-exports simple_e2e types and introduces E2EKey + owned CheckStatus with SOME/IP return-code mapping. |
| src/e2e/config.rs | Deletes in-tree E2E profile config types (now from simple_e2e). |
| src/e2e/crc.rs | Deletes in-tree CRC helpers (now from simple_e2e). |
| src/e2e/e2e_checker.rs | Deletes in-tree check logic (now from simple_e2e). |
| src/e2e/e2e_protector.rs | Deletes in-tree protect logic (now from simple_e2e). |
| src/e2e/error.rs | Deletes in-tree protect/check error type (now aliases simple_e2e error). |
| src/e2e/registry.rs | Deletes in-tree registry (now simple_e2e::registry::Registry). |
| src/e2e/state.rs | Deletes in-tree state tracking (now from simple_e2e). |
| src/lib.rs | Re-exports CheckStatus instead of E2ECheckStatus. |
| src/client/mod.rs | Updates ClientUpdate payload to carry Option<CheckStatus> and makes register_e2e return Result. |
| src/client/socket_manager.rs | Adapts receive-path E2E checking to simple_e2e::registry::CheckOutcome and stores owned CheckStatus. |
| src/server/mod.rs | Makes Server::register_e2e return Result<(), E2ERegistryFull> and documents the error. |
| tests/client_server.rs | Updates integration test to use CheckStatus and handle fallible registry registration. |
| CHANGELOG.md | Documents the fold, breaking API changes, and license files. |
| LICENSE-APACHE | Adds Apache 2.0 license text file. |
| LICENSE-MIT | Adds MIT license text file. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+16
to
+20
| # Path dep during development; swap to `version = "0.1"` from crates.io | ||
| # before publishing simple_someip 0.8.0. The `registry` feature provides | ||
| # `simple_e2e::registry::Registry<K, CAP>` which simple_someip wraps as | ||
| # `E2ERegistry` keyed on `E2EKey`. | ||
| simple_e2e = { path = "../simple_e2e", default-features = false, features = ["registry"] } |
| //! # Example | ||
| //! | ||
| //! ``` | ||
| //! ```ignore |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces ~2000 lines of duplicated E2E implementation (CRC tables, profile types, state machines, registry storage) with re-exports from `simple_e2e`. `simple_someip::e2e` becomes a thin shim keeping only what's genuinely SOME/IP-flavored.
Net diff: -1974 lines.
What stays in simple_someip::e2e
Everything else (`Profile4Config`, `Profile5Config`, `Profile4State`, `Profile5State`, `PROFILE4_HEADER_SIZE`, `PROFILE5_HEADER_SIZE`, `E2EProfile`, `Error`, `CheckOutcome`, `IncludeUpperHeader`, `E2ERegistryFull`) is `pub use simple_e2e::…`.
Why
`simple_someip` and `simple_e2e` had grown parallel taxonomies for the same protocol — different enum names, different variants, different errors. The split forced `iris_someip_messages` to ship a `compat` bridge with `got: 0, expected: 0` placeholder hazards (because `E2ECheckStatus::CrcError` was tagless, while `simple_e2e::profile4::ValidateError::CrcMismatch` carries real values).
This fold ends the parallel taxonomy and unblocks deletion of that bridge in the follow-on `dft` PR.
Breaking changes (intentional — tag as 0.8.0)
Test plan
Dependency-graph collision
simple_someip was already advancing toward 0.8.0 on `feature/phase21_api_symmetry`. Per the agreed sequencing in [[project_simple_someip_e2e_fold]] memo, this fold lands as 0.8.0 first, that branch becomes 0.9.0.
🤖 Generated with Claude Code