Skip to content

Commit f8d8c22

Browse files
Skip backwards compatibility on internal data (specifically internal clusters) (#34543)
* Skip backwards compatibility on internal bits * Added unit test --------- Co-authored-by: Andrei Litvin <andreilitvin@google.com>
1 parent decd9e9 commit f8d8c22

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

scripts/py_matter_idl/matter_idl/backwards_compatibility.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ def attribute_name(attribute: Attribute) -> str:
5454

5555
def not_stable(maturity: ApiMaturity):
5656
"""Determine if the given api maturity allows binary/api changes or not."""
57-
# TODO: internal and deprecated not currently widely used,
58-
# so we enforce stability on them for now.
59-
return maturity == ApiMaturity.PROVISIONAL
57+
# NOTE: deprecated are not to be used, so we expect no changes. They were
58+
# probably "stable" at some point
59+
return (maturity == ApiMaturity.PROVISIONAL) or (maturity == ApiMaturity.INTERNAL)
6060

6161

6262
class CompatibilityChecker:

scripts/py_matter_idl/matter_idl/test_backwards_compatibility.py

+7
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,13 @@ def test_provisional_cluster(self):
188188
"provisional server cluster A = 16 { enum X : ENUM8 { A = 1; B = 3; } info event A = 2 { int16u x = 1;} }",
189189
Compatibility.ALL_OK)
190190

191+
def test_internal_cluster(self):
192+
self.ValidateUpdate(
193+
"Internal cluster changes are ok.",
194+
"internal server cluster A = 16 { enum X : ENUM8 { A = 1; B = 2; } info event A = 1 { int8u x = 1;} }",
195+
"internal server cluster A = 16 { enum X : ENUM8 { A = 1; B = 3; } info event A = 2 { int16u x = 1;} }",
196+
Compatibility.ALL_OK)
197+
191198
def test_clusters_enum_code(self):
192199
self.ValidateUpdate(
193200
"Adding an enum is ok. Also validates code formatting",

0 commit comments

Comments
 (0)