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.
Which issue(s) this PR fixes
Fixes None
Additional comments
Transform the
Operation
class to an abstract class that is declined in several implementations:PlaybookOperation(Operation)
OperationNoop(Operation, ABC)
DagOperation(Operation, ABC)
DagOperationNoop(DagOperation, OperationNoop)
DagOperationWithPlaybook(DagOperation, PlaybookOperation)
ForgedDagOperation(DagOperation, ABC)
ForgedDagOperationNoop(DagOperationNoop, ForgedDagOperation)
ForgedDagOperationWithPlaybook(DagOperationWithPlaybook, ForgedDagOperation)
OtherPlaybookOperation(PlaybookOperation)
The instanciation of the above classes is now ONLY done by the
Collections
class initialization, nowhere else.The
Collections
class now only exposes a single dict with all available operations, all other previous operations properties are removed (e.g.dag_operations
,other_operations
, etc.). Specific operation types can now be obtained using the newOperations
implementation (available atCollections.operations
) which define aget_by_class
method. For example, to retrieve a list of all operation from the DAG that are not forged during theCollections
initialization:Collections
andOperation
usage in the code have been refactored to match those new definitions, without affecting the existing logic.Agreements