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

Clean Up Composite UI #610

Merged
merged 7 commits into from
Jul 23, 2020
Merged

Clean Up Composite UI #610

merged 7 commits into from
Jul 23, 2020

Conversation

ethanchewy
Copy link
Contributor

@ethanchewy ethanchewy commented Jul 22, 2020

In this PR, I remove all of the "extra" information for each run step inside of the composite action.

It's easier to see through an example:

As you can see, our existing code has the equivalent information written to the debugging console as the "extra" information node.

Before Changes:
Screen Shot 2020-07-22 at 1 52 57 PM

After Changes:
Screen Shot 2020-07-22 at 1 54 17 PM

@@ -23,109 +23,113 @@ public sealed class ScriptHandler : Handler, IScriptHandler

public override void PrintActionDetails(ActionRunStage stage)
{
if (stage == ActionRunStage.Post)
// We don't want to display the internal workings if composite (similar/equivalent information can be found in debug)
if (!ExecutionContext.InsideComposite)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

All I did was wrap all the existing code in this if statement

Copy link
Member

Choose a reason for hiding this comment

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

add the if check to the caller of PrintActionDetails to reduce diff?

Copy link
Member

Choose a reason for hiding this comment

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

or should we print all these info using ExecutionContext.Debug() instead of ExecutionContext.Output()?

@ethanchewy ethanchewy changed the title Clean Up UI Clean Up Composite UI Jul 22, 2020
@@ -23,109 +23,113 @@ public sealed class ScriptHandler : Handler, IScriptHandler

public override void PrintActionDetails(ActionRunStage stage)
{
if (stage == ActionRunStage.Post)
// We don't want to display the internal workings if composite (similar/equivalent information can be found in debug)
Copy link
Collaborator

@ericsciple ericsciple Jul 22, 2020

Choose a reason for hiding this comment

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

var writeDetails = ExecutionContext.InsideComposite ? ExecutionContext.Debug : ExecutionContext.Output as Action<string>;

...

writeDetails($"##[group]Run {firstLine}");

Copy link
Contributor Author

@ethanchewy ethanchewy Jul 22, 2020

Choose a reason for hiding this comment

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

I tried using delegate stuff but couldn't figure it out / maybe it's impossible (???).

I'm just going to do this instead since it accomplishes the same thing and may be easier to read:

void writeDetails(string message)
            {
                if (ExecutionContext.InsideComposite)
                {
                    ExecutionContext.Debug(message);
                }
                else 
                {
                    ExecutionContext.Output(message);
                }
            }

@ethanchewy ethanchewy merged commit 2e50dff into main Jul 23, 2020
fabianishere pushed a commit to fabianishere/runner that referenced this pull request Aug 24, 2020
* Remove redundant code (display name is already evaluated in ActionRunner beforehand for each step)

* remove

* Remove nesting information for composite steps.

* put messages in debug logs if composite. if not, put these messages as outputs

* Fix group issue

* Fix end group issue
fabianishere pushed a commit to fabianishere/runner that referenced this pull request Sep 23, 2020
* Remove redundant code (display name is already evaluated in ActionRunner beforehand for each step)

* remove

* Remove nesting information for composite steps.

* put messages in debug logs if composite. if not, put these messages as outputs

* Fix group issue

* Fix end group issue
AdamOlech pushed a commit to antmicro/runner that referenced this pull request Jan 28, 2021
* Remove redundant code (display name is already evaluated in ActionRunner beforehand for each step)

* remove

* Remove nesting information for composite steps.

* put messages in debug logs if composite. if not, put these messages as outputs

* Fix group issue

* Fix end group issue
TingluoHuang pushed a commit that referenced this pull request Apr 21, 2021
* Remove redundant code (display name is already evaluated in ActionRunner beforehand for each step)

* remove

* Remove nesting information for composite steps.

* put messages in debug logs if composite. if not, put these messages as outputs

* Fix group issue

* Fix end group issue
@TingluoHuang TingluoHuang deleted the ethanchewy/composite/cleanUpUI 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