-
Notifications
You must be signed in to change notification settings - Fork 44
Refactor power policy to use direct async calls with power devices #553
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: v0.2.0
Are you sure you want to change the base?
Refactor power policy to use direct async calls with power devices #553
Conversation
1588510 to
aa3e2e0
Compare
Cargo Vet Audit Passed
|
cda7d9a to
3467d89
Compare
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.
Pull request overview
This PR refactors the power policy service architecture to use direct async calls instead of deferred IPC patterns. It introduces a proxy pattern for power device communication, extracts service message types into dedicated crates for better modularity, and adds comprehensive test coverage for the power policy service.
Changes:
- Refactors power policy to use direct async communication with devices via a proxy pattern
- Extracts thermal, debug, and battery service message types into separate reusable crates
- Implements MCTP relay infrastructure in embedded-services for message routing
- Adds test coverage for power policy consumer flows
Reviewed changes
Copilot reviewed 26 out of 32 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| type-c-service/src/wrapper/proxy.rs | New proxy pattern for power device communication channels |
| power-policy-service/src/*.rs | Refactored to use direct device trait calls instead of action state machine |
| thermal-service-messages/ | New crate containing thermal service request/response types |
| debug-service-messages/ | New crate containing debug service request/response types |
| battery-service-messages/ | New crate containing battery service request/response types |
| embedded-service/src/relay/ | New MCTP relay infrastructure for message serialization |
| embedded-service/src/event.rs | New event sender/receiver traits |
| embedded-service/src/power/policy/device.rs | Refactored device with InternalState and DeviceTrait |
| espi-service/src/mctp.rs | MCTP relay implementation using new infrastructure |
| power-policy-service/tests/ | New test files for consumer flows |
| examples/std/src/bin/*.rs | Updated examples for new architecture |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4be5bff to
a838d81
Compare
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.
Pull request overview
Copilot reviewed 28 out of 38 changed files in this pull request and generated 10 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d3aa53a to
57c10a6
Compare
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.
Pull request overview
Copilot reviewed 28 out of 40 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
57c10a6 to
fbe2f13
Compare
fbe2f13 to
fd95083
Compare
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.
Pull request overview
Copilot reviewed 28 out of 40 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
31b3b00 to
69a1d6b
Compare
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.
Pull request overview
Copilot reviewed 32 out of 45 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bbc2ee1 to
d29f8b6
Compare
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.
Pull request overview
Copilot reviewed 32 out of 45 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
022b962 to
b6841c8
Compare
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.
Pull request overview
Copilot reviewed 32 out of 45 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Pull request overview
Copilot reviewed 33 out of 48 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tullom
left a comment
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.
Checked out locally and ran the examples. Great job with this!
|
What is the impact of this change on code size? Can we check the size of some of the examples before and after? |
* Move away from type-state type machine * Introduce first proper integration test * Create temporary bridge with type-C code
0a7d305 to
97c2fe1
Compare
With this PR, the |
DeviceTraittrait.impl DeviceTraitinstead of using channelstype_c_service::wrapper::proxy).