- 
                Notifications
    
You must be signed in to change notification settings  - Fork 2.3k
 
Addressing post-merge review comments from #40553 #40957
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
Addressing post-merge review comments from #40553 #40957
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
This PR addresses post-merge review comments from PR #40553, focusing on improving the cluster integration code. The changes enhance documentation clarity, improve error handling, and fix parameter naming and function signatures.
- Improved documentation to clarify conditional loading of optional attributes and feature maps
 - Updated method signatures to return pointers instead of references for better null safety
 - Standardized parameter naming across cluster integration classes
 
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
| File | Description | 
|---|---|
| src/data-model-providers/codegen/ClusterIntegration.h | Updated documentation and method signatures for better clarity and null safety | 
| src/data-model-providers/codegen/ClusterIntegration.cpp | Implemented improved error handling and parameter renaming | 
| Multiple cluster integration files | Updated to match new interface signatures and parameter names | 
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
        
          
                src/app/clusters/push-av-stream-transport-server/CodegenIntegration.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.
Code Review
This pull request refactors the codegen cluster integration logic to improve robustness and clarity, primarily by changing FindRegistration to return a pointer, allowing for nullptr returns for uninitialized clusters. The changes also include renaming maxEndpointCount to maxClusterInstanceCount for better understanding and centralizing cluster instance lookups to reduce code duplication. My review identified a critical syntax error that would prevent compilation and a minor code style issue. With these fixes, the changes represent a solid improvement to the codebase.
        
          
                src/app/clusters/push-av-stream-transport-server/CodegenIntegration.cpp
              
                Outdated
          
            Show resolved
            Hide resolved
        
      b6823c3    to
    9634801      
    Compare
  
    9634801    to
    68605ec      
    Compare
  
    Co-authored-by: Copilot <[email protected]>
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 12 out of 12 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
        
          
                src/app/clusters/administrator-commissioning-server/CodegenIntegration.cpp
              
                Outdated
          
            Show resolved
            Hide resolved
        
      …egration.cpp Co-authored-by: Copilot <[email protected]>
| 
           /gemini review  | 
    
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 addresses post-merge review comments by refactoring the cluster integration logic. Key improvements include making FindRegistration fallible to enhance safety, renaming maxEndpointCount to maxClusterInstanceCount for clarity, and using dynamic configuration sizes for singleton clusters to improve robustness. The code is now safer, clearer, and more maintainable. The changes are well-implemented and consistent across all affected files.
| 
           PR #40957: Size comparison from 1fc028b to 24a7d79 Full report (28 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, qpg, realtek, stm32, telink)
  | 
    
        
          
                src/app/clusters/administrator-commissioning-server/CodegenIntegration.cpp
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/app/clusters/administrator-commissioning-server/CodegenIntegration.cpp
              
                Outdated
          
            Show resolved
            Hide resolved
        
      …egration.cpp Co-authored-by: Boris Zbarsky <[email protected]>
…egration.cpp Co-authored-by: Boris Zbarsky <[email protected]>
Co-authored-by: Boris Zbarsky <[email protected]>
Co-authored-by: Boris Zbarsky <[email protected]>
| 
           PR #40957: Size comparison from 1fc028b to a51cb04 Full report (28 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, qpg, realtek, stm32, telink)
  | 
    
Co-authored-by: Boris Zbarsky <[email protected]>
Co-authored-by: Boris Zbarsky <[email protected]>
| 
           PR #40957: Size comparison from cccf626 to 811c217 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   #40957   +/-   ##
=======================================
  Coverage   50.89%   50.90%           
=======================================
  Files        1361     1361           
  Lines       99880    99887    +7     
  Branches    12934    12939    +5     
=======================================
+ Hits        50838    50843    +5     
- Misses      49042    49044    +2     ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
  | 
    
Co-authored-by: Boris Zbarsky <[email protected]>
Co-authored-by: Boris Zbarsky <[email protected]>
| 
           PR #40957: Size comparison from cccf626 to 7927760 Full report (37 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
  | 
    
| uint16_t maxClusterInstanceCount; // This is how many cluster instancers are supported by the delegate (0-based indexing, so | ||
| // indices smaller than this are valid). | ||
| bool fetchFeatureMap; // Read feature map attribute from ember. | ||
| bool fetchOptionalAttributes; // Read the enabling of the first 32 optional attributes from ember. | 
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 should also have flag for optional commands and events.
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.
@jadhavrohit924 What would that flag do, exactly?
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.
Flag to get the optional enabled commands/events like optionalAttributes. Otherwise we will have to do that in CodegenIntegration.
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 is currently no good representation for "enabled optional commands/events" (unlike attributes)... So even if we had the flag, what form would the data take?
But yes, we could define some way of representing those and add flags to fetch that representation.
Summary
See comments in #40553 (comment) and beyond
Significant changes:
Testing
Existing unit tests should still apply.