Skip to content

Migrate Group Key Management Cluster to be Code Driven #40504

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

Merged
merged 27 commits into from
Aug 15, 2025

Conversation

zaid-google
Copy link
Contributor

Summary

This PR is re-writing the group key management cluster to follow the new code-driven format, as part of the cluster decoupling effort. These changes include:

  • Removing the old group-key-mgmt-server.cpp file
  • Adding group-key-mgmt-cluster.h/cpp which will hold code for the cluster functionality. This new GroupKeyManagementCluster extends the DefaultServerCluster and implements the required functions from it to maintain old functionality
  • Adding CodgenIntegration.cpp for backwards compatibility

Related issues

#40263

Testing

  • CI should still pass
  • Added unit tests for the group key management cluster

@zaid-google zaid-google added the cluster-decoupling Work for cluster decoupling: remove direct app-specific code dependency and allow unit testing label Aug 8, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 migrates the Group Key Management cluster to the new code-driven format, which is a great step towards decoupling. The changes are well-structured, including the new GroupKeyManagementCluster implementation, the CodegenIntegration.cpp for backward compatibility, and the addition of unit tests.

I've found a critical issue in the InvokeCommand implementation where Decode is called with an incorrect signature for several commands, which will cause a compilation failure. I've also pointed out a minor code hygiene issue regarding unused headers.

Once these issues are addressed, this PR will be in excellent shape.

@zaid-google
Copy link
Contributor Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 migrates the Group Key Management cluster to the modern, code-driven model. The refactoring is clean, correctly removing the old attribute access and command callback mechanisms and replacing them with the DefaultServerCluster implementation. The addition of unit tests for the new cluster's metadata is a great touch. I have one piece of feedback regarding a missing attribute change notification, which is important for client synchronization.

Copy link

github-actions bot commented Aug 8, 2025

PR #40504: Size comparison from 188dec4 to cd12528

Full report (3 builds for cc32xx, stm32)
platform target config section 188dec4 cd12528 change % change
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 550586 550722 136 0.0
RAM 205080 205096 16 0.0
lock CC3235SF_LAUNCHXL FLASH 582942 583022 80 0.0
RAM 205296 205304 8 0.0
stm32 light STM32WB5MM-DK FLASH 466276 466364 88 0.0
RAM 141336 141352 16 0.0

@zaid-google zaid-google force-pushed the code_driven_key_management branch from bf91eac to da3a681 Compare August 8, 2025 19:14
Copy link

github-actions bot commented Aug 8, 2025

PR #40504: Size comparison from 16070f1 to da3a681

Full report (33 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, nrfconnect, psoc6, qpg, stm32, telink, tizen)
platform target config section 16070f1 da3a681 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1104636 1104580 -56 -0.0
RAM 179066 179090 24 0.0
bl702 lighting-app bl702+eth FLASH 657270 657254 -16 -0.0
RAM 134929 134953 24 0.0
bl702+wifi FLASH 835062 835046 -16 -0.0
RAM 124541 124565 24 0.0
bl706+mfd+rpc+littlefs FLASH 1066976 1066960 -16 -0.0
RAM 117349 117373 24 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 896158 896398 240 0.0
RAM 105652 105676 24 0.0
lighting-app bl702l+mfd+littlefs FLASH 979872 980112 240 0.0
RAM 109828 109852 24 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 766632 766728 96 0.0
RAM 103328 103344 16 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 778228 778364 136 0.0
RAM 108496 108512 16 0.0
pump-app LP_EM_CC1354P10_6 FLASH 723832 724000 168 0.0
RAM 96892 96908 16 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 708188 708348 160 0.0
RAM 97100 97116 16 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 550586 550722 136 0.0
RAM 205080 205096 16 0.0
lock CC3235SF_LAUNCHXL FLASH 582942 583022 80 0.0
RAM 205296 205304 8 0.0
efr32 lock-app BRD4187C FLASH 957920 958048 128 0.0
RAM 126512 126512 0 0.0
BRD4338a FLASH 752336 752840 504 0.1
RAM 251856 251872 16 0.0
window-app BRD4187C FLASH 1050220 1050700 480 0.0
RAM 122708 122740 32 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 909772 909944 172 0.0
RAM 152832 152844 12 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1657828 1658340 512 0.0
RAM 211144 211152 8 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1579428 1579924 496 0.0
RAM 208416 208424 8 0.0
light cy8ckit_062s2_43012 FLASH 1450532 1451052 520 0.0
RAM 197144 197160 16 0.0
lock cy8ckit_062s2_43012 FLASH 1482868 1483388 520 0.0
RAM 224856 224872 16 0.0
qpg lighting-app qpg6200+debug FLASH 819296 819456 160 0.0
RAM 127608 127616 8 0.0
lock-app qpg6200+debug FLASH 756628 756788 160 0.0
RAM 118560 118568 8 0.0
stm32 light STM32WB5MM-DK FLASH 466276 466364 88 0.0
RAM 141336 141352 16 0.0
telink bridge-app tl7218x FLASH 703758 703674 -84 -0.0
RAM 93552 93564 12 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 795550 795472 -78 -0.0
RAM 43968 43980 12 0.0
light-app-ota-shell-factory-data tl7218x FLASH 783956 783878 -78 -0.0
RAM 100856 100868 12 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 711550 711474 -76 -0.0
RAM 54188 54200 12 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 748144 748068 -76 -0.0
RAM 77344 77356 12 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 724870 724794 -76 -0.0
RAM 36944 36956 12 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 604898 604820 -78 -0.0
RAM 112512 112524 12 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 819560 819486 -74 -0.0
RAM 99108 99120 12 0.0
tizen all-clusters-app arm unknown 5184 5196 12 0.2
FLASH 1767192 1767880 688 0.0
RAM 92108 92148 40 0.0
chip-tool-ubsan arm unknown 20772 20772 0 0.0
FLASH 21106682 21106682 0 0.0
RAM 9181152 9181152 0 0.0

@zaid-google
Copy link
Contributor Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 correctly migrates the Group Key Management cluster to the code-driven model. The changes are well-structured, including updates to the cluster implementation, build files, and the addition of unit tests. The refactoring follows the established patterns for code-driven clusters. I've found a critical issue in the WriteAttribute implementation that will prevent compilation and also misses attribute change notifications. I've also suggested adding a missing header file to support the fix. Once these are addressed, the PR should be in good shape.

Copy link

codecov bot commented Aug 8, 2025

Codecov Report

❌ Patch coverage is 8.08081% with 182 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.68%. Comparing base (c16ef0f) to head (c51aa3d).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
...s/group-key-mgmt-server/group-key-mgmt-cluster.cpp 4.41% 173 Missing ⚠️
...sters/group-key-mgmt-server/CodegenIntegration.cpp 46.66% 8 Missing ⚠️
...ers/group-key-mgmt-server/group-key-mgmt-cluster.h 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #40504   +/-   ##
=======================================
  Coverage   50.68%   50.68%           
=======================================
  Files        1350     1352    +2     
  Lines       99236    99258   +22     
  Branches    12910    12916    +6     
=======================================
+ Hits        50297    50309   +12     
- Misses      48939    48949   +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zaid-google zaid-google marked this pull request as ready for review August 8, 2025 20:31
Copy link

github-actions bot commented Aug 8, 2025

PR #40504: Size comparison from 16070f1 to 1b36526

Full report (57 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section 16070f1 1b36526 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1104636 1104580 -56 -0.0
RAM 179066 179090 24 0.0
bl702 lighting-app bl702+eth FLASH 657270 657254 -16 -0.0
RAM 134929 134953 24 0.0
bl702+wifi FLASH 835062 835046 -16 -0.0
RAM 124541 124565 24 0.0
bl706+mfd+rpc+littlefs FLASH 1066976 1066960 -16 -0.0
RAM 117349 117373 24 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 896158 896398 240 0.0
RAM 105652 105676 24 0.0
lighting-app bl702l+mfd+littlefs FLASH 979872 980112 240 0.0
RAM 109828 109852 24 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 766632 766728 96 0.0
RAM 103328 103344 16 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 778228 778364 136 0.0
RAM 108496 108512 16 0.0
pump-app LP_EM_CC1354P10_6 FLASH 723832 724000 168 0.0
RAM 96892 96908 16 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 708188 708348 160 0.0
RAM 97100 97116 16 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 550586 550722 136 0.0
RAM 205080 205096 16 0.0
lock CC3235SF_LAUNCHXL FLASH 582942 583022 80 0.0
RAM 205296 205304 8 0.0
efr32 lock-app BRD4187C FLASH 957920 958048 128 0.0
RAM 126512 126512 0 0.0
BRD4338a FLASH 752336 752840 504 0.1
RAM 251856 251872 16 0.0
window-app BRD4187C FLASH 1050220 1050700 480 0.0
RAM 122708 122740 32 0.0
esp32 all-clusters-app c3devkit DRAM 102288 102304 16 0.0
FLASH 1750406 1750444 38 0.0
IRAM 83862 83862 0 0.0
m5stack DRAM 121156 121164 8 0.0
FLASH 1698870 1698998 128 0.0
IRAM 117051 117051 0 0.0
linux air-purifier-app debug unknown 4864 4864 0 0.0
FLASH 2588242 2589528 1286 0.0
RAM 116664 116776 112 0.1
all-clusters-app debug unknown 5688 5688 0 0.0
FLASH 5977460 5978686 1226 0.0
RAM 534696 534776 80 0.0
all-clusters-minimal-app debug unknown 5536 5536 0 0.0
FLASH 5203746 5205092 1346 0.0
RAM 227944 228024 80 0.0
bridge-app debug unknown 5568 5568 0 0.0
FLASH 4590144 4591396 1252 0.0
RAM 208304 208384 80 0.0
camera-app debug unknown 9008 9008 0 0.0
FLASH 6883307 6884523 1216 0.0
RAM 233128 233192 64 0.0
camera-controller debug unknown 9216 9216 0 0.0
FLASH 13644715 13644715 0 0.0
RAM 668960 668960 0 0.0
chip-tool debug unknown 6264 6264 0 0.0
FLASH 13694091 13694091 0 0.0
RAM 655880 655880 0 0.0
chip-tool-ipv6only arm64 unknown 40736 40736 0 0.0
FLASH 12721239 12721239 0 0.0
RAM 690840 690840 0 0.0
closure-app debug unknown 5536 5536 0 0.0
FLASH 4571918 4573200 1282 0.0
RAM 200216 200296 80 0.0
fabric-admin debug unknown 5944 5944 0 0.0
FLASH 12038864 12038864 0 0.0
RAM 654888 654888 0 0.0
fabric-bridge-app debug unknown 4816 4816 0 0.0
FLASH 4389056 4390338 1282 0.0
RAM 193968 194064 96 0.0
fabric-sync debug unknown 5056 5056 0 0.0
FLASH 5474917 5476197 1280 0.0
RAM 493760 493872 112 0.0
lighting-app debug+rpc+ui unknown 6280 6280 0 0.0
FLASH 5476193 5477457 1264 0.0
RAM 209616 209680 64 0.0
lock-app debug unknown 5496 5496 0 0.0
FLASH 4618858 4620162 1304 0.0
RAM 196760 196840 80 0.0
ota-provider-app debug unknown 4856 4856 0 0.0
FLASH 4247732 4248960 1228 0.0
RAM 185424 185504 80 0.0
ota-requestor-app debug unknown 4736 4736 0 0.0
FLASH 4310944 4312192 1248 0.0
RAM 188248 188360 112 0.1
shell debug unknown 4312 4312 0 0.0
FLASH 2932179 2933395 1216 0.0
RAM 148504 148600 96 0.1
thermostat-no-ble arm64 unknown 9976 10000 24 0.2
FLASH 4226495 4227343 848 0.0
RAM 226464 226544 80 0.0
tv-app debug unknown 5824 5824 0 0.0
FLASH 5803237 5804469 1232 0.0
RAM 618104 618232 128 0.0
tv-casting-app debug unknown 5352 5352 0 0.0
FLASH 11831541 11832821 1280 0.0
RAM 772432 772544 112 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 909772 909944 172 0.0
RAM 152832 152844 12 0.0
nxp contact mcxw71+release FLASH 630440 630552 112 0.0
RAM 64084 64092 8 0.0
lock mcxw71+release FLASH 740632 740792 160 0.0
RAM 65168 65176 8 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1657828 1658340 512 0.0
RAM 211144 211152 8 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1579428 1579924 496 0.0
RAM 208416 208424 8 0.0
light cy8ckit_062s2_43012 FLASH 1450532 1451052 520 0.0
RAM 197144 197160 16 0.0
lock cy8ckit_062s2_43012 FLASH 1482868 1483388 520 0.0
RAM 224856 224872 16 0.0
qpg lighting-app qpg6200+debug FLASH 819296 819456 160 0.0
RAM 127608 127616 8 0.0
lock-app qpg6200+debug FLASH 756628 756788 160 0.0
RAM 118560 118568 8 0.0
stm32 light STM32WB5MM-DK FLASH 466276 466364 88 0.0
RAM 141336 141352 16 0.0
telink bridge-app tl7218x FLASH 703758 703674 -84 -0.0
RAM 93552 93564 12 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 795550 795472 -78 -0.0
RAM 43968 43980 12 0.0
light-app-ota-shell-factory-data tl7218x FLASH 783956 783878 -78 -0.0
RAM 100856 100868 12 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 711550 711474 -76 -0.0
RAM 54188 54200 12 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 748144 748068 -76 -0.0
RAM 77344 77356 12 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 724870 724794 -76 -0.0
RAM 36944 36956 12 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 604898 604820 -78 -0.0
RAM 112512 112524 12 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 819560 819486 -74 -0.0
RAM 99108 99120 12 0.0
tizen all-clusters-app arm unknown 5184 5196 12 0.2
FLASH 1767192 1767880 688 0.0
RAM 92108 92148 40 0.0
chip-tool-ubsan arm unknown 20772 20772 0 0.0
FLASH 21106682 21106682 0 0.0
RAM 9181152 9181152 0 0.0

Copy link

github-actions bot commented Aug 11, 2025

PR #40504: Size comparison from 16070f1 to d7a5560

Full report (57 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section 16070f1 d7a5560 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1104636 1104608 -28 -0.0
RAM 179066 178954 -112 -0.1
bl702 lighting-app bl702+eth FLASH 657270 657358 88 0.0
RAM 134929 134873 -56 -0.0
bl702+wifi FLASH 835062 835142 80 0.0
RAM 124541 124437 -104 -0.1
bl706+mfd+rpc+littlefs FLASH 1066976 1067066 90 0.0
RAM 117349 117301 -48 -0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 896158 896248 90 0.0
RAM 105652 105604 -48 -0.0
lighting-app bl702l+mfd+littlefs FLASH 979872 979962 90 0.0
RAM 109828 109788 -40 -0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 766632 766656 24 0.0
RAM 103328 103352 24 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 778228 778276 48 0.0
RAM 108496 108512 16 0.0
pump-app LP_EM_CC1354P10_6 FLASH 723832 724080 248 0.0
RAM 96892 96916 24 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 708188 708452 264 0.0
RAM 97100 97116 16 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 550586 550802 216 0.0
RAM 205080 205104 24 0.0
lock CC3235SF_LAUNCHXL FLASH 582942 582950 8 0.0
RAM 205296 205304 8 0.0
efr32 lock-app BRD4187C FLASH 957920 957952 32 0.0
RAM 126512 126516 4 0.0
BRD4338a FLASH 752336 752872 536 0.1
RAM 251856 251872 16 0.0
window-app BRD4187C FLASH 1050220 1050772 552 0.1
RAM 122708 122744 36 0.0
esp32 all-clusters-app c3devkit DRAM 102288 102312 24 0.0
FLASH 1750406 1750314 -92 -0.0
IRAM 83862 83862 0 0.0
m5stack DRAM 121156 121188 32 0.0
FLASH 1698870 1699022 152 0.0
IRAM 117051 117051 0 0.0
linux air-purifier-app debug unknown 4864 4864 0 0.0
FLASH 2588242 2591348 3106 0.1
RAM 116664 116776 112 0.1
all-clusters-app debug unknown 5688 5688 0 0.0
FLASH 5977460 5981010 3550 0.1
RAM 534696 534776 80 0.0
all-clusters-minimal-app debug unknown 5536 5536 0 0.0
FLASH 5203746 5207420 3674 0.1
RAM 227944 228056 112 0.0
bridge-app debug unknown 5568 5568 0 0.0
FLASH 4590144 4593728 3584 0.1
RAM 208304 208400 96 0.0
camera-app debug unknown 9008 9008 0 0.0
FLASH 6883307 6886923 3616 0.1
RAM 233128 233224 96 0.0
camera-controller debug unknown 9216 9216 0 0.0
FLASH 13644715 13645643 928 0.0
RAM 668960 668960 0 0.0
chip-tool debug unknown 6264 6264 0 0.0
FLASH 13694091 13695299 1208 0.0
RAM 655880 655880 0 0.0
chip-tool-ipv6only arm64 unknown 40736 40736 0 0.0
FLASH 12721239 12722215 976 0.0
RAM 690840 690848 8 0.0
closure-app debug unknown 5536 5536 0 0.0
FLASH 4571918 4575534 3616 0.1
RAM 200216 200312 96 0.0
fabric-admin debug unknown 5944 5944 0 0.0
FLASH 12038864 12040072 1208 0.0
RAM 654888 654888 0 0.0
fabric-bridge-app debug unknown 4816 4816 0 0.0
FLASH 4389056 4392670 3614 0.1
RAM 193968 194064 96 0.0
fabric-sync debug unknown 5056 5056 0 0.0
FLASH 5474917 5478917 4000 0.1
RAM 493760 493888 128 0.0
lighting-app debug+rpc+ui unknown 6280 6280 0 0.0
FLASH 5476193 5479825 3632 0.1
RAM 209616 209712 96 0.0
lock-app debug unknown 5496 5496 0 0.0
FLASH 4618858 4622464 3606 0.1
RAM 196760 196856 96 0.0
ota-provider-app debug unknown 4856 4856 0 0.0
FLASH 4247732 4250780 3048 0.1
RAM 185424 185520 96 0.1
ota-requestor-app debug unknown 4736 4736 0 0.0
FLASH 4310944 4314046 3102 0.1
RAM 188248 188360 112 0.1
shell debug unknown 4312 4312 0 0.0
FLASH 2932179 2935715 3536 0.1
RAM 148504 148600 96 0.1
thermostat-no-ble arm64 unknown 9976 9856 -120 -1.2
FLASH 4226495 4229663 3168 0.1
RAM 226464 226560 96 0.0
tv-app debug unknown 5824 5824 0 0.0
FLASH 5803237 5807189 3952 0.1
RAM 618104 618248 144 0.0
tv-casting-app debug unknown 5352 5352 0 0.0
FLASH 11831541 11835573 4032 0.0
RAM 772432 772560 128 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 909772 909872 100 0.0
RAM 152832 152848 16 0.0
nxp contact mcxw71+release FLASH 630440 630568 128 0.0
RAM 64084 64100 16 0.0
lock mcxw71+release FLASH 740632 740792 160 0.0
RAM 65168 65176 8 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1657828 1658380 552 0.0
RAM 211144 211168 24 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1579428 1579964 536 0.0
RAM 208416 208440 24 0.0
light cy8ckit_062s2_43012 FLASH 1450532 1451068 536 0.0
RAM 197144 197160 16 0.0
lock cy8ckit_062s2_43012 FLASH 1482868 1483420 552 0.0
RAM 224856 224872 16 0.0
qpg lighting-app qpg6200+debug FLASH 819296 819536 240 0.0
RAM 127608 127616 8 0.0
lock-app qpg6200+debug FLASH 756628 756884 256 0.0
RAM 118560 118576 16 0.0
stm32 light STM32WB5MM-DK FLASH 466276 466284 8 0.0
RAM 141336 141360 24 0.0
telink bridge-app tl7218x FLASH 703758 703512 -246 -0.0
RAM 93552 93564 12 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 795550 795312 -238 -0.0
RAM 43968 43980 12 0.0
light-app-ota-shell-factory-data tl7218x FLASH 783956 783716 -240 -0.0
RAM 100856 100868 12 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 711550 711314 -236 -0.0
RAM 54188 54204 16 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 748144 747908 -236 -0.0
RAM 77344 77360 16 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 724870 724636 -234 -0.0
RAM 36944 36960 16 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 604898 604660 -238 -0.0
RAM 112512 112524 12 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 819560 819324 -236 -0.0
RAM 99108 99120 12 0.0
tizen all-clusters-app arm unknown 5184 5124 -60 -1.2
FLASH 1767192 1769480 2288 0.1
RAM 92108 92168 60 0.1
chip-tool-ubsan arm unknown 20772 20772 0 0.0
FLASH 21106682 21109154 2472 0.0
RAM 9181152 9182816 1664 0.0

@mergify mergify bot added the conflict label Aug 11, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 correctly refactors the Group Key Management cluster to the new code-driven model. The changes are well-structured and follow the established patterns for this kind of migration. The new implementation in group-key-mgmt-cluster.cpp is clean and the command/attribute handling logic is sound. One area for improvement is in testing. While the new test file TestGroupKeyManagementCluster.cpp is a good start, it only verifies the cluster's metadata (attributes and commands). I recommend adding more comprehensive unit tests that cover the actual logic of the command handlers and attribute accessors to ensure correctness and prevent future regressions.

Copy link

github-actions bot commented Aug 12, 2025

PR #40504: Size comparison from 180c8ae to 35f1f58

Full report (57 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section 180c8ae 35f1f58 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1105014 1105002 -12 -0.0
RAM 178962 178986 24 0.0
bl702 lighting-app bl702+eth FLASH 657370 657430 60 0.0
RAM 134873 134897 24 0.0
bl702+wifi FLASH 835506 835524 18 0.0
RAM 124437 124469 32 0.0
bl706+mfd+rpc+littlefs FLASH 1067120 1067138 18 0.0
RAM 117293 117325 32 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 896558 896576 18 0.0
RAM 105604 105628 24 0.0
lighting-app bl702l+mfd+littlefs FLASH 980272 980290 18 0.0
RAM 109780 109812 32 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 766928 767048 120 0.0
RAM 103336 103352 16 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 778508 778668 160 0.0
RAM 108496 108512 16 0.0
pump-app LP_EM_CC1354P10_6 FLASH 724024 724224 200 0.0
RAM 96900 96916 16 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 708396 708580 184 0.0
RAM 97100 97116 16 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 550746 550954 208 0.0
RAM 205088 205104 16 0.0
lock CC3235SF_LAUNCHXL FLASH 583182 583358 176 0.0
RAM 205296 205304 8 0.0
efr32 lock-app BRD4187C FLASH 958312 958440 128 0.0
RAM 122612 122644 32 0.0
BRD4338a FLASH 752816 753352 536 0.1
RAM 251864 251880 16 0.0
window-app BRD4187C FLASH 1050716 1051196 480 0.0
RAM 118840 118840 0 0.0
esp32 all-clusters-app c3devkit DRAM 102304 102312 8 0.0
FLASH 1751280 1751360 80 0.0
IRAM 83862 83862 0 0.0
m5stack DRAM 121172 121188 16 0.0
FLASH 1699842 1700038 196 0.0
IRAM 117051 117051 0 0.0
linux air-purifier-app debug unknown 4864 4864 0 0.0
FLASH 2589254 2590656 1402 0.1
RAM 116696 116808 112 0.1
all-clusters-app debug unknown 5688 5688 0 0.0
FLASH 5979998 5981372 1374 0.0
RAM 534792 534872 80 0.0
all-clusters-minimal-app debug unknown 5536 5536 0 0.0
FLASH 5205744 5207238 1494 0.0
RAM 228008 228120 112 0.0
bridge-app debug unknown 5568 5568 0 0.0
FLASH 4592178 4593546 1368 0.0
RAM 208368 208464 96 0.0
camera-app debug unknown 9008 9008 0 0.0
FLASH 6886331 6887707 1376 0.0
RAM 233224 233320 96 0.0
camera-controller debug unknown 9216 9216 0 0.0
FLASH 13643979 13643979 0 0.0
RAM 668960 668960 0 0.0
chip-tool debug unknown 6264 6264 0 0.0
FLASH 13693847 13693847 0 0.0
RAM 655880 655880 0 0.0
chip-tool-ipv6only arm64 unknown 40736 40736 0 0.0
FLASH 12721111 12721111 0 0.0
RAM 690848 690848 0 0.0
closure-app debug unknown 5536 5536 0 0.0
FLASH 4573952 4575352 1400 0.0
RAM 200280 200376 96 0.0
fabric-admin debug unknown 5944 5944 0 0.0
FLASH 12038138 12038138 0 0.0
RAM 654888 654888 0 0.0
fabric-bridge-app debug unknown 4816 4816 0 0.0
FLASH 4391088 4392488 1400 0.0
RAM 194032 194160 128 0.1
fabric-sync debug unknown 5056 5056 0 0.0
FLASH 5477333 5478725 1392 0.0
RAM 493824 493952 128 0.0
lighting-app debug+rpc+ui unknown 6280 6280 0 0.0
FLASH 5478257 5479681 1424 0.0
RAM 209680 209776 96 0.0
lock-app debug unknown 5496 5496 0 0.0
FLASH 4620860 4622282 1422 0.0
RAM 196824 196920 96 0.0
ota-provider-app debug unknown 4856 4856 0 0.0
FLASH 4249000 4250344 1344 0.0
RAM 185488 185568 80 0.0
ota-requestor-app debug unknown 4736 4736 0 0.0
FLASH 4311850 4313248 1398 0.0
RAM 188280 188408 128 0.1
shell debug unknown 4312 4312 0 0.0
FLASH 2934403 2935875 1472 0.1
RAM 148600 148696 96 0.1
thermostat-no-ble arm64 unknown 9832 9856 24 0.2
FLASH 4228847 4229759 912 0.0
RAM 226536 226624 88 0.0
tv-app debug unknown 5824 5824 0 0.0
FLASH 5806005 5807365 1360 0.0
RAM 618184 618328 144 0.0
tv-casting-app debug unknown 5352 5352 0 0.0
FLASH 11833989 11835397 1408 0.0
RAM 772496 772624 128 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 910240 910432 192 0.0
RAM 152836 152848 12 0.0
nxp contact mcxw71+release FLASH 630424 630560 136 0.0
RAM 64092 64100 8 0.0
lock mcxw71+release FLASH 740840 741032 192 0.0
RAM 65168 65176 8 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1658412 1658964 552 0.0
RAM 211152 211168 16 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1579780 1580316 536 0.0
RAM 208424 208440 16 0.0
light cy8ckit_062s2_43012 FLASH 1450924 1451460 536 0.0
RAM 197144 197160 16 0.0
lock cy8ckit_062s2_43012 FLASH 1483244 1483780 536 0.0
RAM 224856 224872 16 0.0
qpg lighting-app qpg6200+debug FLASH 819624 819800 176 0.0
RAM 127608 127616 8 0.0
lock-app qpg6200+debug FLASH 756940 757116 176 0.0
RAM 118568 118576 8 0.0
stm32 light STM32WB5MM-DK FLASH 466572 466676 104 0.0
RAM 141344 141360 16 0.0
telink bridge-app tl7218x FLASH 703750 703704 -46 -0.0
RAM 93552 93564 12 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 795556 795516 -40 -0.0
RAM 43968 43980 12 0.0
light-app-ota-shell-factory-data tl7218x FLASH 783960 783920 -40 -0.0
RAM 100856 100868 12 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 711544 711506 -38 -0.0
RAM 54192 54204 12 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 748138 748100 -38 -0.0
RAM 77348 77360 12 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 724866 724828 -38 -0.0
RAM 36948 36960 12 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 604904 604864 -40 -0.0
RAM 112512 112524 12 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 819564 819528 -36 -0.0
RAM 99108 99120 12 0.0
tizen all-clusters-app arm unknown 5112 5124 12 0.2
FLASH 1768984 1769728 744 0.0
RAM 92156 92208 52 0.1
chip-tool-ubsan arm unknown 20772 20772 0 0.0
FLASH 21109930 21109930 0 0.0
RAM 9183368 9183368 0 0.0

Copy link
Contributor

@andy31415 andy31415 left a comment

Choose a reason for hiding this comment

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

Generally looks good - since previous cluster used AAI, the existing code migration looks quite clean. Any improvements would likely apply to existing code as well and I am concerned that if we apply fixes we will actually also incur a flash overhead that is not due to migration.

One thing that is interesting is that this now correctly sets the cluster revision from spec and not from a hardcoded value (so we will start claiming revions 2 instead of 1). CS feature and its (non)implementation is awkward... we should probably completely remove that and not have partial non-working TODO.

Co-authored-by: Andrei Litvin <andy314@gmail.com>

This comment was marked as outdated.

This comment was marked as outdated.

Copy link

github-actions bot commented Aug 14, 2025

PR #40504: Size comparison from c16ef0f to c51aa3d

Full report (57 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section c16ef0f c51aa3d change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1106520 1106752 232 0.0
RAM 178986 179018 32 0.0
bl702 lighting-app bl702+eth FLASH 659154 659168 14 0.0
RAM 134897 134929 32 0.0
bl702+wifi FLASH 837248 837262 14 0.0
RAM 124485 124509 24 0.0
bl706+mfd+rpc+littlefs FLASH 1068792 1069062 270 0.0
RAM 117325 117349 24 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 898230 898244 14 0.0
RAM 105628 105660 32 0.0
lighting-app bl702l+mfd+littlefs FLASH 981944 981958 14 0.0
RAM 109820 109844 24 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 768500 768612 112 0.0
RAM 103352 103368 16 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 780096 780232 136 0.0
RAM 108520 108536 16 0.0
pump-app LP_EM_CC1354P10_6 FLASH 725620 725788 168 0.0
RAM 96916 96932 16 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 709984 710152 168 0.0
RAM 97132 97140 8 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 552454 552598 144 0.0
RAM 205104 205120 16 0.0
lock CC3235SF_LAUNCHXL FLASH 584890 584986 96 0.0
RAM 205320 205328 8 0.0
efr32 lock-app BRD4187C FLASH 959872 960000 128 0.0
RAM 122644 122644 0 0.0
BRD4338a FLASH 755184 755728 544 0.1
RAM 251892 251908 16 0.0
window-app BRD4187C FLASH 1053060 1053580 520 0.0
RAM 118840 118872 32 0.0
esp32 all-clusters-app c3devkit DRAM 102504 102512 8 0.0
FLASH 1770132 1770202 70 0.0
IRAM 83862 83862 0 0.0
m5stack DRAM 121348 121364 16 0.0
FLASH 1717354 1717494 140 0.0
IRAM 117051 117051 0 0.0
linux air-purifier-app debug unknown 4864 4864 0 0.0
FLASH 2597524 2599116 1592 0.1
RAM 116880 116992 112 0.1
all-clusters-app debug unknown 5696 5696 0 0.0
FLASH 6080074 6081638 1564 0.0
RAM 537400 537480 80 0.0
all-clusters-minimal-app debug unknown 5536 5536 0 0.0
FLASH 5214028 5215680 1652 0.0
RAM 228336 228416 80 0.0
bridge-app debug unknown 5568 5568 0 0.0
FLASH 4600382 4601972 1590 0.0
RAM 208600 208696 96 0.0
camera-app debug unknown 9008 9008 0 0.0
FLASH 6894779 6896347 1568 0.0
RAM 233712 233808 96 0.0
camera-controller debug unknown 9216 9216 0 0.0
FLASH 13643547 13643547 0 0.0
RAM 668960 668960 0 0.0
chip-tool debug unknown 6264 6264 0 0.0
FLASH 13693669 13693669 0 0.0
RAM 655864 655864 0 0.0
chip-tool-ipv6only arm64 unknown 40736 40736 0 0.0
FLASH 12721239 12721239 0 0.0
RAM 690824 690824 0 0.0
closure-app debug unknown 5536 5536 0 0.0
FLASH 4582164 4583754 1590 0.0
RAM 200464 200560 96 0.0
fabric-admin debug unknown 5944 5944 0 0.0
FLASH 12038144 12038144 0 0.0
RAM 654872 654872 0 0.0
fabric-bridge-app debug unknown 4816 4816 0 0.0
FLASH 4399292 4400882 1590 0.0
RAM 194248 194376 128 0.1
fabric-sync debug unknown 5056 5056 0 0.0
FLASH 5485669 5487253 1584 0.0
RAM 493992 494120 128 0.0
lighting-app debug+rpc+ui unknown 6272 6272 0 0.0
FLASH 5470225 5471841 1616 0.0
RAM 209784 209880 96 0.0
lock-app debug unknown 5496 5496 0 0.0
FLASH 4629064 4630676 1612 0.0
RAM 196992 197088 96 0.0
ota-provider-app debug unknown 4856 4856 0 0.0
FLASH 4257216 4258750 1534 0.0
RAM 185688 185768 80 0.0
ota-requestor-app debug unknown 4736 4736 0 0.0
FLASH 4319842 4321430 1588 0.0
RAM 188512 188640 128 0.1
shell debug unknown 4312 4312 0 0.0
FLASH 2943171 2944739 1568 0.1
RAM 149128 149256 128 0.1
thermostat-no-ble arm64 unknown 9856 9880 24 0.2
FLASH 4237135 4238207 1072 0.0
RAM 226760 226864 104 0.0
tv-app debug unknown 5824 5824 0 0.0
FLASH 5814373 5815893 1520 0.0
RAM 618336 618448 112 0.0
tv-casting-app debug unknown 5352 5352 0 0.0
FLASH 11841013 11842597 1584 0.0
RAM 772648 772776 128 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 912124 912304 180 0.0
RAM 152860 152872 12 0.0
nxp contact mcxw71+release FLASH 631928 632048 120 0.0
RAM 64108 64124 16 0.0
lock mcxw71+release FLASH 742408 742592 184 0.0
RAM 65192 65200 8 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1661332 1661884 552 0.0
RAM 211176 211192 16 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1582420 1582972 552 0.0
RAM 208440 208456 16 0.0
light cy8ckit_062s2_43012 FLASH 1453364 1453916 552 0.0
RAM 197168 197184 16 0.0
lock cy8ckit_062s2_43012 FLASH 1485692 1486244 552 0.0
RAM 224880 224896 16 0.0
qpg lighting-app qpg6200+debug FLASH 821176 821344 168 0.0
RAM 127636 127644 8 0.0
lock-app qpg6200+debug FLASH 758500 758676 176 0.0
RAM 118596 118604 8 0.0
stm32 light STM32WB5MM-DK FLASH 468220 468308 88 0.0
RAM 141360 141376 16 0.0
telink bridge-app tl7218x FLASH 709870 709810 -60 -0.0
RAM 93440 93452 12 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 798774 798720 -54 -0.0
RAM 44000 44012 12 0.0
light-app-ota-shell-factory-data tl7218x FLASH 789988 789934 -54 -0.0
RAM 100744 100756 12 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 716142 716090 -52 -0.0
RAM 54224 54236 12 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 749498 749446 -52 -0.0
RAM 77372 77384 12 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 726288 726236 -52 -0.0
RAM 36972 36984 12 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 606280 606226 -54 -0.0
RAM 112552 112564 12 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 822708 822658 -50 -0.0
RAM 99140 99152 12 0.0
tizen all-clusters-app arm unknown 5124 5136 12 0.2
FLASH 1773876 1774764 888 0.1
RAM 92428 92480 52 0.1
chip-tool-ubsan arm unknown 20772 20772 0 0.0
FLASH 21108954 21108954 0 0.0
RAM 9183200 9183200 0 0.0

@andy31415
Copy link
Contributor

From what I can tell PSOC6 is not compiled with size-optimization for debug builds (which presumably is what our CI builds) so the size increase there seems larger. I think real size is the rest that seem to be at O(200 bytes) and often under.

@andy31415
Copy link
Contributor

From what I can tell PSOC6 is not compiled with size-optimization for debug builds (which presumably is what our CI builds) so the size increase there seems larger. I think real size is the rest that seem to be at O(200 bytes) and often under.

I checked flags and it does use -Os. I am unclear why this compiles differently...

@andy31415 andy31415 added the sdk-maintainer-approved PR marked by `matter-sdk-maintainers` as suitable for MERGE - meets guideline & sufficient reviews. label Aug 15, 2025
@mergify mergify bot merged commit 5425fc0 into project-chip:master Aug 15, 2025
72 checks passed
@andy31415
Copy link
Contributor

andy31415 commented Aug 15, 2025

Maintainer approved: changes in size seem to be 200 bytes or lower for most cases. PSOC6 is larger for an unknown reason (I checked we compile with -Os) however at the same time that target seems to be large overall.

Pinged silabs folks about efr32 oddities (one build shows small size is possible, but other boards/apps show a larger size increase which I do not understand). We have to check that separately or accept it. @jepenven-silabs @jmartinez-silabs

dsavitsky-dsr pushed a commit to dsavitsky-dsr/connectedhomeip that referenced this pull request Aug 19, 2025
…40504)

* Initial seperation of cluster

* Update config

* Codegen

* Complete initial cluster impl, update build files

* Add codegen integration

* Fix build issues

* Use codegen mandatory attributes

* Use anon namespace, remove old cluster code

* Add unit tests

* Restyled by whitespace

* Restyled by clang-format

* Restyled by gn

* Remove old header includes

* Remove unused variable

* Update BUILD.gn for test

* Update config and CodegenIntegration

* Codegen

* Remove unneeded chip::app references

* Restyled by clang-format

* Codegen

* Add NotifyAttributeChangedIfSuccess on WriteAttribute

* Fix CodegenIntegration callback

* Update src/app/clusters/group-key-mgmt-server/group-key-mgmt-cluster.cpp

Co-authored-by: Andrei Litvin <andy314@gmail.com>

* Address review comments

* Restyled by whitespace

* Restyled by clang-format

---------

Co-authored-by: Restyled.io <commits@restyled.io>
Co-authored-by: Andrei Litvin <andy314@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app cluster-decoupling Work for cluster decoupling: remove direct app-specific code dependency and allow unit testing review - pending scripts sdk-maintainer-approved PR marked by `matter-sdk-maintainers` as suitable for MERGE - meets guideline & sufficient reviews.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants