Skip to content

Generate DoorLock cluster with Alchemy#43545

Open
tersal wants to merge 1 commit intoproject-chip:masterfrom
tersal:doorlock-alchemy-generation
Open

Generate DoorLock cluster with Alchemy#43545
tersal wants to merge 1 commit intoproject-chip:masterfrom
tersal:doorlock-alchemy-generation

Conversation

@tersal
Copy link
Contributor

@tersal tersal commented Mar 10, 2026

Summary

Alchemy generation of DoorLock cluster, most meaningful changes are:

  • Removed redundant attributes from XML elements.
  • Remove/Add attributes from the spec.
  • Removed provisional from ALIRO feature related attributes according to how it is described in the spec.

Related issues

Part of #37391

Testing

No meaningful code change, CI should run tests and validate backwards compatibility.

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 automatically regenerates the DoorLock cluster definition using Alchemy. The changes align the data model with the latest specification, removing redundant attributes and updating descriptions. I've found a few potential issues in the generated files: a risky default value for an enum in a C++ header, and a couple of typos in user-facing summary strings in the XML definition.

// to kUnknownEnumValue. This is a helper enum value that should only
// be used by code to process how it handles receiving and unknown
// enum value. This specific should never be transmitted.
kUnknownEnumValue = 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The kUnknownEnumValue for StatusCodeEnum is set to 0. This is risky because 0 is often used for Success in other status enums (e.g., DlStatus). If an unknown status code is received, it would be mapped to 0, which could be misinterpreted as success. Other enums in this file use a value outside the valid range for kUnknownEnumValue. It would be safer to use a value that is not 0, for example 4.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The enum StatusCodeEnum has two values with values 2 and 3, I'm assuming the generator is taking the first unused number to define as kUnknownEnumValue, which will be odd in this case...

<optionalConform/>
</otherwiseConform>
</feature>
<feature bit="3" code="LOG" name="Logging" summary="TLLock supports local/on-lock logging when Events are not supportedGt">
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

There appear to be typos in the summary attribute. It says "TLLock" and "supportedGt". It should probably be "Lock" and "supported". Since this file is auto-generated, the fix is likely needed in the source for the generator (src/app_clusters/DoorLock.adoc).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This description was generated through the errata, it seems that the typo is there (probably a copy/paste error), however these features are no longer supported in the spec.

</orTerm>
</mandatoryConform>
</feature>
<feature bit="9" code="NOT" name="Notification" summary="TOperation and Programming Notificationst">
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

There appear to be typos in the summary attribute. It says "TOperation" and "Notificationst". It should probably be "Operation" and "Notifications". Since this file is auto-generated, the fix is likely needed in the source for the generator (src/app_clusters/DoorLock.adoc).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This description was generated through the errata, it seems that the typo is there (probably a copy/paste error), however these features are no longer supported in the spec.

@tersal tersal marked this pull request as ready for review March 10, 2026 06:39
@tersal tersal requested a review from a team as a code owner March 10, 2026 06:39
Copilot AI review requested due to automatic review settings March 10, 2026 06:39
@tersal tersal requested review from a team as code owners March 10, 2026 06:39
Copy link
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 converts the DoorLock cluster XML file to be Alchemy-generated (as part of issue #37391), aligning it with the rest of the zcl data-model XML files that have already been migrated to Alchemy. The key substantive changes are: removing provisional from ALIRO-related attributes (per spec), adding the new StatusCodeEnum enum, and updating constraints/types on various command fields (e.g., char_string<10> for userName, octet_string instead of long_octet_string for credentialData). The .matter files and generated code files in zzz_generated/ are updated accordingly.

Changes:

  • door-lock-cluster.xml: Replaced manual XML with Alchemy-generated output; removed provisional from ALIRO attributes, removed redundant <access op="read" .../> elements, updated field constraints, added StatusCodeEnum, and converted command codes to hex.
  • Multiple .matter files (controller, examples, lock-apps): Updated to reflect the XML changes, including removing provisional from Aliro attributes, adding StatusCodeEnum, changing userName to char_string<10>, credentialData from long_octet_string to octet_string, and doc-comment updates.
  • zzz_generated/ files: Added StatusCodeEnum C++/Python/Objective-C enum definitions.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml Replaced with Alchemy-generated XML; added DO NOT EDIT header, removed provisional from ALIRO attributes, updated constraints, added StatusCodeEnum
zzz_generated/app-common/clusters/DoorLock/Enums.h Added new StatusCodeEnum C++ enum
zzz_generated/app-common/clusters/DoorLock/EnumsCheck.h Added EnsureKnownEnumValue for the new StatusCodeEnum
src/controller/python/matter/clusters/Objects.py Added StatusCodeEnum Python enum
src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h Added MTRDoorLockStatusCode ObjC enum, updated command doc-comments
src/controller/data_model/controller-clusters.matter Updated DoorLock cluster: removed provisional, added StatusCodeEnum, updated field types/comments
Multiple examples/**/*.matter and examples/lock-app/**/*.matter Same DoorLock cluster updates propagated to all example apps

@github-actions
Copy link

github-actions bot commented Mar 10, 2026

PR #43545: Size comparison from 2509a55 to 12612e7

Full report (34 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
platform target config section 2509a55 12612e7 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1089430 1089430 0 0.0
RAM 144762 144762 0 0.0
bl616 lighting-app bl616+thread FLASH 1100108 1100108 0 0.0
RAM 104184 104184 0 0.0
bl616+wifi+shell FLASH 1586972 1586972 0 0.0
RAM 98080 98080 0 0.0
bl702 lighting-app bl702+eth FLASH 1052790 1052790 0 0.0
RAM 108357 108357 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 890814 890814 0 0.0
RAM 105748 105748 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 779236 779236 0 0.0
RAM 103324 103324 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 786576 786568 -8 -0.0
RAM 108508 108508 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 732812 732812 0 0.0
RAM 97316 97316 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 716248 716248 0 0.0
RAM 97476 97476 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 558130 558130 0 0.0
RAM 204504 204504 0 0.0
lock CC3235SF_LAUNCHXL FLASH 591262 591254 -8 -0.0
RAM 204744 204744 0 0.0
efr32 lock-app BRD4187C FLASH 971260 971244 -16 -0.0
RAM 125796 125796 0 0.0
BRD4338a FLASH 769676 769660 -16 -0.0
RAM 236528 236528 0 0.0
window-app BRD4187C FLASH 1074944 1074944 0 0.0
RAM 126440 126440 0 0.0
esp32 all-clusters-app c3devkit DRAM 98356 98356 0 0.0
FLASH 1596670 1596670 0 0.0
IRAM 93514 93514 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 857656 857656 0 0.0
RAM 161999 161999 0 0.0
nxp contact mcxw71+release FLASH 735904 735904 0 0.0
RAM 66936 66936 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1708852 1708852 0 0.0
RAM 213940 213940 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1607524 1607524 0 0.0
RAM 210812 210812 0 0.0
light cy8ckit_062s2_43012 FLASH 1470668 1470668 0 0.0
RAM 196988 196988 0 0.0
lock cy8ckit_062s2_43012 FLASH 1497364 1497348 -16 -0.0
RAM 224732 224732 0 0.0
qpg lighting-app qpg6200+debug FLASH 840748 840748 0 0.0
RAM 127780 127780 0 0.0
lock-app qpg6200+debug FLASH 779408 779408 0 0.0
RAM 118728 118728 0 0.0
realtek light-switch-app rtl8777g FLASH 720776 720776 0 0.0
RAM 113448 113448 0 0.0
lighting-app rtl8777g FLASH 767984 767984 0 0.0
RAM 114688 114688 0 0.0
stm32 light STM32WB5MM-DK FLASH 478904 478904 0 0.0
RAM 141324 141324 0 0.0
telink bridge-app tl7218x FLASH 728880 728880 0 0.0
RAM 95768 95768 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 853046 853046 0 0.0
RAM 44184 44184 0 0.0
tl7218x FLASH 844446 844446 0 0.0
RAM 99572 99572 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 725726 725726 0 0.0
RAM 55740 55740 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 788290 788290 0 0.0
RAM 74924 74924 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 725726 725726 0 0.0
RAM 33228 33228 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 615502 615502 0 0.0
RAM 118232 118232 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 843242 843246 4 0.0
RAM 97280 97280 0 0.0

@codecov
Copy link

codecov bot commented Mar 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.05%. Comparing base (d93b463) to head (12612e7).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #43545   +/-   ##
=======================================
  Coverage   54.05%   54.05%           
=======================================
  Files        1549     1549           
  Lines      106697   106697           
  Branches    13318    13318           
=======================================
  Hits        57675    57675           
  Misses      49022    49022           

☔ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants