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

Reworked pipeline to introduce phases for ordering #2444

Open
wants to merge 7 commits into
base: main-powderhouse
Choose a base branch
from

Conversation

KathleenDollard
Copy link
Contributor

@KathleenDollard KathleenDollard commented Jun 18, 2024

Updated #2410 to describe new approach.

PipleinePhases handle the ordering of subsystems. The underlying assumptions are:

  • There is a specific order in which subsystems should run
  • Almost all CLI authors, and many extension authors will have a loose grasp on ordering nuances (based on System.CommandLine history):
    • There is a specific order in which subsystems should run
    • Because of this, we want to restrict or eliminate reordering subsystems.
  • Wile rare, folks sometimes need to interact with ordering, and they will be most comfortable with concepts like "before validation" than arbitrary phases, which were also very difficult to name clearly.
    • A driving scenario is that novel subsystems (not variations on existing concepts, but things we dream of or have not even dreamed of) will need to be ordered correctly.

Also in this PR:

  • Added Enabled property to ResponseSubsystem and made it non-replaceable for now
  • Running Teardown more consistently
  • Added skeleton InvocationSubsystem and ValidationSubsystem
  • Made ValueSubsystem a non-replaceable subsystem

Note: I had to set this aside for several weeks and had a code loss git-astrophe that may have resulted in code loss as I picked it back up - so @mhutch and others, if this does not appear to be the design we discussed, I look forward to that discussion.

* Removed nested Pipelin.Subsystems
* Removed tests due to immutable ValueSubsystem
* Fixed bugs found in testing:
  * Kind needs to be passed to PipelinePhase constructor, Subsystem may be null so is not userful for retrieving
  * Phase list needs to be added in Pipeline constructor so is available to empty pipeline
  * PipelinePhrase needs to be a reference type as changes need to be available
  * Logic for getting specific subsystems didn't account for nulls correclty
* Teardown now consistently runs Execute
* Invocation and Validation are phases
This avoids a type check and moves a runtime error to compiler time for setting the main phase subsystem, which must be of the correct type r null.

Currently base and generic are in the same file to facilitate review (not having all the code show up as new in commits)
@KathleenDollard KathleenDollard added the Powderhouse Work to isolate parser and features label Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Powderhouse Work to isolate parser and features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant