Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce new operation entities #635

Merged
merged 1 commit into from
Nov 29, 2024
Merged

Conversation

PaulFarault
Copy link
Contributor

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 new Operations implementation (available at Collections.operations) which define a get_by_class method. For example, to retrieve a list of all operation from the DAG that are not forged during the Collections initialization:

collections.operations.get_by_class(include=DagOperation, exclude=ForgedOperation)

Collections and Operation usage in the code have been refactored to match those new definitions, without affecting the existing logic.

Agreements

@PaulFarault PaulFarault added this to the 0.1.0 milestone Nov 29, 2024
@PaulFarault PaulFarault self-assigned this Nov 29, 2024
@PaulFarault PaulFarault merged commit 9c866eb into master Nov 29, 2024
5 checks passed
@PaulFarault PaulFarault deleted the paul/new-operations-entities branch November 29, 2024 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants