Skip to content

Commit

Permalink
Stop using human-readable release names in Darwin availability.yaml. (p…
Browse files Browse the repository at this point in the history
…roject-chip#33677)

People are making assumptions based on those, and those assumptions will come
back to bite them.

Just switch to using UUIDs for the release names.
  • Loading branch information
bzbarsky-apple authored May 30, 2024
1 parent 452cad3 commit 55012bf
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 78 deletions.
8 changes: 4 additions & 4 deletions src/darwin/Framework/CHIP/templates/MTRBaseClusters-src.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ MTR{{cluster}}Cluster{{command}}Params
{{! This is used as the implementation for both the new-name and old-name bits, so check for both here. }}
{{#if (or (isSupported (asUpperCamelCase parent.name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true))
(and (isSupported (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name))
(wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name))))}}
(wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name))))}}
{{#*inline "attribute"}}Attribute{{asUpperCamelCase name preserveAcronyms=true}}{{/inline}}
- (void)read{{>attribute}}With
{{~#if_is_fabric_scoped_struct type~}}
Expand Down Expand Up @@ -223,15 +223,15 @@ reportHandler:(void (^)({{asObjectiveCClass type parent.name}} * _Nullable value
{{/if}}
{{/unless}}

{{#if (and (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping name))
{{#if (and (wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" (compatClusterNameRemapping name))
(isSupported (compatClusterNameRemapping name)))}}
@implementation MTRBaseCluster{{compatClusterNameRemapping name}} (Deprecated)

{{#zcl_commands}}
{{#if (is_str_equal source 'client')}}
{{! Takes two arguments: cluster name and command name, plus the ambient state where the command is "this" }}
{{#*inline "commandImpl"}}
{{#if (and (wasIntroducedBeforeRelease "First major API revamp" cluster command=command)
{{#if (and (wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" cluster command=command)
(isSupported cluster command=command))}}
- (void){{asLowerCamelCase command}}WithParams:(MTR{{cluster}}Cluster{{command}}Params * {{#unless commandHasRequiredField}}_Nullable{{/unless}})params completionHandler:({{>command_completion_type command=. compatRemapNames=true}})completionHandler
{
Expand Down Expand Up @@ -268,7 +268,7 @@ reportHandler:(void (^)({{asObjectiveCClass type parent.name}} * _Nullable value
{{/zcl_commands}}

{{#zcl_attributes_server removeKeys='isOptional'}}
{{#if (and (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name))
{{#if (and (wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name))
(isSupported (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name)))}}
{{#*inline "attribute"}}Attribute{{compatAttributeNameRemapping parent.name name}}{{/inline}}
- (void)read{{>attribute}}With
Expand Down
42 changes: 21 additions & 21 deletions src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt

Large diffs are not rendered by default.

50 changes: 25 additions & 25 deletions src/darwin/Framework/CHIP/templates/MTRClusterConstants.zapt

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ MTR{{cluster}}Cluster{{command}}Params
(isSupported "" globalAttribute=(asUpperCamelCase label preserveAcronyms=true)))
(or (isSupported (asUpperCamelCase parent.name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true))
(and (isSupported (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name))
(wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name)))))}}
(wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name)))))}}
{{#*inline "cluster"}}{{asUpperCamelCase parent.name preserveAcronyms=true}}{{/inline}}
{{#*inline "attribute"}}Attribute{{asUpperCamelCase name preserveAcronyms=true}}{{/inline}}
- (NSDictionary<NSString *, id> * _Nullable)read{{>attribute}}WithParams:(MTRReadParams * _Nullable)params {
Expand Down Expand Up @@ -143,7 +143,7 @@ MTR{{cluster}}Cluster{{command}}Params
{{/if}}
{{/unless}}

{{#if (and (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping name))
{{#if (and (wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" (compatClusterNameRemapping name))
(isSupported (compatClusterNameRemapping name)))}}
@implementation MTRCluster{{compatClusterNameRemapping name}} (Deprecated)

Expand All @@ -156,7 +156,7 @@ MTR{{cluster}}Cluster{{command}}Params
{{#if (is_str_equal source 'client')}}
{{! Takes two arguments: cluster name and command name, plus the ambient state where the command is "this" }}
{{#*inline "commandImpl"}}
{{#if (and (wasIntroducedBeforeRelease "First major API revamp" cluster command=command)
{{#if (and (wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" cluster command=command)
(isSupported cluster command=command))}}
- (void){{asLowerCamelCase command}}WithParams:(MTR{{cluster}}Cluster{{command}}Params * {{#unless commandHasRequiredField}}_Nullable{{/unless}})params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completionHandler:({{>command_completion_type command=. compatRemapNames=true}})completionHandler
{
Expand Down
22 changes: 11 additions & 11 deletions src/darwin/Framework/CHIP/templates/MTRClusters.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@ NS_ASSUME_NONNULL_BEGIN
{{! Takes two arguments: cluster name and command name, plus the ambient state where the command is "this" }}
{{#*inline "commandDecl"}}
{{#if (isSupported cluster command=command)}}
- (void){{asLowerCamelCase name}}WithParams:(MTR{{cluster}}Cluster{{command}}Params * {{#unless commandHasRequiredField}}_Nullable{{/unless}})params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:({{>command_completion_type command=.}})completion {{availability cluster command=command minimalRelease="First major API revamp"}};
- (void){{asLowerCamelCase name}}WithParams:(MTR{{cluster}}Cluster{{command}}Params * {{#unless commandHasRequiredField}}_Nullable{{/unless}})params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:({{>command_completion_type command=.}})completion {{availability cluster command=command minimalRelease="267F4B03-3256-4056-A62D-5237640FDCFE"}};
{{#unless commandHasRequiredField}}
- (void){{asLowerCamelCase name}}WithExpectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:({{>command_completion_type command=.}})completion
{{! KeySetReadAllIndices grew this params-less API later _after_ it had already been shipped, so it needs to be special-cased here }}
{{#if (and (isStrEqual command "KeySetReadAllIndices")
(isStrEqual cluster "GroupKeyManagement"))}}
{{availability cluster command=command minimalRelease="Fall 2023"}};
{{availability cluster command=command minimalRelease="3C23F160-13CE-4397-BC65-122B61E4D691"}};
{{else}}
{{#if (isInConfigList
(concat (asUpperCamelCase cluster preserveAcronyms=true) "::" (asUpperCamelCase command preserveAcronyms=true))
"LegacyCommandsWithOnlyOptionalArguments")}}
{{availability cluster command=command minimalRelease="Early 2024"}};
{{availability cluster command=command minimalRelease="ADDB2DC1-4701-4696-87EB-87CD1123BE1A"}};
{{else}}
{{availability cluster command=command minimalRelease="First major API revamp"}};
{{availability cluster command=command minimalRelease="267F4B03-3256-4056-A62D-5237640FDCFE"}};
{{/if}}
{{/if}}
{{/unless}}
Expand Down Expand Up @@ -85,7 +85,7 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (instancetype _Nullable)initWithDevice:(MTRDevice *)device
endpointID:(NSNumber *)endpointID
queue:(dispatch_queue_t)queue {{availability (asUpperCamelCase name preserveAcronyms=true) minimalRelease="First major API revamp"}};
queue:(dispatch_queue_t)queue {{availability (asUpperCamelCase name preserveAcronyms=true) minimalRelease="267F4B03-3256-4056-A62D-5237640FDCFE"}};

@end

Expand All @@ -104,21 +104,21 @@ NS_ASSUME_NONNULL_BEGIN
{{/zcl_clusters}}

{{#zcl_clusters}}
{{#if (and (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping name))
{{#if (and (wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" (compatClusterNameRemapping name))
(isSupported (compatClusterNameRemapping name)))}}
@interface MTRCluster{{compatClusterNameRemapping name}} (Deprecated)

- (nullable instancetype)initWithDevice:(MTRDevice *)device
endpoint:(uint16_t)endpoint
queue:(dispatch_queue_t)queue {{availability (compatClusterNameRemapping name) deprecatedRelease="First major API revamp" deprecationMessage="Please use initWithDevice:endpoindID:queue:"}};
queue:(dispatch_queue_t)queue {{availability (compatClusterNameRemapping name) deprecatedRelease="267F4B03-3256-4056-A62D-5237640FDCFE" deprecationMessage="Please use initWithDevice:endpoindID:queue:"}};

{{#zcl_commands}}
{{#if (is_str_equal source 'client')}}
{{! Takes two arguments: cluster name and command name, plus the ambient state where the command is "this" }}
{{#*inline "commandDecl"}}
{{#if (and (wasIntroducedBeforeRelease "First major API revamp" cluster command=command)
{{#if (and (wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" cluster command=command)
(isSupported cluster command=command))}}
- (void){{asLowerCamelCase command}}WithParams:(MTR{{cluster}}Cluster{{command}}Params * {{#unless commandHasRequiredField}}_Nullable{{/unless}})params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completionHandler:({{>command_completion_type command=. compatRemapNames=true}})completionHandler {{availability cluster command=command deprecatedRelease="First major API revamp" deprecationMessage=(concat "Please use " (asLowerCamelCase name) "WithParams:expectedValues:expectedValueInterval:completion:")}};
- (void){{asLowerCamelCase command}}WithParams:(MTR{{cluster}}Cluster{{command}}Params * {{#unless commandHasRequiredField}}_Nullable{{/unless}})params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completionHandler:({{>command_completion_type command=. compatRemapNames=true}})completionHandler {{availability cluster command=command deprecatedRelease="267F4B03-3256-4056-A62D-5237640FDCFE" deprecationMessage=(concat "Please use " (asLowerCamelCase name) "WithParams:expectedValues:expectedValueInterval:completion:")}};
{{#unless commandHasRequiredField}}
{{! No need for these backwards-compat APIs for commands that never shipped them. }}
{{#unless (isInConfigList
Expand All @@ -127,7 +127,7 @@ NS_ASSUME_NONNULL_BEGIN
{{! KeySetReadAllIndices grew this params-less API later _after_ it had already been shipped, so it needs to be special-cased here }}
{{#unless (and (isStrEqual cluster "GroupKeyManagement")
(isStrEqual command "KeySetReadAllIndices"))}}
- (void){{asLowerCamelCase command}}WithExpectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completionHandler:({{>command_completion_type command=. compatRemapNames=true}})completionHandler {{availability cluster command=command deprecatedRelease="First major API revamp" deprecationMessage=(concat "Please use " (asLowerCamelCase name) "WithExpectedValues:expectedValueInterval:completion:")}};
- (void){{asLowerCamelCase command}}WithExpectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completionHandler:({{>command_completion_type command=. compatRemapNames=true}})completionHandler {{availability cluster command=command deprecatedRelease="267F4B03-3256-4056-A62D-5237640FDCFE" deprecationMessage=(concat "Please use " (asLowerCamelCase name) "WithExpectedValues:expectedValueInterval:completion:")}};
{{/unless}}
{{/unless}}
{{/unless}}
Expand All @@ -140,7 +140,7 @@ NS_ASSUME_NONNULL_BEGIN
{{~#zcl_attributes_server}}
{{~#*inline "attributeDecls"}}
{{#unless (isStrEqual attribute (asUpperCamelCase name preserveAcronyms=true))}}
- (NSDictionary<NSString *, id> *)readAttribute{{attribute}}WithParams:(MTRReadParams * _Nullable)params {{availability cluster attribute=attribute deprecatedRelease="First major API revamp" deprecationMessage=(concat "Please use readAttribute" (asUpperCamelCase name preserveAcronyms=true) "WithParams on MTRCluster" (asUpperCamelCase parent.name preserveAcronyms=true))}};
- (NSDictionary<NSString *, id> *)readAttribute{{attribute}}WithParams:(MTRReadParams * _Nullable)params {{availability cluster attribute=attribute deprecatedRelease="267F4B03-3256-4056-A62D-5237640FDCFE" deprecationMessage=(concat "Please use readAttribute" (asUpperCamelCase name preserveAcronyms=true) "WithParams on MTRCluster" (asUpperCamelCase parent.name preserveAcronyms=true))}};
{{#if (or isWritableAttribute
(isInConfigList (concat (asUpperCamelCase parent.name) "::" label) "DarwinForceWritable"))}}
- (void)writeAttribute{{attribute}}WithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs {{availability cluster attribute=attribute deprecationMessage=(concat "Please use writeAttribute" (asUpperCamelCase name preserveAcronyms=true) "WithValue on MTRCluster" (asUpperCamelCase parent.name preserveAcronyms=true))}};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ NS_ASSUME_NONNULL_BEGIN
{{>init_struct_member label=label type=type cluster=parent.parent.name}}
{{/zcl_command_arguments}}
{{#if (or (isStrEqual source "client")
(wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping parent.name) command=(compatCommandNameRemapping parent.name name)))}}
(wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" (compatClusterNameRemapping parent.name) command=(compatCommandNameRemapping parent.name name)))}}
_timedInvokeTimeoutMs = nil;
{{/if}}
{{#if (isStrEqual source "client")}}
Expand All @@ -49,7 +49,7 @@ NS_ASSUME_NONNULL_BEGIN
other.{{asStructPropertyName label}} = self.{{asStructPropertyName label}};
{{/zcl_command_arguments}}
{{#if (or (isStrEqual source "client")
(wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping parent.name) command=(compatCommandNameRemapping parent.name name)))}}
(wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" (compatClusterNameRemapping parent.name) command=(compatCommandNameRemapping parent.name name)))}}
other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs;
{{/if}}
{{#if (isStrEqual source "client")}}
Expand Down Expand Up @@ -210,7 +210,7 @@ NS_ASSUME_NONNULL_BEGIN
{{#if (isStrEqual source "client")}}
@dynamic timedInvokeTimeoutMs;
@dynamic serverSideProcessingTimeout;
{{else if (wasIntroducedBeforeRelease "First major API revamp" cluster command=command)}}
{{else if (wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" cluster command=command)}}
@dynamic timedInvokeTimeoutMs;
{{/if}}
@end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout;
{{! This is using the pre-renaming names for the isAvailableBefore test, because the pre-rename things inherit
from the post-rename ones and need to have this selector.}}
{{else if (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping parent.name) command=(compatCommandNameRemapping parent.name name))}}
{{else if (wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" (compatClusterNameRemapping parent.name) command=(compatCommandNameRemapping parent.name name))}}
/**
* Controls whether the command is a timed command (using Timed Invoke).
*
Expand Down Expand Up @@ -86,7 +86,7 @@ NS_ASSUME_NONNULL_BEGIN
* schema for this command.
*/
- (nullable instancetype)initWithResponseValue:(NSDictionary<NSString *, id> *)responseValue
error:(NSError * __autoreleasing *)error {{availability cluster command=command deprecationMessage="This command has been removed" minimalRelease="Fall 2023"}};
error:(NSError * __autoreleasing *)error {{availability cluster command=command deprecationMessage="This command has been removed" minimalRelease="3C23F160-13CE-4397-BC65-122B61E4D691"}};
{{/if}}
@end
{{/if}}
Expand Down
18 changes: 9 additions & 9 deletions src/darwin/Framework/CHIP/templates/availability.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
# "provisional" to make sure all the things that should have
# been omitted have been.

- release: "Initial release"
- release: "0E17B7EB-314F-4264-BDA8-AD6A93120B15"
versions:
iOS: "16.1"
macOS: "13.0"
Expand Down Expand Up @@ -4774,7 +4774,7 @@
- PulseWidthModulation
- TimeSynchronization

- release: "First dot-release"
- release: "FD8D09B4-6CF7-4EBA-BD4F-7EDE872E3098"
versions:
iOS: "16.2"
macOS: "13.1"
Expand Down Expand Up @@ -4830,7 +4830,7 @@
Descriptor:
DeviceTypeStruct: DeviceType

- release: "First major API revamp"
- release: "267F4B03-3256-4056-A62D-5237640FDCFE" # First major API revamp
versions:
iOS: "16.4"
macOS: "13.3"
Expand Down Expand Up @@ -6787,7 +6787,7 @@
HeatSetpointPresent: HeatSetpointFieldPresent
CoolSetpointPresent: CoolSetpointFieldPresent

- release: "First after major API revamp"
- release: "27C5E231-9EB5-4932-B4C1-10D88419D9CB" # First after major API revamp
versions:
iOS: "16.5"
macOS: "13.4"
Expand Down Expand Up @@ -7095,7 +7095,7 @@
PumpFeature:
LocalOperation: Local

- release: "Fall 2023"
- release: "3C23F160-13CE-4397-BC65-122B61E4D691"
versions:
iOS: "17.0"
macOS: "14.0"
Expand Down Expand Up @@ -7560,7 +7560,7 @@
- TimeFailure
- MissingTrustedTimeSource

- release: "Fall 2023 #2"
- release: "F7CA8603-6336-4E63-A216-30EE3F77CE8B"
versions:
iOS: "17.1"
macOS: "14.1"
Expand Down Expand Up @@ -7625,7 +7625,7 @@
- ProxyDiscovery
- ProxyValid

- release: "Fall 2023 #3"
- release: "A188F985-88AC-4F0B-8968-C887132CEF9E"
versions:
iOS: "17.2"
macOS: "14.2"
Expand Down Expand Up @@ -7771,7 +7771,7 @@
Feature:
DeadFrontBehavior: DeadFront

- release: "Early 2024"
- release: "ADDB2DC1-4701-4696-87EB-87CD1123BE1A"
versions:
iOS: "17.4"
macOS: "14.4"
Expand Down Expand Up @@ -8509,7 +8509,7 @@
ContentLaunchStatusEnum:
- URLNotAvailable

- release: "Middle of 2024"
- release: "FB974A56-BCF5-46CB-91EF-B5D096E84375"
versions:
iOS: "17.6"
macOS: "14.6"
Expand Down

0 comments on commit 55012bf

Please sign in to comment.