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

Enhancement: added defaults shell and working-directory to composite #1803

Open
wants to merge 152 commits into
base: main
Choose a base branch
from

Conversation

nikola-jokic
Copy link
Contributor

Closes #836

This also removes the required shell parameter. That would not break existing workflows but will execute using default behaviour if shell and defaults are not specified.

@nikola-jokic nikola-jokic requested a review from a team as a code owner April 4, 2022 09:58
@nikola-jokic nikola-jokic changed the title Enhancecment: added defaults shell and working-directory to composite Enhancement: added defaults shell and working-directory to composite Apr 4, 2022
ExecutionContext.StepTelemetry.HasRunsStep = hasRunsStep;
ExecutionContext.StepTelemetry.HasUsesStep = hasUsesStep;
ExecutionContext.StepTelemetry.StepCount = steps.Count;
}
ExecutionContext.StepTelemetry.Type = "composite";

// save job defaults run to be restored after the composite run
IDictionary<string, string> jobDefaultsRun = new Dictionary<string, string>();
if (ExecutionContext.Global.JobDefaults.ContainsKey("run"))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Lets not overwrite job defaults, let's use a new key called CompositeDefaults, to minimize risk of these changes and make it clearer to read the code where these values are coming from.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed it but I am not sure if this is what you have meant.

Im2451soon
Im2451soon previously approved these changes Apr 7, 2022
@nikola-jokic nikola-jokic requested a review from thboop April 7, 2022 12:59
@@ -133,7 +137,7 @@
"working-directory": "string-steps-context",
"shell": {
"type": "string-steps-context",
"required": true
"required": false
Copy link
Collaborator

Choose a reason for hiding this comment

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

we should still fail here if composite defaults aren't set and a shell isn't set for that step. Do we currently do that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, in that case, the action would fail with this output:
image

@roryabraham
Copy link

Would love to see this PR make it over the finish line 😄

TingluoHuang and others added 17 commits May 12, 2023 13:05
)

* adding retry-all-errors based on curl version >= 7.71.0

* adding logging

* fixing conditional logic
…actions#2547)

* Rename AcquireJobRequest::StreamID to AcquireJobRequest::JobMessageID to match corresponding server-side update.
* appeased the linter
* Added unit tests to prove AcquireJobRequest serialization/deserialization is as-expected.
* Distinguish unit test variations.
* Incorporated PR Feedback.
* Only upload to Results with new job message type

* No need to have separate websocketFeedServer

* Linting fix

* Update src/Runner.Common/JobServerQueue.cs

Co-authored-by: Tingluo Huang <[email protected]>

* add connection timeout

* Consolidate initializing webclient to result client

* Retry websocket delivery for console logs

* Linter fix

* Do not give up for good, reconnect again in 10 minutes

* Has to reset delivered

* Only first time retry 3 times to connect to websocket

---------

Co-authored-by: Tingluo Huang <[email protected]>
* Add orchestrationId to useragent for better correlation.

* .
* handle conflict errors from run service

* nit: formatting

* fix formatting
* send annotations to run-service

* skip message deletion

* actually don't skip deletion

* enum as numbers

* fix enum

* linting

* remove unncessary file

* feedback
…ctions#2311)

* [1742] Ensure multiple composite annoations are correctly written.

This implementation uses a collector pattern to allow embedded ExecutionContexts to stash Issue objects for later processing by a non-embedded ancestor ExecutionContext.

Also:
 - Provide explicit constructor implementations for ExecutionContext
 - Leverage explicit constructors to solidify immutability of several ExecutionContext class members.
 - Fixed erroneous call to ExecutionContext.Complete in CompositeActionHandler.cs
 - Use a consistent timestamp for FinishTime in ExecutionContext::Complete

* Ensure collected issues are processed only by a non-embedded ExecutionContext.
This was already implicit.  Now, just making it explicit.

* Provide a clear mechanism that allows callers to opt-in/opt-out of ExecutionContext::AddIssue's logging behavior.
* Addressed deserialization inconsistencies in TimelineRecord.cs
* Added TimelineRecord unit tests.
* Refined unit tests related to TimelineRecord::Variables case-insensitivity
* Add a unit test that verifies ExecutionContextLogOptions::LogMessageOverride has the desired effect.
* Responded to PR feedback.
* Don't allow embedded ExecutionContexts to add Issues to a TimelineRecord
…#2443)

* Add --no-default-labels option

Signed-off-by: Gabriel Adrian Samfira <[email protected]>

* Add tests

Signed-off-by: Gabriel Adrian Samfira <[email protected]>

* .

---------

Signed-off-by: Gabriel Adrian Samfira <[email protected]>
Co-authored-by: Tingluo Huang <[email protected]>
…tructure Error Flagging (actions#2488)

* adding extra catch for download failure in composite actions

* Adding infra error

* Adding error handling centralizing

* updating try catch bubbling

* cleaning up commits

* cleaning up commits

* cleaning up commits

* updating bubbler

* cleaning up test files

* Fixing linting errors

* updating exception bubble

* reverting composite

* updating catch to not exclude other exceptions

* removing uneeded import

* Update src/Runner.Worker/ActionRunner.cs

Co-authored-by: Tingluo Huang <[email protected]>

* Update src/Runner.Worker/ActionManager.cs

Co-authored-by: Tingluo Huang <[email protected]>

* Update src/Runner.Worker/ActionManager.cs

Co-authored-by: Tingluo Huang <[email protected]>

* Update src/Runner.Worker/ActionManager.cs

Co-authored-by: Tingluo Huang <[email protected]>

* Update src/Runner.Worker/ActionManager.cs

Co-authored-by: Tingluo Huang <[email protected]>

* moving download out of for loop; reverting exception wrap

* Update src/Runner.Worker/ActionManager.cs

Co-authored-by: Tingluo Huang <[email protected]>

* Adding blank lines back

* Adding blank lines back

* removing uneeded catch for download fail

* adding var back for consistency

* formatting clean

---------

Co-authored-by: Tingluo Huang <[email protected]>
@nikola-jokic nikola-jokic dismissed a stale review via 29b7a63 May 12, 2023 11:34
Bentley617617
Bentley617617 previously approved these changes May 12, 2023
}

string line = $"{DateTime.UtcNow.ToString("O")} {message}";
_pageWriter.WriteLine(line);
_resultsBlockWriter.WriteLine(line);

Check failure

Code scanning / CodeQL

Clear text storage of sensitive information

This stores sensitive data returned by [access to parameter password : String](1) as clear text. This stores sensitive data returned by [access to parameter password : String](2) as clear text. This stores sensitive data returned by [access to parameter password : String](3) as clear text. This stores sensitive data returned by [access to field _httpProxyPassword : String](4) as clear text. This stores sensitive data returned by [access to field _httpsProxyPassword : String](5) as clear text.
@nikola-jokic nikola-jokic force-pushed the nikola-jokic/enhancement/836 branch from 29b7a63 to ab0f3e1 Compare May 12, 2023 13:22
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.

add possibility to use defaults inside of composite actions