-
Notifications
You must be signed in to change notification settings - Fork 2.3k
[Part3] Decouple ICD Management cluster to be code driven. #41499
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?
[Part3] Decouple ICD Management cluster to be code driven. #41499
Conversation
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
The PR decouples the ICD Management cluster to be code driven by migrating from a ZAP/Ember-based implementation to a modern DefaultServerCluster approach. This transformation makes the cluster more maintainable and testable while aligning with the project's architectural goals.
Key changes:
- Converted from AttributeAccessInterface pattern to DefaultServerCluster
- Created separate ICDManagementCluster and ICDManagementClusterWithCIP classes for different feature sets
- Added comprehensive unit tests for cluster functionality
- Moved ClusterRevision from RAM-based storage to callback-based implementation
Reviewed Changes
Copilot reviewed 40 out of 40 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/app/clusters/icd-management-server/ICDManagementCluster.h | Redesigned class hierarchy with base ICDManagementCluster and CIP-enabled subclass |
| src/app/clusters/icd-management-server/ICDManagementCluster.cpp | Implemented new cluster logic with DefaultServerCluster pattern |
| src/app/clusters/icd-management-server/CodegenIntegration.cpp | Added integration layer for codegen cluster registration |
| src/app/clusters/icd-management-server/tests/TestICDManagementCluster.cpp | Added unit tests for cluster attributes and commands |
| zzz_generated/app-common/app-common/zap-generated/callback.h | Removed legacy command callbacks |
| zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h | Removed ClusterRevision accessor functions |
| examples/*.matter | Updated ClusterRevision from RAM to callback attribute across all examples |
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 effectively refactors the ICD Management cluster to be a code-driven implementation, which is a great improvement. The changes align well with the established patterns for code-driven clusters in this repository, including the addition of unit tests. The overall structure is clean and well-organized. I have a couple of minor suggestions to further improve code quality and test coverage.
src/app/clusters/icd-management-server/tests/TestICDManagementCluster.cpp
Outdated
Show resolved
Hide resolved
2671e61 to
b66acf8
Compare
|
PR #41499: Size comparison from a95f163 to b66acf8 Increases above 0.2%:
Full report (37 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #41499 +/- ##
=======================================
Coverage 51.01% 51.02%
=======================================
Files 1386 1387 +1
Lines 100988 101054 +66
Branches 13081 13085 +4
=======================================
+ Hits 51519 51558 +39
- Misses 49469 49496 +27 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
src/app/clusters/icd-management-server/tests/TestICDManagementCluster.cpp
Show resolved
Hide resolved
src/app/clusters/icd-management-server/ICDManagementCluster.cpp
Outdated
Show resolved
Hide resolved
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 40 out of 40 changed files in this pull request and generated 3 comments.
src/app/clusters/icd-management-server/ICDManagementCluster.cpp
Outdated
Show resolved
Hide resolved
src/app/clusters/icd-management-server/ICDManagementCluster.cpp
Outdated
Show resolved
Hide resolved
src/app/clusters/icd-management-server/ICDManagementCluster.cpp
Outdated
Show resolved
Hide resolved
src/app/clusters/icd-management-server/ICDManagementCluster.cpp
Outdated
Show resolved
Hide resolved
src/app/clusters/icd-management-server/ICDManagementCluster.cpp
Outdated
Show resolved
Hide resolved
src/app/clusters/icd-management-server/ICDManagementCluster.cpp
Outdated
Show resolved
Hide resolved
src/app/clusters/icd-management-server/ICDManagementCluster.cpp
Outdated
Show resolved
Hide resolved
src/app/clusters/icd-management-server/ICDManagementCluster.cpp
Outdated
Show resolved
Hide resolved
src/app/clusters/icd-management-server/ICDManagementCluster.cpp
Outdated
Show resolved
Hide resolved
| ASSERT_EQ(cluster.Attributes(ConcreteClusterPath(kRootEndpointId, IcdManagement::Id), attributesBuilder), CHIP_NO_ERROR); | ||
|
|
||
| // Calculate expected attributes based on feature map and configuration | ||
| BitFlags<IcdManagement::Feature> featureMap = icdConfig.GetFeatureMap(); |
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.
we create he clusters here ... can't we control the feature map?
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.
No. Features are controlled by config options only. Different tests have different configs enabled so we have to read the feature map from icd configuration.
| BitMask<IcdManagement::OptionalCommands>(IcdManagement::OptionalCommands::kStayActive); | ||
| BitMask<IcdManagement::UserActiveModeTriggerBitmap> userActiveModeTriggerHint(0); | ||
|
|
||
| #if CHIP_CONFIG_ENABLE_ICD_CIP |
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.
Some explanation on why no separate step should be added here ... we could in theory test both (or just one) every time without ifdefs.
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.
Yeah, without ifdefs we can test both everytime.
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.
We have added ICDManagementClusterWithCIP class under config, so we need ifdefs
src/app/clusters/icd-management-server/ICDManagementCluster.cpp
Outdated
Show resolved
Hide resolved
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 40 out of 40 changed files in this pull request and generated 4 comments.
… storing to userActiveModeTriggerInstruction
210fc0e to
6682fc8
Compare
|
PR #41499: Size comparison from 480a0dd to 6682fc8 Increases above 0.2%:
Full report (37 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
|
please hold on merge for this one, waiting for #41725, I would cherry-pick 41725 into 1.4 and 1.4.2, then please update the MatterReportingAttributeChangeCallback with new API in this PR. thanks |
Summary
Creates a DefaultServerCluster out of the ICD Management.
Related issues
Fixes: #40988
Testing
Readability checklist
The checklist below will help the reviewer finish PR review in time and keep the
code readable:
descriptive
“When in Rome…”
rule (coding style)
See: Pull Request Guidelines