Skip to content

Commit

Permalink
Skip backwards compatibility on internal data (specifically internal …
Browse files Browse the repository at this point in the history
…clusters) (#34543)

* Skip backwards compatibility on internal bits

* Added unit test

---------

Co-authored-by: Andrei Litvin <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Nov 19, 2024
1 parent 5ad336c commit 4460713
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/py_matter_idl/matter_idl/backwards_compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ def attribute_name(attribute: Attribute) -> str:

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


class CompatibilityChecker:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,13 @@ def test_provisional_cluster(self):
"provisional server cluster A = 16 { enum X : ENUM8 { A = 1; B = 3; } info event A = 2 { int16u x = 1;} }",
Compatibility.ALL_OK)

def test_internal_cluster(self):
self.ValidateUpdate(
"Internal cluster changes are ok.",
"internal server cluster A = 16 { enum X : ENUM8 { A = 1; B = 2; } info event A = 1 { int8u x = 1;} }",
"internal server cluster A = 16 { enum X : ENUM8 { A = 1; B = 3; } info event A = 2 { int16u x = 1;} }",
Compatibility.ALL_OK)

def test_clusters_enum_code(self):
self.ValidateUpdate(
"Adding an enum is ok. Also validates code formatting",
Expand Down

0 comments on commit 4460713

Please sign in to comment.