Skip to content

feat(e2e)!: fold module into simple_e2e crate#123

Draft
JustinKovacich wants to merge 2 commits into
mainfrom
feat/e2e_fold_into_simple_e2e
Draft

feat(e2e)!: fold module into simple_e2e crate#123
JustinKovacich wants to merge 2 commits into
mainfrom
feat/e2e_fold_into_simple_e2e

Conversation

@JustinKovacich
Copy link
Copy Markdown
Contributor

DO NOT MERGE YET. Blocked on simple_e2e being on crates.io.
Once `simple_e2e` 0.1.0 publishes, the path dep in Cargo.toml must swap to `version = "0.1"` before merging. See CHANGELOG entry + tracking comment on luminartech/simple_e2e#3 for the full sequence.

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

  • `E2EKey` — `(service_id, method_or_event_id)` pair + `from_message_id(MessageId)` constructor.
  • `E2ERegistry` — `pub type = simple_e2e::registry::Registry<E2EKey, 32>`.
  • `CheckStatus` — owned profile-discriminated snapshot of `simple_e2e::registry::CheckOutcome` (the outcome itself borrows the input buffer, so `ReceivedMessage` can't store it directly across async channel boundaries).
  • `CheckStatus::to_return_code` — SOME/IP-specific E2E status → wire-byte mapping that previously lived on `E2ECheckStatus`. Real CRC failures now map to 2; rich `Invalid(_)` variants map appropriately (CrcMismatch→2, others→6).

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)

  • `E2ECheckStatus` → `CheckStatus` (profile-discriminated, rich inner status with real `got`/`expected` on CRC/length mismatches).
  • `E2EProfile::Profile5WithHeader(config)` → `E2EProfile::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 surface via `CheckStatus::Invalid(_)` rather than the error chain.
  • `Client::register_e2e` / `Server::register_e2e` return `Result<(), E2ERegistryFull>`. Previous silent-drop-on-full was a footgun.

Test plan

  • `cargo build` + `cargo build --features client,server` — clean
  • `cargo test --features client,server test_e2e_protect_on_publish_and_check_on_receive` — passes (end-to-end wire protect → wire check round-trip via SOME/IP transport)
  • New unit tests in `e2e::tests::` cover registry round-trip + `CheckStatus::to_return_code` mapping
  • `cargo fmt --check` — clean
  • Full test suite under `--test-threads=1` to confirm pre-existing UDP/SD port-conflict flakiness is unchanged (some `client_server` tests have cross-talk when run in parallel, observed both before and after this fold — verify on this PR's CI run)
  • Before merge: path dep → version dep swap in Cargo.toml
  • Before merge: version bump to 0.8.0 in Cargo.toml + matching CHANGELOG release line

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

JustinKovacich and others added 2 commits May 13, 2026 15:16
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>
Copilot AI review requested due to automatic review settings May 13, 2026 19:50
@JustinKovacich JustinKovacich self-assigned this May 13, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_e2e re-exports and a small SOME/IP shim.
  • Update client/server APIs and tests to use CheckStatus and to handle register_e2e returning Result<(), 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 thread Cargo.toml
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"] }
Comment thread src/e2e/mod.rs
//! # Example
//!
//! ```
//! ```ignore
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.

2 participants