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

Composite Run Steps Refactoring #591

Merged
merged 52 commits into from
Jul 17, 2020
Merged

Conversation

ethanchewy
Copy link
Contributor

@ethanchewy ethanchewy commented Jul 13, 2020

In this PR, we consolidate the Composite Output Handler and the StepsRunner code all into the composite action handler as well as remove as much code as possible for ExecutionContext!

Previously, we built another steps runner for processing composite actions but that made us realized we actually don't need one and we can fit all the StepsRunner logic in the handler!

This provides a variety of benefits. Namely,

  • Easy status resolution for step progress
  • Separated logic for processing composite steps vs. regular action steps.
  • Easy to build step specific logic for an individual composite step logic like continue-on-error

Our main goal is to 1) refactor codebase so that Composite Actions has its own StepsRunner 2) Make sure this works with our previous built in functionalities for composite run steps.

In another PR, we'll build off of this PR to add on additional support for continue-on-error and timeout-minutes. After that, we'll start building support for nested actions of all types. We can also explore abstracting Execution Context for Composite Actions.

Based off of exploration here: #584

Previous composite changes for reference: https://github.com/actions/runner/commits?author=ethanchewy

One tangible benefit you can directly see from this PR, is that the UI shows the nested steps proceeding in order in an intuitive fashion now: https://drive.google.com/file/d/1JzAWi0qOHQSOK-fBMp8Q_AFwPkkRqvDl/view?usp=sharing

Old ScreenRecording for Reference (We don't update the timeline name for every step in the newest PR version):
Screen-Recording-2020-07-14-at-5

@ethanchewy ethanchewy marked this pull request as draft July 13, 2020 22:15
@ethanchewy ethanchewy changed the title Composite Steps Runner (In Progress) Composite Steps Runner Jul 13, 2020
@ethanchewy ethanchewy changed the base branch from master to main July 14, 2020 20:20
@ethanchewy
Copy link
Contributor Author

Current Progress on how UI Shows Composite Steps (each step is delayed for 5 secs):
https://drive.google.com/file/d/1-NrI8M1SoMKwS0y7LAl3JgmafzeVkapU/view?usp=sharing

@ethanchewy ethanchewy marked this pull request as ready for review July 15, 2020 16:35
@ethanchewy
Copy link
Contributor Author

experimenting to see if I can get my new commits to show in this PR...

@ethanchewy ethanchewy closed this Jul 15, 2020
@ethanchewy ethanchewy reopened this Jul 15, 2020
@@ -92,26 +92,11 @@ public async Task RunAsync(IExecutionContext jobContext)
var envContext = new CaseSensitiveDictionaryContextData();
#endif

// Global env
foreach (var pair in step.ExecutionContext.EnvironmentVariables)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are to revert the workaround we used to flow Env to composite actions. This is now handled in the Composite Steps Runner.

@ethanchewy ethanchewy changed the title (In Progress) Composite Steps Runner Composite Steps Runner Jul 15, 2020
@ethanchewy ethanchewy merged commit f9dca15 into main Jul 17, 2020
fabianishere pushed a commit to fabianishere/runner that referenced this pull request Aug 24, 2020
* Add basic framework for baby steps runner

* Basic logic for adding steps / invoking composite action steps

* Composite Steps Runner MVP

* Fix null object reference error

* intialize composiute

* Comment out code that is handled by stepsrunner

* Add composite clean up step

* Remove previous 'workarounds' from StepsRunner. Clean Up PR

* Remove todo

* Remove todo

* Fix using unitialized object yikes

* Remove time delay

* Format handler

* Move output handler into action handler

* Add try to evaluate display name

* Remove while loop yikes

* Abstract away the windows encoding check during step running

* Github context set to {ScopeName}.{ContextName} or {ContextName} if ScopeName is null

* Remove setting result to sucess since result defaults to sucess

* Fix windows error

* Fix windows

* revert:

* Windows fix

* Fix Windows Error in Abstraction

* Remove Composite Steps Runner => consolidate into Composite Steps Runner

* Remove unn. attribute in ExecutionContext

* Change protection levels, plus change function name to more clear meaning

* Remove location param

* location pt.2 fix

* Remove outputs step

* Remove temp directory

* new line

* Add arguitl not null

* better comment

* Change encoding name

* Check count > 0 for composite steps, import System.Threading

* Change function header encodingutil

* Add TODO

* Add await

* Handle Failed Step

* Move over SetAllCompositeOutputs to the handler

* Remove timeout-minutes setting in steps-level

* Use only ExecutionContext

* Move using to the top

* Remove redundant check

* Change function name

* Remove testing code

* Consolidate error code

* Consolidate code

* Change HandleOutput => ProcessCompositeActionOutputs

* Remove set the timeout comment

* Add Cancelling functionality + Remove unn. parameter
fabianishere pushed a commit to fabianishere/runner that referenced this pull request Sep 23, 2020
* Add basic framework for baby steps runner

* Basic logic for adding steps / invoking composite action steps

* Composite Steps Runner MVP

* Fix null object reference error

* intialize composiute

* Comment out code that is handled by stepsrunner

* Add composite clean up step

* Remove previous 'workarounds' from StepsRunner. Clean Up PR

* Remove todo

* Remove todo

* Fix using unitialized object yikes

* Remove time delay

* Format handler

* Move output handler into action handler

* Add try to evaluate display name

* Remove while loop yikes

* Abstract away the windows encoding check during step running

* Github context set to {ScopeName}.{ContextName} or {ContextName} if ScopeName is null

* Remove setting result to sucess since result defaults to sucess

* Fix windows error

* Fix windows

* revert:

* Windows fix

* Fix Windows Error in Abstraction

* Remove Composite Steps Runner => consolidate into Composite Steps Runner

* Remove unn. attribute in ExecutionContext

* Change protection levels, plus change function name to more clear meaning

* Remove location param

* location pt.2 fix

* Remove outputs step

* Remove temp directory

* new line

* Add arguitl not null

* better comment

* Change encoding name

* Check count > 0 for composite steps, import System.Threading

* Change function header encodingutil

* Add TODO

* Add await

* Handle Failed Step

* Move over SetAllCompositeOutputs to the handler

* Remove timeout-minutes setting in steps-level

* Use only ExecutionContext

* Move using to the top

* Remove redundant check

* Change function name

* Remove testing code

* Consolidate error code

* Consolidate code

* Change HandleOutput => ProcessCompositeActionOutputs

* Remove set the timeout comment

* Add Cancelling functionality + Remove unn. parameter
AdamOlech pushed a commit to antmicro/runner that referenced this pull request Jan 28, 2021
* Add basic framework for baby steps runner

* Basic logic for adding steps / invoking composite action steps

* Composite Steps Runner MVP

* Fix null object reference error

* intialize composiute

* Comment out code that is handled by stepsrunner

* Add composite clean up step

* Remove previous 'workarounds' from StepsRunner. Clean Up PR

* Remove todo

* Remove todo

* Fix using unitialized object yikes

* Remove time delay

* Format handler

* Move output handler into action handler

* Add try to evaluate display name

* Remove while loop yikes

* Abstract away the windows encoding check during step running

* Github context set to {ScopeName}.{ContextName} or {ContextName} if ScopeName is null

* Remove setting result to sucess since result defaults to sucess

* Fix windows error

* Fix windows

* revert:

* Windows fix

* Fix Windows Error in Abstraction

* Remove Composite Steps Runner => consolidate into Composite Steps Runner

* Remove unn. attribute in ExecutionContext

* Change protection levels, plus change function name to more clear meaning

* Remove location param

* location pt.2 fix

* Remove outputs step

* Remove temp directory

* new line

* Add arguitl not null

* better comment

* Change encoding name

* Check count > 0 for composite steps, import System.Threading

* Change function header encodingutil

* Add TODO

* Add await

* Handle Failed Step

* Move over SetAllCompositeOutputs to the handler

* Remove timeout-minutes setting in steps-level

* Use only ExecutionContext

* Move using to the top

* Remove redundant check

* Change function name

* Remove testing code

* Consolidate error code

* Consolidate code

* Change HandleOutput => ProcessCompositeActionOutputs

* Remove set the timeout comment

* Add Cancelling functionality + Remove unn. parameter
TingluoHuang pushed a commit that referenced this pull request Apr 21, 2021
* Add basic framework for baby steps runner

* Basic logic for adding steps / invoking composite action steps

* Composite Steps Runner MVP

* Fix null object reference error

* intialize composiute

* Comment out code that is handled by stepsrunner

* Add composite clean up step

* Remove previous 'workarounds' from StepsRunner. Clean Up PR

* Remove todo

* Remove todo

* Fix using unitialized object yikes

* Remove time delay

* Format handler

* Move output handler into action handler

* Add try to evaluate display name

* Remove while loop yikes

* Abstract away the windows encoding check during step running

* Github context set to {ScopeName}.{ContextName} or {ContextName} if ScopeName is null

* Remove setting result to sucess since result defaults to sucess

* Fix windows error

* Fix windows

* revert:

* Windows fix

* Fix Windows Error in Abstraction

* Remove Composite Steps Runner => consolidate into Composite Steps Runner

* Remove unn. attribute in ExecutionContext

* Change protection levels, plus change function name to more clear meaning

* Remove location param

* location pt.2 fix

* Remove outputs step

* Remove temp directory

* new line

* Add arguitl not null

* better comment

* Change encoding name

* Check count > 0 for composite steps, import System.Threading

* Change function header encodingutil

* Add TODO

* Add await

* Handle Failed Step

* Move over SetAllCompositeOutputs to the handler

* Remove timeout-minutes setting in steps-level

* Use only ExecutionContext

* Move using to the top

* Remove redundant check

* Change function name

* Remove testing code

* Consolidate error code

* Consolidate code

* Change HandleOutput => ProcessCompositeActionOutputs

* Remove set the timeout comment

* Add Cancelling functionality + Remove unn. parameter
@TingluoHuang TingluoHuang deleted the users/ethanchewy/compositeStepsRunner branch September 1, 2023 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants