feat(api): add command annotations field to each command object in protocol engine #20726
+8,739
−31
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Closes AUTH-2553.
This PR adds a new
commandAnnotationfield to theBaseCommandCreatewhich is inherited by all PE command create objects. This field is a list that will contain the annotation IDs of any active command annotation when that command is created/queued, that will then be assigned to the command. This is fed in by theSyncClientwhich a future PAPI PR will hook up to most PE calls within the engine cores. For now, all commands generated will have this field be an empty list.This change is accompanied by version 17 of the command schema which now contains this field in the schema.
One additional change was made in this PR, changing the
BaseCommandcommandAnnotationsfield type fromOptional[List[Str]]with a default ofNonetoList[Str]with a default factory to create an empty list.Test Plan and Hands on Testing
No behavioral changes yet but tested running this code on a Flex and ensuring that nothing crashed when running protocols between recent alphas and this branch.
Changelog
commandAnnotationfield toBaseCommandCreatecommand_annotationfield toSyncClientexecute callsBaseCommandcommandAnnotationsfield type fromOptional[List[Str]]toList[Str]Review requests
I made the change for the
BaseCommandfield type since it seemed to me unnecessary to have it beNonewhen an empty list communicated the same thing, but if someone feels differently (e.g. it might be useful for older protocols, legacy JSON protocols, etc), I can change that.Risk assessment
Medium-high. This is a non-trivial change to the command objects, and does affect a lot of unit tests and will be a big analyses snapshot change, but there's no actual behavioral changes here, the risk is all backwards-compatibility.