mirror of
https://github.com/actions/runner.git
synced 2025-12-10 04:06:57 +00:00
Compare commits
28 Commits
fixEmptyGi
...
v2.273.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c5904d5da8 | ||
|
|
99b28c4143 | ||
|
|
c7b8552edf | ||
|
|
b75246e0fe | ||
|
|
a41a9ba8c7 | ||
|
|
c18643e529 | ||
|
|
0face6e3af | ||
|
|
306be41266 | ||
|
|
4e85b8f3b7 | ||
|
|
476640fd51 | ||
|
|
d05b9111c6 | ||
|
|
444332ca88 | ||
|
|
e6eb9e381d | ||
|
|
3a76a2e291 | ||
|
|
9976cb92a0 | ||
|
|
d900654c42 | ||
|
|
1d68b0448c | ||
|
|
65e3ec86b4 | ||
|
|
a7f205593a | ||
|
|
55f60a4ffc | ||
|
|
ca13b25240 | ||
|
|
b0c2734380 | ||
|
|
9e7b56f698 | ||
|
|
8c29e33e88 | ||
|
|
976217d6ec | ||
|
|
562eafab3a | ||
|
|
9015b95a72 | ||
|
|
7d4bbf46de |
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
[](https://github.com/actions/runner/actions)
|
[](https://github.com/actions/runner/actions)
|
||||||
|
|
||||||
The runner is the application that runs a job from a GitHub Actions workflow. The runner can run on the [hosted machine pools](https://github.com/actions/virtual-environments) or run on [self-hosted environments](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/about-self-hosted-runners).
|
The runner is the application that runs a job from a GitHub Actions workflow. It is used by GitHub Actions in the [hosted virtual environments](https://github.com/actions/virtual-environments), or you can [self-host the runner](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/about-self-hosted-runners) in your own environment.
|
||||||
|
|
||||||
## Get Started
|
## Get Started
|
||||||
|
|
||||||
|
|||||||
@@ -16,11 +16,32 @@ We don't want the workflow author to need to know how the internal workings of t
|
|||||||
|
|
||||||
A composite action is treated as **one** individual job step (this is known as encapsulation).
|
A composite action is treated as **one** individual job step (this is known as encapsulation).
|
||||||
|
|
||||||
|
|
||||||
## Decision
|
## Decision
|
||||||
|
|
||||||
**In this ADR, we only support running multiple run steps in an Action.** In doing so, we build in support for mapping and flowing the inputs, outputs, and env variables (ex: All nested steps should have access to its parents' input variables and nested steps can overwrite the input variables).
|
**In this ADR, we only support running multiple run steps in an Action.** In doing so, we build in support for mapping and flowing the inputs, outputs, and env variables (ex: All nested steps should have access to its parents' input variables and nested steps can overwrite the input variables).
|
||||||
|
|
||||||
|
### Composite Run Steps Features
|
||||||
|
This feature supports at the top action level:
|
||||||
|
- name
|
||||||
|
- description
|
||||||
|
- inputs
|
||||||
|
- runs
|
||||||
|
- outputs
|
||||||
|
|
||||||
|
This feature supports at the run step level:
|
||||||
|
- name
|
||||||
|
- id
|
||||||
|
- run
|
||||||
|
- env
|
||||||
|
- shell
|
||||||
|
- working-directory
|
||||||
|
|
||||||
|
This feature **does not support** at the run step level:
|
||||||
|
- timeout-minutes
|
||||||
|
- secrets
|
||||||
|
- conditionals (needs, if, etc.)
|
||||||
|
- continue-on-error
|
||||||
|
|
||||||
### Steps
|
### Steps
|
||||||
|
|
||||||
Example `workflow.yml`
|
Example `workflow.yml`
|
||||||
@@ -49,7 +70,9 @@ runs:
|
|||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- run: pip install -r requirements.txt
|
- run: pip install -r requirements.txt
|
||||||
|
shell: bash
|
||||||
- run: npm install
|
- run: npm install
|
||||||
|
shell: bash
|
||||||
```
|
```
|
||||||
|
|
||||||
Example Output
|
Example Output
|
||||||
@@ -63,6 +86,69 @@ echo hello world 4
|
|||||||
|
|
||||||
We add a token called "composite" which allows our Runner code to process composite actions. By invoking "using: composite", our Runner code then processes the "steps" attribute, converts this template code to a list of steps, and finally runs each run step sequentially. If any step fails and there are no `if` conditions defined, the whole composite action job fails.
|
We add a token called "composite" which allows our Runner code to process composite actions. By invoking "using: composite", our Runner code then processes the "steps" attribute, converts this template code to a list of steps, and finally runs each run step sequentially. If any step fails and there are no `if` conditions defined, the whole composite action job fails.
|
||||||
|
|
||||||
|
### Defaults
|
||||||
|
|
||||||
|
We will not support "defaults" in a composite action.
|
||||||
|
|
||||||
|
### Shell and Working-directory
|
||||||
|
|
||||||
|
For each run step in a composite action, the action author can set the `shell` and `working-directory` attributes for that step. The shell attribute is **required** for each run step because the action author does not know what the workflow author is using for the operating system so we need to explicitly prevent unknown behavior by making sure that each run step has an explicit shell **set by the action author.** On the other hand, `working-directory` is optional. Moreover, the composite action author can map in values from the `inputs` for it's `shell` and `working-directory` attributes at the step level for an action.
|
||||||
|
|
||||||
|
For example,
|
||||||
|
|
||||||
|
`action.yml`
|
||||||
|
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
inputs:
|
||||||
|
shell_1:
|
||||||
|
description: 'Your name'
|
||||||
|
default: 'pwsh'
|
||||||
|
steps:
|
||||||
|
- run: echo 1
|
||||||
|
shell: ${{ inputs.shell_1 }}
|
||||||
|
```
|
||||||
|
|
||||||
|
Note, the workflow file and action file are treated as separate entities. **So, the workflow `defaults` will never change the `shell` and `working-directory` value in the run steps in a composite action.** Note, `defaults` in a workflow only apply to run steps not "uses" steps (steps that use an action).
|
||||||
|
|
||||||
|
### Running Local Scripts
|
||||||
|
|
||||||
|
Example 'workflow.yml':
|
||||||
|
```yaml
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: self-hosted
|
||||||
|
steps:
|
||||||
|
- uses: user/composite@v1
|
||||||
|
```
|
||||||
|
|
||||||
|
Example `user/composite/action.yml`:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- run: chmod +x ${{ github.action_path }}/test/script2.sh
|
||||||
|
shell: bash
|
||||||
|
- run: chmod +x $GITHUB_ACTION_PATH/script.sh
|
||||||
|
shell: bash
|
||||||
|
- run: ${{ github.action_path }}/test/script2.sh
|
||||||
|
shell: bash
|
||||||
|
- run: $GITHUB_ACTION_PATH/script.sh
|
||||||
|
shell: bash
|
||||||
|
```
|
||||||
|
Where `user/composite` has the file structure:
|
||||||
|
```
|
||||||
|
.
|
||||||
|
+-- action.yml
|
||||||
|
+-- script.sh
|
||||||
|
+-- test
|
||||||
|
| +-- script2.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Users will be able to run scripts located in their action folder by first prepending the relative path and script name with `$GITHUB_ACTION_PATH` or `github.action_path` which contains the path in which the composite action is downloaded to and where those "files" live. Note, you'll have to use `chmod` before running each script if you do not git check in your script files into your github repo with the executable bit turned on.
|
||||||
|
|
||||||
### Inputs
|
### Inputs
|
||||||
|
|
||||||
Example `workflow.yml`:
|
Example `workflow.yml`:
|
||||||
@@ -86,6 +172,7 @@ runs:
|
|||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- run: echo hello ${{ inputs.your_name }}
|
- run: echo hello ${{ inputs.your_name }}
|
||||||
|
shell: bash
|
||||||
```
|
```
|
||||||
|
|
||||||
Example Output:
|
Example Output:
|
||||||
@@ -106,6 +193,7 @@ steps:
|
|||||||
- id: foo
|
- id: foo
|
||||||
uses: user/composite@v1
|
uses: user/composite@v1
|
||||||
- run: echo random-number ${{ steps.foo.outputs.random-number }}
|
- run: echo random-number ${{ steps.foo.outputs.random-number }}
|
||||||
|
shell: bash
|
||||||
```
|
```
|
||||||
|
|
||||||
Example `user/composite/action.yml`:
|
Example `user/composite/action.yml`:
|
||||||
@@ -119,7 +207,8 @@ runs:
|
|||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- id: random-number-generator
|
- id: random-number-generator
|
||||||
run: echo "::set-output name=random-number::$(echo $RANDOM)"
|
run: echo "::set-output name=random-id::$(echo $RANDOM)"
|
||||||
|
shell: bash
|
||||||
```
|
```
|
||||||
|
|
||||||
Example Output:
|
Example Output:
|
||||||
@@ -143,13 +232,17 @@ In the Composite Action, you'll only be able to use `::set-env::` to set environ
|
|||||||
|
|
||||||
### Secrets
|
### Secrets
|
||||||
|
|
||||||
**Note** : This feature will be focused on in a future ADR.
|
**We will not support "Secrets" in a composite action for now. This functionality will be focused on in a future ADR.**
|
||||||
|
|
||||||
We'll pass the secrets from the composite action's parents (ex: the workflow file) to the composite action. Secrets can be created in the composite action with the secrets context. In the actions yaml, we'll automatically mask the secret.
|
We'll pass the secrets from the composite action's parents (ex: the workflow file) to the composite action. Secrets can be created in the composite action with the secrets context. In the actions yaml, we'll automatically mask the secret.
|
||||||
|
|
||||||
|
|
||||||
### If Condition
|
### If Condition
|
||||||
|
|
||||||
|
** If and needs conditions will not be supported in the composite run steps feature. It will be supported later on in a new feature. **
|
||||||
|
|
||||||
|
Old reasoning:
|
||||||
|
|
||||||
Example `workflow.yml`:
|
Example `workflow.yml`:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
@@ -166,12 +259,18 @@ runs:
|
|||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- run: echo "just succeeding"
|
- run: echo "just succeeding"
|
||||||
|
shell: bash
|
||||||
- run: echo "I will run, as my current scope is succeeding"
|
- run: echo "I will run, as my current scope is succeeding"
|
||||||
|
shell: bash
|
||||||
if: success()
|
if: success()
|
||||||
- run: exit 1
|
- run: exit 1
|
||||||
|
shell: bash
|
||||||
- run: echo "I will not run, as my current scope is now failing"
|
- run: echo "I will not run, as my current scope is now failing"
|
||||||
|
shell: bash
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**We will not support "if Condition" in a composite action for now. This functionality will be focused on in a future ADR.**
|
||||||
|
|
||||||
See the paragraph below for a rudimentary approach (thank you to @cybojenix for the idea, example, and explanation for this approach):
|
See the paragraph below for a rudimentary approach (thank you to @cybojenix for the idea, example, and explanation for this approach):
|
||||||
|
|
||||||
The `if` statement in the parent (in the example above, this is the `workflow.yml`) shows whether or not we should run the composite action. So, our composite action will run since the `if` condition for running the composite action is `always()`.
|
The `if` statement in the parent (in the example above, this is the `workflow.yml`) shows whether or not we should run the composite action. So, our composite action will run since the `if` condition for running the composite action is `always()`.
|
||||||
@@ -203,13 +302,18 @@ runs:
|
|||||||
- id: foo1
|
- id: foo1
|
||||||
run: echo test 1
|
run: echo test 1
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
|
shell: bash
|
||||||
- id: foo2
|
- id: foo2
|
||||||
run: echo test 2
|
run: echo test 2
|
||||||
|
shell: bash
|
||||||
- id: foo3
|
- id: foo3
|
||||||
run: echo test 3
|
run: echo test 3
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
|
shell: bash
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**We will not support "timeout-minutes" in a composite action for now. This functionality will be focused on in a future ADR.**
|
||||||
|
|
||||||
A composite action in its entirety is a job. You can set both timeout-minutes for the whole composite action or its steps as long as the the sum of the `timeout-minutes` for each composite action step that has the attribute `timeout-minutes` is less than or equals to `timeout-minutes` for the composite action. There is no default timeout-minutes for each composite action step.
|
A composite action in its entirety is a job. You can set both timeout-minutes for the whole composite action or its steps as long as the the sum of the `timeout-minutes` for each composite action step that has the attribute `timeout-minutes` is less than or equals to `timeout-minutes` for the composite action. There is no default timeout-minutes for each composite action step.
|
||||||
|
|
||||||
If the time taken for any of the steps in combination or individually exceed the whole composite action `timeout-minutes` attribute, the whole job will fail (1). If an individual step exceeds its own `timeout-minutes` attribute but the total time that has been used including this step is below the overall composite action `timeout-minutes`, the individual step will fail but the rest of the steps will run based on their own `timeout-minutes` attribute (they will still abide by condition (1) though).
|
If the time taken for any of the steps in combination or individually exceed the whole composite action `timeout-minutes` attribute, the whole job will fail (1). If an individual step exceeds its own `timeout-minutes` attribute but the total time that has been used including this step is below the overall composite action `timeout-minutes`, the individual step will fail but the rest of the steps will run based on their own `timeout-minutes` attribute (they will still abide by condition (1) though).
|
||||||
@@ -243,36 +347,17 @@ runs:
|
|||||||
steps:
|
steps:
|
||||||
- run: exit 1
|
- run: exit 1
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
shell: bash
|
||||||
- run: echo "Hello World 2" <----- This step will run
|
- run: echo "Hello World 2" <----- This step will run
|
||||||
|
shell: bash
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**We will not support "continue-on-error" in a composite action for now. This functionality will be focused on in a future ADR.**
|
||||||
|
|
||||||
If any of the steps fail in the composite action and the `continue-on-error` is set to `false` for the whole composite action step in the workflow file, then the steps below it will run. On the flip side, if `continue-on-error` is set to `true` for the whole composite action step in the workflow file, the next job step will run.
|
If any of the steps fail in the composite action and the `continue-on-error` is set to `false` for the whole composite action step in the workflow file, then the steps below it will run. On the flip side, if `continue-on-error` is set to `true` for the whole composite action step in the workflow file, the next job step will run.
|
||||||
|
|
||||||
For the composite action steps, it follows the same logic as above. In this example, `"Hello World 2"` will be outputted because the previous step has `continue-on-error` set to `true` although that previous step errored.
|
For the composite action steps, it follows the same logic as above. In this example, `"Hello World 2"` will be outputted because the previous step has `continue-on-error` set to `true` although that previous step errored.
|
||||||
|
|
||||||
### Defaults
|
|
||||||
We will not support "defaults" in a composite action.
|
|
||||||
|
|
||||||
### Shell and Working-directory
|
|
||||||
For each run step in a composite action, the action author can set the `shell` and `working-directory` attributes for that step. These attributes are optional for each run step - by default, the `shell` is set to whatever default value is associated with the runner os (ex: bash =\> Mac). Moreover, the composite action author can map in values from the `inputs` for it's `shell` and `working-directory` attributes at the step level for an action.
|
|
||||||
|
|
||||||
For example,
|
|
||||||
|
|
||||||
`action.yml`
|
|
||||||
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
inputs:
|
|
||||||
shell_1:
|
|
||||||
description: 'Your name'
|
|
||||||
default: 'pwsh'
|
|
||||||
steps:
|
|
||||||
- run: echo 1
|
|
||||||
shell: ${{ inputs.shell_1 }}
|
|
||||||
```
|
|
||||||
|
|
||||||
Note, the workflow file and action file are treated as separate entities. **So, the workflow `defaults` will never change the `shell` and `working-directory` value in the run steps in a composite action.** Note, `defaults` in a workflow only apply to run steps not "uses" steps (steps that use an action).
|
|
||||||
|
|
||||||
### Visualizing Composite Action in the GitHub Actions UI
|
### Visualizing Composite Action in the GitHub Actions UI
|
||||||
We want all the composite action's steps to be condensed into the original composite action node.
|
We want all the composite action's steps to be condensed into the original composite action node.
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,11 @@
|
|||||||
## Features
|
## Features
|
||||||
- Composite Actions Support for Multiple Run Steps (#549, #557, #564, #568, #569, #578, #591, #599, #605, #609, #610, #615, #624)
|
- Allow registry credentials for job/service containers (#694)
|
||||||
- Prepare to switch GITHUB_ACTION to use ContextName instead of refname (#593)
|
|
||||||
- Fold logs for intermediate docker commands (#608)
|
|
||||||
- Add ability to register a runner to the non-default self-hosted runner group (#613)
|
|
||||||
|
|
||||||
## Bugs
|
## Bugs
|
||||||
- Double quotes around variable so CD works if path contains spaces (#602)
|
- N/A
|
||||||
- Bump lodash in /src/Misc/expressionFunc/hashFiles (#603)
|
|
||||||
- Fix poor performance of process spawned from svc daemon (#614)
|
|
||||||
## Misc
|
## Misc
|
||||||
- Move shared ExecutionContext properties under .Global (#594)
|
- N/A
|
||||||
|
|
||||||
## Windows x64
|
## Windows x64
|
||||||
We recommend configuring the runner in a root folder of the Windows drive (e.g. "C:\actions-runner"). This will help avoid issues related to service identity folder permissions and long file path restrictions on Windows.
|
We recommend configuring the runner in a root folder of the Windows drive (e.g. "C:\actions-runner"). This will help avoid issues related to service identity folder permissions and long file path restrictions on Windows.
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
<Update to ./src/runnerversion when creating release>
|
2.273.3
|
||||||
257
src/Misc/dotnet-install.ps1
vendored
257
src/Misc/dotnet-install.ps1
vendored
@@ -69,6 +69,8 @@
|
|||||||
.PARAMETER ProxyUseDefaultCredentials
|
.PARAMETER ProxyUseDefaultCredentials
|
||||||
Default: false
|
Default: false
|
||||||
Use default credentials, when using proxy address.
|
Use default credentials, when using proxy address.
|
||||||
|
.PARAMETER ProxyBypassList
|
||||||
|
If set with ProxyAddress, will provide the list of comma separated urls that will bypass the proxy
|
||||||
.PARAMETER SkipNonVersionedFiles
|
.PARAMETER SkipNonVersionedFiles
|
||||||
Default: false
|
Default: false
|
||||||
Skips installing non-versioned files if they already exist, such as dotnet.exe.
|
Skips installing non-versioned files if they already exist, such as dotnet.exe.
|
||||||
@@ -96,6 +98,7 @@ param(
|
|||||||
[string]$FeedCredential,
|
[string]$FeedCredential,
|
||||||
[string]$ProxyAddress,
|
[string]$ProxyAddress,
|
||||||
[switch]$ProxyUseDefaultCredentials,
|
[switch]$ProxyUseDefaultCredentials,
|
||||||
|
[string[]]$ProxyBypassList=@(),
|
||||||
[switch]$SkipNonVersionedFiles,
|
[switch]$SkipNonVersionedFiles,
|
||||||
[switch]$NoCdn
|
[switch]$NoCdn
|
||||||
)
|
)
|
||||||
@@ -119,11 +122,27 @@ $VersionRegEx="/\d+\.\d+[^/]+/"
|
|||||||
$OverrideNonVersionedFiles = !$SkipNonVersionedFiles
|
$OverrideNonVersionedFiles = !$SkipNonVersionedFiles
|
||||||
|
|
||||||
function Say($str) {
|
function Say($str) {
|
||||||
Write-Host "dotnet-install: $str"
|
try
|
||||||
|
{
|
||||||
|
Write-Host "dotnet-install: $str"
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
# Some platforms cannot utilize Write-Host (Azure Functions, for instance). Fall back to Write-Output
|
||||||
|
Write-Output "dotnet-install: $str"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function Say-Verbose($str) {
|
function Say-Verbose($str) {
|
||||||
Write-Verbose "dotnet-install: $str"
|
try
|
||||||
|
{
|
||||||
|
Write-Verbose "dotnet-install: $str"
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
# Some platforms cannot utilize Write-Verbose (Azure Functions, for instance). Fall back to Write-Output
|
||||||
|
Write-Output "dotnet-install: $str"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function Say-Invocation($Invocation) {
|
function Say-Invocation($Invocation) {
|
||||||
@@ -237,7 +256,11 @@ function GetHTTPResponse([Uri] $Uri)
|
|||||||
|
|
||||||
if($ProxyAddress) {
|
if($ProxyAddress) {
|
||||||
$HttpClientHandler = New-Object System.Net.Http.HttpClientHandler
|
$HttpClientHandler = New-Object System.Net.Http.HttpClientHandler
|
||||||
$HttpClientHandler.Proxy = New-Object System.Net.WebProxy -Property @{Address=$ProxyAddress;UseDefaultCredentials=$ProxyUseDefaultCredentials}
|
$HttpClientHandler.Proxy = New-Object System.Net.WebProxy -Property @{
|
||||||
|
Address=$ProxyAddress;
|
||||||
|
UseDefaultCredentials=$ProxyUseDefaultCredentials;
|
||||||
|
BypassList = $ProxyBypassList;
|
||||||
|
}
|
||||||
$HttpClient = New-Object System.Net.Http.HttpClient -ArgumentList $HttpClientHandler
|
$HttpClient = New-Object System.Net.Http.HttpClient -ArgumentList $HttpClientHandler
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -695,10 +718,10 @@ Say "Installation finished"
|
|||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
# SIG # Begin signature block
|
# SIG # Begin signature block
|
||||||
# MIIjhwYJKoZIhvcNAQcCoIIjeDCCI3QCAQExDzANBglghkgBZQMEAgEFADB5Bgor
|
# MIIjlgYJKoZIhvcNAQcCoIIjhzCCI4MCAQExDzANBglghkgBZQMEAgEFADB5Bgor
|
||||||
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
|
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
|
||||||
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCAiKYSY4KtkeThH
|
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCXdb9pJ+MI1iFd
|
||||||
# d5M1aXqv1K0/pff07QwfUbYZ/qX5LqCCDYUwggYDMIID66ADAgECAhMzAAABiK9S
|
# 2hUVOaNmZYt6e48+bQNJm9/Rbj3u3qCCDYUw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0Dp8c6ZZpCM/2pif93FSguRJuI57BlKcWOdeyFt
|
||||||
# lmqQeKZt0uGc+R38ONiU9MalCpaGpL2eGq4EQoO4tYCbIjggtSXlZOz39L9+Y1kl
|
# w5yjojz6f32WapB4pm3S4Zz5Hfw42JT0xqUKloakvZ4argRCg7i1gJsiOCC1JeVk
|
||||||
# D3ouOVd2onGqBooPiRa6YacRy5rYDkeagMXQzafQ732D8OE7cQnfXXSYIghh2rBQ
|
# 7Pf0v35jWSUPei45V3aicaoGig+JFrphpxHLmtgOR5qAxdDNp9DvfYPw4TtxCd9d
|
||||||
# Hm+98eEA3+cxB6STOvdlR3jo+KhIq/fecn5ha293qYHLpwmsObvsxsvYgrRyzR30
|
# dJgiCGHasFAeb73x4QDf5zEHpJM692VHeOj4qEir995yfmFrb3epgcunCaw5u+zG
|
||||||
# uIUBHoD7G4kqVDmyW9rIDVWZeodzOwjmmC3qjeAzLhIp9cAvVCch98isTtoouLGp
|
# y9iCtHLNHfS4hQEegPsbiSpUObJb2sgNVZl6h3M7COaYLeqN4DMuEin1wC9UJyH3
|
||||||
# 25ayp0Kiyc8ZQU3ghvkqmqMRZjDTu3QyS99je/WZii8bxyGvWbWu3EQ8l1Bx16HS
|
# yKxO2ii4sanblrKnQqLJzxlBTeCG+SqaoxFmMNO7dDJL32N79ZmKLxvHIa9Zta7c
|
||||||
# xVXjad5XwdHeMMD9zOZN+w2/XU/pnR4ZOC+8z1gFLu8NoFA12u8JJxzVs341Hgi6
|
# RDyXUHHXodLFVeNp3lfB0d4wwP3M5k37Db9dT+mdHhk4L7zPWAUu7w2gUDXa7wkn
|
||||||
# 2jbb01+P3nSISRKhggLLMIICNAIBATCB+KGB0KSBzTCByjELMAkGA1UEBhMCVVMx
|
# HNWzfjUeCLraNtvTX4/edIhJEqGCAtIwggI7AgEBMIH8oYHUpIHRMIHOMQswCQYD
|
||||||
# CzAJBgNVBAgTAldBMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb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nmA1
|
||||||
# SIG # End signature block
|
# SIG # End signature block
|
||||||
|
|||||||
@@ -56,6 +56,10 @@ namespace GitHub.Runner.Common
|
|||||||
Add<T>(extensions, "GitHub.Runner.Worker.EndGroupCommandExtension, Runner.Worker");
|
Add<T>(extensions, "GitHub.Runner.Worker.EndGroupCommandExtension, Runner.Worker");
|
||||||
Add<T>(extensions, "GitHub.Runner.Worker.EchoCommandExtension, Runner.Worker");
|
Add<T>(extensions, "GitHub.Runner.Worker.EchoCommandExtension, Runner.Worker");
|
||||||
break;
|
break;
|
||||||
|
case "GitHub.Runner.Worker.IFileCommandExtension":
|
||||||
|
Add<T>(extensions, "GitHub.Runner.Worker.AddPathFileCommand, Runner.Worker");
|
||||||
|
Add<T>(extensions, "GitHub.Runner.Worker.SetEnvFileCommand, Runner.Worker");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
// This should never happen.
|
// This should never happen.
|
||||||
throw new NotSupportedException($"Unexpected extension type: '{typeof(T).FullName}'");
|
throw new NotSupportedException($"Unexpected extension type: '{typeof(T).FullName}'");
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ namespace GitHub.Runner.Common
|
|||||||
// logging and console
|
// logging and console
|
||||||
Task<TaskLog> AppendLogContentAsync(Guid scopeIdentifier, string hubName, Guid planId, int logId, Stream uploadStream, CancellationToken cancellationToken);
|
Task<TaskLog> AppendLogContentAsync(Guid scopeIdentifier, string hubName, Guid planId, int logId, Stream uploadStream, CancellationToken cancellationToken);
|
||||||
Task AppendTimelineRecordFeedAsync(Guid scopeIdentifier, string hubName, Guid planId, Guid timelineId, Guid timelineRecordId, Guid stepId, IList<string> lines, CancellationToken cancellationToken);
|
Task AppendTimelineRecordFeedAsync(Guid scopeIdentifier, string hubName, Guid planId, Guid timelineId, Guid timelineRecordId, Guid stepId, IList<string> lines, CancellationToken cancellationToken);
|
||||||
|
Task AppendTimelineRecordFeedAsync(Guid scopeIdentifier, string hubName, Guid planId, Guid timelineId, Guid timelineRecordId, Guid stepId, IList<string> lines, long startLine, CancellationToken cancellationToken);
|
||||||
Task<TaskAttachment> CreateAttachmentAsync(Guid scopeIdentifier, string hubName, Guid planId, Guid timelineId, Guid timelineRecordId, String type, String name, Stream uploadStream, CancellationToken cancellationToken);
|
Task<TaskAttachment> CreateAttachmentAsync(Guid scopeIdentifier, string hubName, Guid planId, Guid timelineId, Guid timelineRecordId, String type, String name, Stream uploadStream, CancellationToken cancellationToken);
|
||||||
Task<TaskLog> CreateLogAsync(Guid scopeIdentifier, string hubName, Guid planId, TaskLog log, CancellationToken cancellationToken);
|
Task<TaskLog> CreateLogAsync(Guid scopeIdentifier, string hubName, Guid planId, TaskLog log, CancellationToken cancellationToken);
|
||||||
Task<Timeline> CreateTimelineAsync(Guid scopeIdentifier, string hubName, Guid planId, Guid timelineId, CancellationToken cancellationToken);
|
Task<Timeline> CreateTimelineAsync(Guid scopeIdentifier, string hubName, Guid planId, Guid timelineId, CancellationToken cancellationToken);
|
||||||
@@ -79,6 +80,12 @@ namespace GitHub.Runner.Common
|
|||||||
return _taskClient.AppendTimelineRecordFeedAsync(scopeIdentifier, hubName, planId, timelineId, timelineRecordId, stepId, lines, cancellationToken: cancellationToken);
|
return _taskClient.AppendTimelineRecordFeedAsync(scopeIdentifier, hubName, planId, timelineId, timelineRecordId, stepId, lines, cancellationToken: cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Task AppendTimelineRecordFeedAsync(Guid scopeIdentifier, string hubName, Guid planId, Guid timelineId, Guid timelineRecordId, Guid stepId, IList<string> lines, long startLine, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
CheckConnection();
|
||||||
|
return _taskClient.AppendTimelineRecordFeedAsync(scopeIdentifier, hubName, planId, timelineId, timelineRecordId, stepId, lines, startLine, cancellationToken: cancellationToken);
|
||||||
|
}
|
||||||
|
|
||||||
public Task<TaskAttachment> CreateAttachmentAsync(Guid scopeIdentifier, string hubName, Guid planId, Guid timelineId, Guid timelineRecordId, string type, string name, Stream uploadStream, CancellationToken cancellationToken)
|
public Task<TaskAttachment> CreateAttachmentAsync(Guid scopeIdentifier, string hubName, Guid planId, Guid timelineId, Guid timelineRecordId, string type, string name, Stream uploadStream, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
CheckConnection();
|
CheckConnection();
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ namespace GitHub.Runner.Common
|
|||||||
event EventHandler<ThrottlingEventArgs> JobServerQueueThrottling;
|
event EventHandler<ThrottlingEventArgs> JobServerQueueThrottling;
|
||||||
Task ShutdownAsync();
|
Task ShutdownAsync();
|
||||||
void Start(Pipelines.AgentJobRequestMessage jobRequest);
|
void Start(Pipelines.AgentJobRequestMessage jobRequest);
|
||||||
void QueueWebConsoleLine(Guid stepRecordId, string line);
|
void QueueWebConsoleLine(Guid stepRecordId, string line, long? lineNumber = null);
|
||||||
void QueueFileUpload(Guid timelineId, Guid timelineRecordId, string type, string name, string path, bool deleteSource);
|
void QueueFileUpload(Guid timelineId, Guid timelineRecordId, string type, string name, string path, bool deleteSource);
|
||||||
void QueueTimelineRecordUpdate(Guid timelineId, TimelineRecord timelineRecord);
|
void QueueTimelineRecordUpdate(Guid timelineId, TimelineRecord timelineRecord);
|
||||||
}
|
}
|
||||||
@@ -155,10 +155,10 @@ namespace GitHub.Runner.Common
|
|||||||
Trace.Info("All queue process tasks have been stopped, and all queues are drained.");
|
Trace.Info("All queue process tasks have been stopped, and all queues are drained.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void QueueWebConsoleLine(Guid stepRecordId, string line)
|
public void QueueWebConsoleLine(Guid stepRecordId, string line, long? lineNumber)
|
||||||
{
|
{
|
||||||
Trace.Verbose("Enqueue web console line queue: {0}", line);
|
Trace.Verbose("Enqueue web console line queue: {0}", line);
|
||||||
_webConsoleLineQueue.Enqueue(new ConsoleLineInfo(stepRecordId, line));
|
_webConsoleLineQueue.Enqueue(new ConsoleLineInfo(stepRecordId, line, lineNumber));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void QueueFileUpload(Guid timelineId, Guid timelineRecordId, string type, string name, string path, bool deleteSource)
|
public void QueueFileUpload(Guid timelineId, Guid timelineRecordId, string type, string name, string path, bool deleteSource)
|
||||||
@@ -214,7 +214,7 @@ namespace GitHub.Runner.Common
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Group consolelines by timeline record of each step
|
// Group consolelines by timeline record of each step
|
||||||
Dictionary<Guid, List<string>> stepsConsoleLines = new Dictionary<Guid, List<string>>();
|
Dictionary<Guid, List<TimelineRecordLogLine>> stepsConsoleLines = new Dictionary<Guid, List<TimelineRecordLogLine>>();
|
||||||
List<Guid> stepRecordIds = new List<Guid>(); // We need to keep lines in order
|
List<Guid> stepRecordIds = new List<Guid>(); // We need to keep lines in order
|
||||||
int linesCounter = 0;
|
int linesCounter = 0;
|
||||||
ConsoleLineInfo lineInfo;
|
ConsoleLineInfo lineInfo;
|
||||||
@@ -222,7 +222,7 @@ namespace GitHub.Runner.Common
|
|||||||
{
|
{
|
||||||
if (!stepsConsoleLines.ContainsKey(lineInfo.StepRecordId))
|
if (!stepsConsoleLines.ContainsKey(lineInfo.StepRecordId))
|
||||||
{
|
{
|
||||||
stepsConsoleLines[lineInfo.StepRecordId] = new List<string>();
|
stepsConsoleLines[lineInfo.StepRecordId] = new List<TimelineRecordLogLine>();
|
||||||
stepRecordIds.Add(lineInfo.StepRecordId);
|
stepRecordIds.Add(lineInfo.StepRecordId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -232,7 +232,7 @@ namespace GitHub.Runner.Common
|
|||||||
lineInfo.Line = $"{lineInfo.Line.Substring(0, 1024)}...";
|
lineInfo.Line = $"{lineInfo.Line.Substring(0, 1024)}...";
|
||||||
}
|
}
|
||||||
|
|
||||||
stepsConsoleLines[lineInfo.StepRecordId].Add(lineInfo.Line);
|
stepsConsoleLines[lineInfo.StepRecordId].Add(new TimelineRecordLogLine(lineInfo.Line, lineInfo.LineNumber));
|
||||||
linesCounter++;
|
linesCounter++;
|
||||||
|
|
||||||
// process at most about 500 lines of web console line during regular timer dequeue task.
|
// process at most about 500 lines of web console line during regular timer dequeue task.
|
||||||
@@ -247,13 +247,13 @@ namespace GitHub.Runner.Common
|
|||||||
{
|
{
|
||||||
// Split consolelines into batch, each batch will container at most 100 lines.
|
// Split consolelines into batch, each batch will container at most 100 lines.
|
||||||
int batchCounter = 0;
|
int batchCounter = 0;
|
||||||
List<List<string>> batchedLines = new List<List<string>>();
|
List<List<TimelineRecordLogLine>> batchedLines = new List<List<TimelineRecordLogLine>>();
|
||||||
foreach (var line in stepsConsoleLines[stepRecordId])
|
foreach (var line in stepsConsoleLines[stepRecordId])
|
||||||
{
|
{
|
||||||
var currentBatch = batchedLines.ElementAtOrDefault(batchCounter);
|
var currentBatch = batchedLines.ElementAtOrDefault(batchCounter);
|
||||||
if (currentBatch == null)
|
if (currentBatch == null)
|
||||||
{
|
{
|
||||||
batchedLines.Add(new List<string>());
|
batchedLines.Add(new List<TimelineRecordLogLine>());
|
||||||
currentBatch = batchedLines.ElementAt(batchCounter);
|
currentBatch = batchedLines.ElementAt(batchCounter);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -275,7 +275,6 @@ namespace GitHub.Runner.Common
|
|||||||
{
|
{
|
||||||
Trace.Info($"Skip {batchedLines.Count - 2} batches web console lines for last run");
|
Trace.Info($"Skip {batchedLines.Count - 2} batches web console lines for last run");
|
||||||
batchedLines = batchedLines.TakeLast(2).ToList();
|
batchedLines = batchedLines.TakeLast(2).ToList();
|
||||||
batchedLines[0].Insert(0, "...");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int errorCount = 0;
|
int errorCount = 0;
|
||||||
@@ -284,7 +283,15 @@ namespace GitHub.Runner.Common
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
// we will not requeue failed batch, since the web console lines are time sensitive.
|
// we will not requeue failed batch, since the web console lines are time sensitive.
|
||||||
await _jobServer.AppendTimelineRecordFeedAsync(_scopeIdentifier, _hubName, _planId, _jobTimelineId, _jobTimelineRecordId, stepRecordId, batch, default(CancellationToken));
|
if (batch[0].LineNumber.HasValue)
|
||||||
|
{
|
||||||
|
await _jobServer.AppendTimelineRecordFeedAsync(_scopeIdentifier, _hubName, _planId, _jobTimelineId, _jobTimelineRecordId, stepRecordId, batch.Select(logLine => logLine.Line).ToList(), batch[0].LineNumber.Value, default(CancellationToken));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
await _jobServer.AppendTimelineRecordFeedAsync(_scopeIdentifier, _hubName, _planId, _jobTimelineId, _jobTimelineRecordId, stepRecordId, batch.Select(logLine => logLine.Line).ToList(), default(CancellationToken));
|
||||||
|
}
|
||||||
|
|
||||||
if (_firstConsoleOutputs)
|
if (_firstConsoleOutputs)
|
||||||
{
|
{
|
||||||
HostContext.WritePerfCounter($"WorkerJobServerQueueAppendFirstConsoleOutput_{_planId.ToString()}");
|
HostContext.WritePerfCounter($"WorkerJobServerQueueAppendFirstConsoleOutput_{_planId.ToString()}");
|
||||||
@@ -653,13 +660,15 @@ namespace GitHub.Runner.Common
|
|||||||
|
|
||||||
internal class ConsoleLineInfo
|
internal class ConsoleLineInfo
|
||||||
{
|
{
|
||||||
public ConsoleLineInfo(Guid recordId, string line)
|
public ConsoleLineInfo(Guid recordId, string line, long? lineNumber)
|
||||||
{
|
{
|
||||||
this.StepRecordId = recordId;
|
this.StepRecordId = recordId;
|
||||||
this.Line = line;
|
this.Line = line;
|
||||||
|
this.LineNumber = lineNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Guid StepRecordId { get; set; }
|
public Guid StepRecordId { get; set; }
|
||||||
public string Line { get; set; }
|
public string Line { get; set; }
|
||||||
|
public long? LineNumber { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -492,7 +492,7 @@ namespace GitHub.Runner.Worker
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
executionContext.Output("##[endgroup");
|
executionContext.Output("##[endgroup]");
|
||||||
|
|
||||||
if (retryCount == 3 && pullExitCode != 0)
|
if (retryCount == 3 && pullExitCode != 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -145,6 +145,10 @@ namespace GitHub.Runner.Worker
|
|||||||
stepHost = containerStepHost;
|
stepHost = containerStepHost;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Setup File Command Manager
|
||||||
|
var fileCommandManager = HostContext.CreateService<IFileCommandManager>();
|
||||||
|
fileCommandManager.InitializeFiles(ExecutionContext, null);
|
||||||
|
|
||||||
// Load the inputs.
|
// Load the inputs.
|
||||||
ExecutionContext.Debug("Loading inputs");
|
ExecutionContext.Debug("Loading inputs");
|
||||||
var templateEvaluator = ExecutionContext.ToPipelineTemplateEvaluator();
|
var templateEvaluator = ExecutionContext.ToPipelineTemplateEvaluator();
|
||||||
@@ -238,7 +242,15 @@ namespace GitHub.Runner.Worker
|
|||||||
handler.PrintActionDetails(Stage);
|
handler.PrintActionDetails(Stage);
|
||||||
|
|
||||||
// Run the task.
|
// Run the task.
|
||||||
await handler.RunAsync(Stage);
|
try
|
||||||
|
{
|
||||||
|
await handler.RunAsync(Stage);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
fileCommandManager.ProcessFiles(ExecutionContext, ExecutionContext.Global.Container);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool TryEvaluateDisplayName(DictionaryContextData contextData, IExecutionContext context)
|
public bool TryEvaluateDisplayName(DictionaryContextData contextData, IExecutionContext context)
|
||||||
|
|||||||
@@ -260,7 +260,7 @@ namespace GitHub.Runner.Worker
|
|||||||
DictionaryContextData inputsData,
|
DictionaryContextData inputsData,
|
||||||
Dictionary<string, string> envData)
|
Dictionary<string, string> envData)
|
||||||
{
|
{
|
||||||
step.ExecutionContext = Root.CreateChild(_record.Id, step.DisplayName, _record.Id.ToString("N"), scopeName, step.Action.ContextName, logger: _logger, insideComposite: true, cancellationTokenSource: CancellationTokenSource.CreateLinkedTokenSource(_cancellationTokenSource.Token));
|
step.ExecutionContext = Root.CreateChild(_record.Id, _record.Name, _record.Id.ToString("N"), scopeName, step.Action.ContextName, logger: _logger, insideComposite: true, cancellationTokenSource: CancellationTokenSource.CreateLinkedTokenSource(_cancellationTokenSource.Token));
|
||||||
step.ExecutionContext.ExpressionValues["inputs"] = inputsData;
|
step.ExecutionContext.ExpressionValues["inputs"] = inputsData;
|
||||||
step.ExecutionContext.ExpressionValues["steps"] = Global.StepsContext.GetScope(step.ExecutionContext.GetFullyQualifiedContextName());
|
step.ExecutionContext.ExpressionValues["steps"] = Global.StepsContext.GetScope(step.ExecutionContext.GetFullyQualifiedContextName());
|
||||||
|
|
||||||
@@ -384,8 +384,8 @@ namespace GitHub.Runner.Worker
|
|||||||
|
|
||||||
_logger.End();
|
_logger.End();
|
||||||
|
|
||||||
// todo: Skip if generated context name. After M271-ish the server will never send an empty context name. Generated context names will start with "__"
|
// Skip if generated context name. Generated context names start with "__". After M271-ish the server will never send an empty context name.
|
||||||
if (!string.IsNullOrEmpty(ContextName))
|
if (!string.IsNullOrEmpty(ContextName) && !ContextName.StartsWith("__", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
Global.StepsContext.SetOutcome(ScopeName, ContextName, (Outcome ?? Result ?? TaskResult.Succeeded).ToActionResult());
|
Global.StepsContext.SetOutcome(ScopeName, ContextName, (Outcome ?? Result ?? TaskResult.Succeeded).ToActionResult());
|
||||||
Global.StepsContext.SetConclusion(ScopeName, ContextName, (Result ?? TaskResult.Succeeded).ToActionResult());
|
Global.StepsContext.SetConclusion(ScopeName, ContextName, (Result ?? TaskResult.Succeeded).ToActionResult());
|
||||||
@@ -447,8 +447,8 @@ namespace GitHub.Runner.Worker
|
|||||||
{
|
{
|
||||||
ArgUtil.NotNullOrEmpty(name, nameof(name));
|
ArgUtil.NotNullOrEmpty(name, nameof(name));
|
||||||
|
|
||||||
// todo: Skip if generated context name. After M271-ish the server will never send an empty context name. Generated context names will start with "__"
|
// Skip if generated context name. Generated context names start with "__". After M271-ish the server will never send an empty context name.
|
||||||
if (string.IsNullOrEmpty(ContextName))
|
if (string.IsNullOrEmpty(ContextName) || ContextName.StartsWith("__", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
reference = null;
|
reference = null;
|
||||||
return;
|
return;
|
||||||
@@ -717,7 +717,8 @@ namespace GitHub.Runner.Worker
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_jobServerQueue.QueueWebConsoleLine(_record.Id, msg);
|
_jobServerQueue.QueueWebConsoleLine(_record.Id, msg, totalLines);
|
||||||
|
|
||||||
return totalLines;
|
return totalLines;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
262
src/Runner.Worker/FileCommandManager.cs
Normal file
262
src/Runner.Worker/FileCommandManager.cs
Normal file
@@ -0,0 +1,262 @@
|
|||||||
|
using GitHub.DistributedTask.WebApi;
|
||||||
|
using GitHub.Runner.Worker.Container;
|
||||||
|
using GitHub.Runner.Common;
|
||||||
|
using GitHub.Runner.Sdk;
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace GitHub.Runner.Worker
|
||||||
|
{
|
||||||
|
[ServiceLocator(Default = typeof(FileCommandManager))]
|
||||||
|
public interface IFileCommandManager : IRunnerService
|
||||||
|
{
|
||||||
|
void InitializeFiles(IExecutionContext context, ContainerInfo container);
|
||||||
|
void ProcessFiles(IExecutionContext context, ContainerInfo container);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public sealed class FileCommandManager : RunnerService, IFileCommandManager
|
||||||
|
{
|
||||||
|
private const string _folderName = "_runner_file_commands";
|
||||||
|
private List<IFileCommandExtension> _commandExtensions;
|
||||||
|
private string _fileSuffix = String.Empty;
|
||||||
|
private string _fileCommandDirectory;
|
||||||
|
private Tracing _trace;
|
||||||
|
|
||||||
|
public override void Initialize(IHostContext hostContext)
|
||||||
|
{
|
||||||
|
base.Initialize(hostContext);
|
||||||
|
_trace = HostContext.GetTrace(nameof(FileCommandManager));
|
||||||
|
|
||||||
|
_fileCommandDirectory = Path.Combine(HostContext.GetDirectory(WellKnownDirectory.Temp), _folderName);
|
||||||
|
if (!Directory.Exists(_fileCommandDirectory))
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(_fileCommandDirectory);
|
||||||
|
}
|
||||||
|
|
||||||
|
var extensionManager = hostContext.GetService<IExtensionManager>();
|
||||||
|
_commandExtensions = extensionManager.GetExtensions<IFileCommandExtension>() ?? new List<IFileCommandExtension>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void InitializeFiles(IExecutionContext context, ContainerInfo container)
|
||||||
|
{
|
||||||
|
var oldSuffix = _fileSuffix;
|
||||||
|
_fileSuffix = Guid.NewGuid().ToString();
|
||||||
|
foreach (var fileCommand in _commandExtensions)
|
||||||
|
{
|
||||||
|
var oldPath = Path.Combine(_fileCommandDirectory, fileCommand.FilePrefix + oldSuffix);
|
||||||
|
if (oldSuffix != String.Empty && File.Exists(oldPath))
|
||||||
|
{
|
||||||
|
TryDeleteFile(oldPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
var newPath = Path.Combine(_fileCommandDirectory, fileCommand.FilePrefix + _fileSuffix);
|
||||||
|
TryDeleteFile(newPath);
|
||||||
|
File.Create(newPath).Dispose();
|
||||||
|
|
||||||
|
var pathToSet = container != null ? container.TranslateToContainerPath(newPath) : newPath;
|
||||||
|
context.SetGitHubContext(fileCommand.ContextName, pathToSet);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ProcessFiles(IExecutionContext context, ContainerInfo container)
|
||||||
|
{
|
||||||
|
foreach (var fileCommand in _commandExtensions)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
fileCommand.ProcessCommand(context, Path.Combine(_fileCommandDirectory, fileCommand.FilePrefix + _fileSuffix),container);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
context.Error($"Unable to process file command '{fileCommand.ContextName}' successfully.");
|
||||||
|
context.Error(ex);
|
||||||
|
context.CommandResult = TaskResult.Failed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool TryDeleteFile(string path)
|
||||||
|
{
|
||||||
|
if (!File.Exists(path))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
File.Delete(path);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
_trace.Warning($"Unable to delete file {path} for reason: {e.ToString()}");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IFileCommandExtension : IExtension
|
||||||
|
{
|
||||||
|
string ContextName { get; }
|
||||||
|
string FilePrefix { get; }
|
||||||
|
|
||||||
|
void ProcessCommand(IExecutionContext context, string filePath, ContainerInfo container);
|
||||||
|
}
|
||||||
|
|
||||||
|
public sealed class AddPathFileCommand : RunnerService, IFileCommandExtension
|
||||||
|
{
|
||||||
|
public string ContextName => "path";
|
||||||
|
public string FilePrefix => "add_path_";
|
||||||
|
|
||||||
|
public Type ExtensionType => typeof(IFileCommandExtension);
|
||||||
|
|
||||||
|
public void ProcessCommand(IExecutionContext context, string filePath, ContainerInfo container)
|
||||||
|
{
|
||||||
|
if (File.Exists(filePath))
|
||||||
|
{
|
||||||
|
var lines = File.ReadAllLines(filePath, Encoding.UTF8);
|
||||||
|
foreach(var line in lines)
|
||||||
|
{
|
||||||
|
if (line == string.Empty)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
context.Global.PrependPath.RemoveAll(x => string.Equals(x, line, StringComparison.CurrentCulture));
|
||||||
|
context.Global.PrependPath.Add(line);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public sealed class SetEnvFileCommand : RunnerService, IFileCommandExtension
|
||||||
|
{
|
||||||
|
public string ContextName => "env";
|
||||||
|
public string FilePrefix => "set_env_";
|
||||||
|
|
||||||
|
public Type ExtensionType => typeof(IFileCommandExtension);
|
||||||
|
|
||||||
|
public void ProcessCommand(IExecutionContext context, string filePath, ContainerInfo container)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var text = File.ReadAllText(filePath) ?? string.Empty;
|
||||||
|
var index = 0;
|
||||||
|
var line = ReadLine(text, ref index);
|
||||||
|
while (line != null)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(line))
|
||||||
|
{
|
||||||
|
var equalsIndex = line.IndexOf("=", StringComparison.Ordinal);
|
||||||
|
var heredocIndex = line.IndexOf("<<", StringComparison.Ordinal);
|
||||||
|
|
||||||
|
// Normal style NAME=VALUE
|
||||||
|
if (equalsIndex >= 0 && (heredocIndex < 0 || equalsIndex < heredocIndex))
|
||||||
|
{
|
||||||
|
var split = line.Split(new[] { '=' }, 2, StringSplitOptions.None);
|
||||||
|
if (string.IsNullOrEmpty(line))
|
||||||
|
{
|
||||||
|
throw new Exception($"Invalid environment variable format '{line}'. Environment variable name must not be empty");
|
||||||
|
}
|
||||||
|
SetEnvironmentVariable(context, split[0], split[1]);
|
||||||
|
}
|
||||||
|
// Heredoc style NAME<<EOF
|
||||||
|
else if (heredocIndex >= 0 && (equalsIndex < 0 || heredocIndex < equalsIndex))
|
||||||
|
{
|
||||||
|
var split = line.Split(new[] { "<<" }, 2, StringSplitOptions.None);
|
||||||
|
if (string.IsNullOrEmpty(split[0]) || string.IsNullOrEmpty(split[1]))
|
||||||
|
{
|
||||||
|
throw new Exception($"Invalid environment variable format '{line}'. Environment variable name must not be empty and delimiter must not be empty");
|
||||||
|
}
|
||||||
|
var name = split[0];
|
||||||
|
var delimiter = split[1];
|
||||||
|
var startIndex = index; // Start index of the value (inclusive)
|
||||||
|
var endIndex = index; // End index of the value (exclusive)
|
||||||
|
var tempLine = ReadLine(text, ref index, out var newline);
|
||||||
|
while (!string.Equals(tempLine, delimiter, StringComparison.Ordinal))
|
||||||
|
{
|
||||||
|
if (tempLine == null)
|
||||||
|
{
|
||||||
|
throw new Exception($"Invalid environment variable value. Matching delimiter not found '{delimiter}'");
|
||||||
|
}
|
||||||
|
endIndex = index - newline.Length;
|
||||||
|
tempLine = ReadLine(text, ref index, out newline);
|
||||||
|
}
|
||||||
|
|
||||||
|
var value = endIndex > startIndex ? text.Substring(startIndex, endIndex - startIndex) : string.Empty;
|
||||||
|
SetEnvironmentVariable(context, name, value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new Exception($"Invalid environment variable format '{line}'");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
line = ReadLine(text, ref index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (DirectoryNotFoundException)
|
||||||
|
{
|
||||||
|
context.Debug($"Environment variables file does not exist '{filePath}'");
|
||||||
|
}
|
||||||
|
catch (FileNotFoundException)
|
||||||
|
{
|
||||||
|
context.Debug($"Environment variables file does not exist '{filePath}'");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void SetEnvironmentVariable(
|
||||||
|
IExecutionContext context,
|
||||||
|
string name,
|
||||||
|
string value)
|
||||||
|
{
|
||||||
|
context.Global.EnvironmentVariables[name] = value;
|
||||||
|
context.SetEnvContext(name, value);
|
||||||
|
context.Debug($"{name}='{value}'");
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string ReadLine(
|
||||||
|
string text,
|
||||||
|
ref int index)
|
||||||
|
{
|
||||||
|
return ReadLine(text, ref index, out _);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string ReadLine(
|
||||||
|
string text,
|
||||||
|
ref int index,
|
||||||
|
out string newline)
|
||||||
|
{
|
||||||
|
if (index >= text.Length)
|
||||||
|
{
|
||||||
|
newline = null;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var originalIndex = index;
|
||||||
|
var lfIndex = text.IndexOf("\n", index, StringComparison.Ordinal);
|
||||||
|
if (lfIndex < 0)
|
||||||
|
{
|
||||||
|
index = text.Length;
|
||||||
|
newline = null;
|
||||||
|
return text.Substring(originalIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if OS_WINDOWS
|
||||||
|
var crLFIndex = text.IndexOf("\r\n", index, StringComparison.Ordinal);
|
||||||
|
if (crLFIndex >= 0 && crLFIndex < lfIndex)
|
||||||
|
{
|
||||||
|
index = crLFIndex + 2; // Skip over CRLF
|
||||||
|
newline = "\r\n";
|
||||||
|
return text.Substring(originalIndex, crLFIndex - originalIndex);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
index = lfIndex + 1; // Skip over LF
|
||||||
|
newline = "\n";
|
||||||
|
return text.Substring(originalIndex, lfIndex - originalIndex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,18 +6,20 @@ namespace GitHub.Runner.Worker
|
|||||||
{
|
{
|
||||||
public sealed class GitHubContext : DictionaryContextData, IEnvironmentContextData
|
public sealed class GitHubContext : DictionaryContextData, IEnvironmentContextData
|
||||||
{
|
{
|
||||||
private readonly HashSet<string> _contextEnvWhitelist = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
|
private readonly HashSet<string> _contextEnvAllowlist = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
|
||||||
{
|
{
|
||||||
"action",
|
"action",
|
||||||
"action_path",
|
"action_path",
|
||||||
"actor",
|
"actor",
|
||||||
"api_url",
|
"api_url",
|
||||||
"base_ref",
|
"base_ref",
|
||||||
|
"env",
|
||||||
"event_name",
|
"event_name",
|
||||||
"event_path",
|
"event_path",
|
||||||
"graphql_url",
|
"graphql_url",
|
||||||
"head_ref",
|
"head_ref",
|
||||||
"job",
|
"job",
|
||||||
|
"path",
|
||||||
"ref",
|
"ref",
|
||||||
"repository",
|
"repository",
|
||||||
"repository_owner",
|
"repository_owner",
|
||||||
@@ -33,11 +35,23 @@ namespace GitHub.Runner.Worker
|
|||||||
{
|
{
|
||||||
foreach (var data in this)
|
foreach (var data in this)
|
||||||
{
|
{
|
||||||
if (_contextEnvWhitelist.Contains(data.Key) && data.Value is StringContextData value)
|
if (_contextEnvAllowlist.Contains(data.Key) && data.Value is StringContextData value)
|
||||||
{
|
{
|
||||||
yield return new KeyValuePair<string, string>($"GITHUB_{data.Key.ToUpperInvariant()}", value);
|
yield return new KeyValuePair<string, string>($"GITHUB_{data.Key.ToUpperInvariant()}", value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public GitHubContext ShallowCopy()
|
||||||
|
{
|
||||||
|
var copy = new GitHubContext();
|
||||||
|
|
||||||
|
foreach (var pair in this)
|
||||||
|
{
|
||||||
|
copy[pair.Key] = pair.Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return copy;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -32,9 +32,6 @@ namespace GitHub.Runner.Worker.Handlers
|
|||||||
ArgUtil.NotNull(Inputs, nameof(Inputs));
|
ArgUtil.NotNull(Inputs, nameof(Inputs));
|
||||||
ArgUtil.NotNull(Data.Steps, nameof(Data.Steps));
|
ArgUtil.NotNull(Data.Steps, nameof(Data.Steps));
|
||||||
|
|
||||||
var githubContext = ExecutionContext.ExpressionValues["github"] as GitHubContext;
|
|
||||||
ArgUtil.NotNull(githubContext, nameof(githubContext));
|
|
||||||
|
|
||||||
// Resolve action steps
|
// Resolve action steps
|
||||||
var actionSteps = Data.Steps;
|
var actionSteps = Data.Steps;
|
||||||
|
|
||||||
@@ -56,14 +53,6 @@ namespace GitHub.Runner.Worker.Handlers
|
|||||||
childScopeName = $"__{Guid.NewGuid()}";
|
childScopeName = $"__{Guid.NewGuid()}";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy the github context so that we don't modify the original pointer
|
|
||||||
// We can't use PipelineContextData.Clone() since that creates a null pointer exception for copying a GitHubContext
|
|
||||||
var compositeGitHubContext = new GitHubContext();
|
|
||||||
foreach (var pair in githubContext)
|
|
||||||
{
|
|
||||||
compositeGitHubContext[pair.Key] = pair.Value;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (Pipelines.ActionStep actionStep in actionSteps)
|
foreach (Pipelines.ActionStep actionStep in actionSteps)
|
||||||
{
|
{
|
||||||
var actionRunner = HostContext.CreateService<IActionRunner>();
|
var actionRunner = HostContext.CreateService<IActionRunner>();
|
||||||
@@ -73,8 +62,13 @@ namespace GitHub.Runner.Worker.Handlers
|
|||||||
|
|
||||||
var step = ExecutionContext.CreateCompositeStep(childScopeName, actionRunner, inputsData, Environment);
|
var step = ExecutionContext.CreateCompositeStep(childScopeName, actionRunner, inputsData, Environment);
|
||||||
|
|
||||||
|
// Shallow copy github context
|
||||||
|
var gitHubContext = step.ExecutionContext.ExpressionValues["github"] as GitHubContext;
|
||||||
|
ArgUtil.NotNull(gitHubContext, nameof(gitHubContext));
|
||||||
|
gitHubContext = gitHubContext.ShallowCopy();
|
||||||
|
step.ExecutionContext.ExpressionValues["github"] = gitHubContext;
|
||||||
|
|
||||||
// Set GITHUB_ACTION_PATH
|
// Set GITHUB_ACTION_PATH
|
||||||
step.ExecutionContext.ExpressionValues["github"] = compositeGitHubContext;
|
|
||||||
step.ExecutionContext.SetGitHubContext("action_path", ActionDirectory);
|
step.ExecutionContext.SetGitHubContext("action_path", ActionDirectory);
|
||||||
|
|
||||||
compositeSteps.Add(step);
|
compositeSteps.Add(step);
|
||||||
@@ -90,6 +84,8 @@ namespace GitHub.Runner.Worker.Handlers
|
|||||||
ExecutionContext.ExpressionValues["steps"] = ExecutionContext.Global.StepsContext.GetScope(ExecutionContext.GetFullyQualifiedContextName());
|
ExecutionContext.ExpressionValues["steps"] = ExecutionContext.Global.StepsContext.GetScope(ExecutionContext.GetFullyQualifiedContextName());
|
||||||
|
|
||||||
ProcessCompositeActionOutputs();
|
ProcessCompositeActionOutputs();
|
||||||
|
|
||||||
|
ExecutionContext.Global.StepsContext.ClearScope(childScopeName);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -135,12 +131,19 @@ namespace GitHub.Runner.Worker.Handlers
|
|||||||
var outputsName = pair.Key;
|
var outputsName = pair.Key;
|
||||||
var outputsAttributes = pair.Value as DictionaryContextData;
|
var outputsAttributes = pair.Value as DictionaryContextData;
|
||||||
outputsAttributes.TryGetValue("value", out var val);
|
outputsAttributes.TryGetValue("value", out var val);
|
||||||
var outputsValue = val as StringContextData;
|
|
||||||
|
|
||||||
// Set output in the whole composite scope.
|
if (val != null)
|
||||||
if (!String.IsNullOrEmpty(outputsName) && !String.IsNullOrEmpty(outputsValue))
|
|
||||||
{
|
{
|
||||||
ExecutionContext.SetOutput(outputsName, outputsValue, out _);
|
var outputsValue = val as StringContextData;
|
||||||
|
// Set output in the whole composite scope.
|
||||||
|
if (!String.IsNullOrEmpty(outputsValue))
|
||||||
|
{
|
||||||
|
ExecutionContext.SetOutput(outputsName, outputsValue, out _);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ExecutionContext.SetOutput(outputsName, "", out _);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -161,16 +161,21 @@ namespace GitHub.Runner.Worker.Handlers
|
|||||||
Directory.CreateDirectory(tempHomeDirectory);
|
Directory.CreateDirectory(tempHomeDirectory);
|
||||||
this.Environment["HOME"] = tempHomeDirectory;
|
this.Environment["HOME"] = tempHomeDirectory;
|
||||||
|
|
||||||
|
var tempFileCommandDirectory = Path.Combine(tempDirectory, "_runner_file_commands");
|
||||||
|
ArgUtil.Directory(tempFileCommandDirectory, nameof(tempFileCommandDirectory));
|
||||||
|
|
||||||
var tempWorkflowDirectory = Path.Combine(tempDirectory, "_github_workflow");
|
var tempWorkflowDirectory = Path.Combine(tempDirectory, "_github_workflow");
|
||||||
ArgUtil.Directory(tempWorkflowDirectory, nameof(tempWorkflowDirectory));
|
ArgUtil.Directory(tempWorkflowDirectory, nameof(tempWorkflowDirectory));
|
||||||
|
|
||||||
container.MountVolumes.Add(new MountVolume("/var/run/docker.sock", "/var/run/docker.sock"));
|
container.MountVolumes.Add(new MountVolume("/var/run/docker.sock", "/var/run/docker.sock"));
|
||||||
container.MountVolumes.Add(new MountVolume(tempHomeDirectory, "/github/home"));
|
container.MountVolumes.Add(new MountVolume(tempHomeDirectory, "/github/home"));
|
||||||
container.MountVolumes.Add(new MountVolume(tempWorkflowDirectory, "/github/workflow"));
|
container.MountVolumes.Add(new MountVolume(tempWorkflowDirectory, "/github/workflow"));
|
||||||
|
container.MountVolumes.Add(new MountVolume(tempFileCommandDirectory, "/github/file_commands"));
|
||||||
container.MountVolumes.Add(new MountVolume(defaultWorkingDirectory, "/github/workspace"));
|
container.MountVolumes.Add(new MountVolume(defaultWorkingDirectory, "/github/workspace"));
|
||||||
|
|
||||||
container.AddPathTranslateMapping(tempHomeDirectory, "/github/home");
|
container.AddPathTranslateMapping(tempHomeDirectory, "/github/home");
|
||||||
container.AddPathTranslateMapping(tempWorkflowDirectory, "/github/workflow");
|
container.AddPathTranslateMapping(tempWorkflowDirectory, "/github/workflow");
|
||||||
|
container.AddPathTranslateMapping(tempFileCommandDirectory, "/github/file_commands");
|
||||||
container.AddPathTranslateMapping(defaultWorkingDirectory, "/github/workspace");
|
container.AddPathTranslateMapping(defaultWorkingDirectory, "/github/workspace");
|
||||||
|
|
||||||
container.ContainerWorkDirectory = "/github/workspace";
|
container.ContainerWorkDirectory = "/github/workspace";
|
||||||
|
|||||||
@@ -15,6 +15,14 @@ namespace GitHub.Runner.Worker
|
|||||||
private static readonly Regex _propertyRegex = new Regex("^[a-zA-Z_][a-zA-Z0-9_]*$", RegexOptions.Compiled);
|
private static readonly Regex _propertyRegex = new Regex("^[a-zA-Z_][a-zA-Z0-9_]*$", RegexOptions.Compiled);
|
||||||
private readonly DictionaryContextData _contextData = new DictionaryContextData();
|
private readonly DictionaryContextData _contextData = new DictionaryContextData();
|
||||||
|
|
||||||
|
public void ClearScope(string scopeName)
|
||||||
|
{
|
||||||
|
if (_contextData.TryGetValue(scopeName, out _))
|
||||||
|
{
|
||||||
|
_contextData[scopeName] = new DictionaryContextData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public DictionaryContextData GetScope(string scopeName)
|
public DictionaryContextData GetScope(string scopeName)
|
||||||
{
|
{
|
||||||
if (scopeName == null)
|
if (scopeName == null)
|
||||||
|
|||||||
@@ -104,16 +104,7 @@ namespace GitHub.Runner.Worker
|
|||||||
if (step is IActionRunner actionStep)
|
if (step is IActionRunner actionStep)
|
||||||
{
|
{
|
||||||
// Set GITHUB_ACTION
|
// Set GITHUB_ACTION
|
||||||
// Warning: Do not turn on FF DistributedTask.UseContextNameForGITHUBACTION until after M271-ish. After M271-ish
|
step.ExecutionContext.SetGitHubContext("action", actionStep.Action.Name);
|
||||||
// the server will never send an empty context name. Generated context names start with "__"
|
|
||||||
if (step.ExecutionContext.Global.Variables.GetBoolean("DistributedTask.UseContextNameForGITHUBACTION") ?? false)
|
|
||||||
{
|
|
||||||
step.ExecutionContext.SetGitHubContext("action", actionStep.Action.Name);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
step.ExecutionContext.SetGitHubContext("action", step.ExecutionContext.GetFullyQualifiedContextName());
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ namespace GitHub.DistributedTask.WebApi
|
|||||||
: base(baseUrl, pipeline, disposeHandler)
|
: base(baseUrl, pipeline, disposeHandler)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task AppendTimelineRecordFeedAsync(
|
public Task AppendTimelineRecordFeedAsync(
|
||||||
Guid scopeIdentifier,
|
Guid scopeIdentifier,
|
||||||
String planType,
|
String planType,
|
||||||
@@ -91,6 +91,28 @@ namespace GitHub.DistributedTask.WebApi
|
|||||||
userState,
|
userState,
|
||||||
cancellationToken);
|
cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Task AppendTimelineRecordFeedAsync(
|
||||||
|
Guid scopeIdentifier,
|
||||||
|
String planType,
|
||||||
|
Guid planId,
|
||||||
|
Guid timelineId,
|
||||||
|
Guid recordId,
|
||||||
|
Guid stepId,
|
||||||
|
IList<String> lines,
|
||||||
|
long startLine,
|
||||||
|
CancellationToken cancellationToken = default(CancellationToken),
|
||||||
|
Object userState = null)
|
||||||
|
{
|
||||||
|
return AppendTimelineRecordFeedAsync(scopeIdentifier,
|
||||||
|
planType,
|
||||||
|
planId,
|
||||||
|
timelineId,
|
||||||
|
recordId,
|
||||||
|
new TimelineRecordFeedLinesWrapper(stepId, lines, startLine),
|
||||||
|
userState,
|
||||||
|
cancellationToken);
|
||||||
|
}
|
||||||
|
|
||||||
public async Task RaisePlanEventAsync<T>(
|
public async Task RaisePlanEventAsync<T>(
|
||||||
Guid scopeIdentifier,
|
Guid scopeIdentifier,
|
||||||
|
|||||||
@@ -20,6 +20,12 @@ namespace GitHub.DistributedTask.WebApi
|
|||||||
this.Count = lines.Count;
|
this.Count = lines.Count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public TimelineRecordFeedLinesWrapper(Guid stepId, IList<string> lines, Int64 startLine)
|
||||||
|
: this(stepId, lines)
|
||||||
|
{
|
||||||
|
this.StartLine = startLine;
|
||||||
|
}
|
||||||
|
|
||||||
[DataMember(Order = 0)]
|
[DataMember(Order = 0)]
|
||||||
public Int32 Count { get; private set; }
|
public Int32 Count { get; private set; }
|
||||||
|
|
||||||
@@ -31,5 +37,8 @@ namespace GitHub.DistributedTask.WebApi
|
|||||||
|
|
||||||
[DataMember(EmitDefaultValue = false)]
|
[DataMember(EmitDefaultValue = false)]
|
||||||
public Guid StepId { get; set; }
|
public Guid StepId { get; set; }
|
||||||
|
|
||||||
|
[DataMember (EmitDefaultValue = false)]
|
||||||
|
public Int64? StartLine { get; private set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
29
src/Sdk/DTWebApi/WebApi/TimelineRecordLogLine.cs
Normal file
29
src/Sdk/DTWebApi/WebApi/TimelineRecordLogLine.cs
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
using System;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
|
||||||
|
namespace GitHub.DistributedTask.WebApi
|
||||||
|
{
|
||||||
|
[DataContract]
|
||||||
|
public sealed class TimelineRecordLogLine
|
||||||
|
{
|
||||||
|
public TimelineRecordLogLine(String line, long? lineNumber)
|
||||||
|
{
|
||||||
|
this.Line = line;
|
||||||
|
this.LineNumber = lineNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
[DataMember]
|
||||||
|
public String Line
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
|
||||||
|
[DataMember (EmitDefaultValue = false)]
|
||||||
|
public long? LineNumber
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -60,6 +60,7 @@ namespace GitHub.Runner.Common.Tests
|
|||||||
{
|
{
|
||||||
typeof(IActionCommandExtension),
|
typeof(IActionCommandExtension),
|
||||||
typeof(IExecutionContext),
|
typeof(IExecutionContext),
|
||||||
|
typeof(IFileCommandExtension),
|
||||||
typeof(IHandler),
|
typeof(IHandler),
|
||||||
typeof(IJobExtension),
|
typeof(IJobExtension),
|
||||||
typeof(IStep),
|
typeof(IStep),
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ namespace GitHub.Runner.Common.Tests.Worker
|
|||||||
private TestHostContext _hc;
|
private TestHostContext _hc;
|
||||||
private ActionRunner _actionRunner;
|
private ActionRunner _actionRunner;
|
||||||
private IActionManifestManager _actionManifestManager;
|
private IActionManifestManager _actionManifestManager;
|
||||||
|
private Mock<IFileCommandManager> _fileCommandManager;
|
||||||
|
|
||||||
private DictionaryContextData _context = new DictionaryContextData();
|
private DictionaryContextData _context = new DictionaryContextData();
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
@@ -362,6 +364,7 @@ namespace GitHub.Runner.Common.Tests.Worker
|
|||||||
_handlerFactory = new Mock<IHandlerFactory>();
|
_handlerFactory = new Mock<IHandlerFactory>();
|
||||||
_defaultStepHost = new Mock<IDefaultStepHost>();
|
_defaultStepHost = new Mock<IDefaultStepHost>();
|
||||||
_actionManifestManager = new ActionManifestManager();
|
_actionManifestManager = new ActionManifestManager();
|
||||||
|
_fileCommandManager = new Mock<IFileCommandManager>();
|
||||||
_actionManifestManager.Initialize(_hc);
|
_actionManifestManager.Initialize(_hc);
|
||||||
|
|
||||||
var githubContext = new GitHubContext();
|
var githubContext = new GitHubContext();
|
||||||
@@ -394,6 +397,8 @@ namespace GitHub.Runner.Common.Tests.Worker
|
|||||||
|
|
||||||
_hc.EnqueueInstance<IDefaultStepHost>(_defaultStepHost.Object);
|
_hc.EnqueueInstance<IDefaultStepHost>(_defaultStepHost.Object);
|
||||||
|
|
||||||
|
_hc.EnqueueInstance(_fileCommandManager.Object);
|
||||||
|
|
||||||
// Instance to test.
|
// Instance to test.
|
||||||
_actionRunner = new ActionRunner();
|
_actionRunner = new ActionRunner();
|
||||||
_actionRunner.Initialize(_hc);
|
_actionRunner.Initialize(_hc);
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ namespace GitHub.Runner.Common.Tests.Worker
|
|||||||
var pagingLogger = new Mock<IPagingLogger>();
|
var pagingLogger = new Mock<IPagingLogger>();
|
||||||
var jobServerQueue = new Mock<IJobServerQueue>();
|
var jobServerQueue = new Mock<IJobServerQueue>();
|
||||||
jobServerQueue.Setup(x => x.QueueTimelineRecordUpdate(It.IsAny<Guid>(), It.IsAny<TimelineRecord>()));
|
jobServerQueue.Setup(x => x.QueueTimelineRecordUpdate(It.IsAny<Guid>(), It.IsAny<TimelineRecord>()));
|
||||||
jobServerQueue.Setup(x => x.QueueWebConsoleLine(It.IsAny<Guid>(), It.IsAny<string>())).Callback((Guid id, string msg) => { hc.GetTrace().Info(msg); });
|
jobServerQueue.Setup(x => x.QueueWebConsoleLine(It.IsAny<Guid>(), It.IsAny<string>(),It.IsAny<long>())).Callback((Guid id, string msg, long? lineNumber) => { hc.GetTrace().Info(msg); });
|
||||||
|
|
||||||
hc.EnqueueInstance(pagingLogger.Object);
|
hc.EnqueueInstance(pagingLogger.Object);
|
||||||
hc.SetSingleton(jobServerQueue.Object);
|
hc.SetSingleton(jobServerQueue.Object);
|
||||||
@@ -137,7 +137,7 @@ namespace GitHub.Runner.Common.Tests.Worker
|
|||||||
|
|
||||||
ec.Complete();
|
ec.Complete();
|
||||||
|
|
||||||
jobServerQueue.Verify(x => x.QueueWebConsoleLine(It.IsAny<Guid>(), It.IsAny<string>()), Times.Exactly(10));
|
jobServerQueue.Verify(x => x.QueueWebConsoleLine(It.IsAny<Guid>(), It.IsAny<string>(), It.IsAny<long?>()), Times.Exactly(10));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -171,7 +171,7 @@ namespace GitHub.Runner.Common.Tests.Worker
|
|||||||
var pagingLogger5 = new Mock<IPagingLogger>();
|
var pagingLogger5 = new Mock<IPagingLogger>();
|
||||||
var jobServerQueue = new Mock<IJobServerQueue>();
|
var jobServerQueue = new Mock<IJobServerQueue>();
|
||||||
jobServerQueue.Setup(x => x.QueueTimelineRecordUpdate(It.IsAny<Guid>(), It.IsAny<TimelineRecord>()));
|
jobServerQueue.Setup(x => x.QueueTimelineRecordUpdate(It.IsAny<Guid>(), It.IsAny<TimelineRecord>()));
|
||||||
jobServerQueue.Setup(x => x.QueueWebConsoleLine(It.IsAny<Guid>(), It.IsAny<string>())).Callback((Guid id, string msg) => { hc.GetTrace().Info(msg); });
|
jobServerQueue.Setup(x => x.QueueWebConsoleLine(It.IsAny<Guid>(), It.IsAny<string>(), It.IsAny<long?>())).Callback((Guid id, string msg, long? lineNumber) => { hc.GetTrace().Info(msg); });
|
||||||
|
|
||||||
var actionRunner1 = new ActionRunner();
|
var actionRunner1 = new ActionRunner();
|
||||||
actionRunner1.Initialize(hc);
|
actionRunner1.Initialize(hc);
|
||||||
@@ -269,7 +269,7 @@ namespace GitHub.Runner.Common.Tests.Worker
|
|||||||
var pagingLogger5 = new Mock<IPagingLogger>();
|
var pagingLogger5 = new Mock<IPagingLogger>();
|
||||||
var jobServerQueue = new Mock<IJobServerQueue>();
|
var jobServerQueue = new Mock<IJobServerQueue>();
|
||||||
jobServerQueue.Setup(x => x.QueueTimelineRecordUpdate(It.IsAny<Guid>(), It.IsAny<TimelineRecord>()));
|
jobServerQueue.Setup(x => x.QueueTimelineRecordUpdate(It.IsAny<Guid>(), It.IsAny<TimelineRecord>()));
|
||||||
jobServerQueue.Setup(x => x.QueueWebConsoleLine(It.IsAny<Guid>(), It.IsAny<string>())).Callback((Guid id, string msg) => { hc.GetTrace().Info(msg); });
|
jobServerQueue.Setup(x => x.QueueWebConsoleLine(It.IsAny<Guid>(), It.IsAny<string>(), It.IsAny<long?>())).Callback((Guid id, string msg, long? lineNumber) => { hc.GetTrace().Info(msg); });
|
||||||
|
|
||||||
var actionRunner1 = new ActionRunner();
|
var actionRunner1 = new ActionRunner();
|
||||||
actionRunner1.Initialize(hc);
|
actionRunner1.Initialize(hc);
|
||||||
|
|||||||
390
src/Test/L0/Worker/SetEnvFileCommandL0.cs
Normal file
390
src/Test/L0/Worker/SetEnvFileCommandL0.cs
Normal file
@@ -0,0 +1,390 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using GitHub.Runner.Common.Util;
|
||||||
|
using GitHub.Runner.Sdk;
|
||||||
|
using GitHub.Runner.Worker;
|
||||||
|
using GitHub.Runner.Worker.Container;
|
||||||
|
using GitHub.Runner.Worker.Handlers;
|
||||||
|
using Moq;
|
||||||
|
using Xunit;
|
||||||
|
using DTWebApi = GitHub.DistributedTask.WebApi;
|
||||||
|
|
||||||
|
namespace GitHub.Runner.Common.Tests.Worker
|
||||||
|
{
|
||||||
|
public sealed class SetEnvFileCommandL0
|
||||||
|
{
|
||||||
|
private Mock<IExecutionContext> _executionContext;
|
||||||
|
private List<Tuple<DTWebApi.Issue, string>> _issues;
|
||||||
|
private string _rootDirectory;
|
||||||
|
private SetEnvFileCommand _setEnvFileCommand;
|
||||||
|
private ITraceWriter _trace;
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
[Trait("Level", "L0")]
|
||||||
|
[Trait("Category", "Worker")]
|
||||||
|
public void SetEnvFileCommand_DirectoryNotFound()
|
||||||
|
{
|
||||||
|
using (var hostContext = Setup())
|
||||||
|
{
|
||||||
|
var envFile = Path.Combine(_rootDirectory, "directory-not-found", "env");
|
||||||
|
_setEnvFileCommand.ProcessCommand(_executionContext.Object, envFile, null);
|
||||||
|
Assert.Equal(0, _issues.Count);
|
||||||
|
Assert.Equal(0, _executionContext.Object.Global.EnvironmentVariables.Count);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
[Trait("Level", "L0")]
|
||||||
|
[Trait("Category", "Worker")]
|
||||||
|
public void SetEnvFileCommand_NotFound()
|
||||||
|
{
|
||||||
|
using (var hostContext = Setup())
|
||||||
|
{
|
||||||
|
var envFile = Path.Combine(_rootDirectory, "file-not-found");
|
||||||
|
_setEnvFileCommand.ProcessCommand(_executionContext.Object, envFile, null);
|
||||||
|
Assert.Equal(0, _issues.Count);
|
||||||
|
Assert.Equal(0, _executionContext.Object.Global.EnvironmentVariables.Count);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
[Trait("Level", "L0")]
|
||||||
|
[Trait("Category", "Worker")]
|
||||||
|
public void SetEnvFileCommand_EmptyFile()
|
||||||
|
{
|
||||||
|
using (var hostContext = Setup())
|
||||||
|
{
|
||||||
|
var envFile = Path.Combine(_rootDirectory, "empty-file");
|
||||||
|
var content = new List<string>();
|
||||||
|
WriteContent(envFile, content);
|
||||||
|
_setEnvFileCommand.ProcessCommand(_executionContext.Object, envFile, null);
|
||||||
|
Assert.Equal(0, _issues.Count);
|
||||||
|
Assert.Equal(0, _executionContext.Object.Global.EnvironmentVariables.Count);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
[Trait("Level", "L0")]
|
||||||
|
[Trait("Category", "Worker")]
|
||||||
|
public void SetEnvFileCommand_Simple()
|
||||||
|
{
|
||||||
|
using (var hostContext = Setup())
|
||||||
|
{
|
||||||
|
var envFile = Path.Combine(_rootDirectory, "simple");
|
||||||
|
var content = new List<string>
|
||||||
|
{
|
||||||
|
"MY_ENV=MY VALUE",
|
||||||
|
};
|
||||||
|
WriteContent(envFile, content);
|
||||||
|
_setEnvFileCommand.ProcessCommand(_executionContext.Object, envFile, null);
|
||||||
|
Assert.Equal(0, _issues.Count);
|
||||||
|
Assert.Equal(1, _executionContext.Object.Global.EnvironmentVariables.Count);
|
||||||
|
Assert.Equal("MY VALUE", _executionContext.Object.Global.EnvironmentVariables["MY_ENV"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
[Trait("Level", "L0")]
|
||||||
|
[Trait("Category", "Worker")]
|
||||||
|
public void SetEnvFileCommand_Simple_SkipEmptyLines()
|
||||||
|
{
|
||||||
|
using (var hostContext = Setup())
|
||||||
|
{
|
||||||
|
var envFile = Path.Combine(_rootDirectory, "simple");
|
||||||
|
var content = new List<string>
|
||||||
|
{
|
||||||
|
string.Empty,
|
||||||
|
"MY_ENV=my value",
|
||||||
|
string.Empty,
|
||||||
|
"MY_ENV_2=my second value",
|
||||||
|
string.Empty,
|
||||||
|
};
|
||||||
|
WriteContent(envFile, content);
|
||||||
|
_setEnvFileCommand.ProcessCommand(_executionContext.Object, envFile, null);
|
||||||
|
Assert.Equal(0, _issues.Count);
|
||||||
|
Assert.Equal(2, _executionContext.Object.Global.EnvironmentVariables.Count);
|
||||||
|
Assert.Equal("my value", _executionContext.Object.Global.EnvironmentVariables["MY_ENV"]);
|
||||||
|
Assert.Equal("my second value", _executionContext.Object.Global.EnvironmentVariables["MY_ENV_2"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
[Trait("Level", "L0")]
|
||||||
|
[Trait("Category", "Worker")]
|
||||||
|
public void SetEnvFileCommand_Simple_EmptyValue()
|
||||||
|
{
|
||||||
|
using (var hostContext = Setup())
|
||||||
|
{
|
||||||
|
var envFile = Path.Combine(_rootDirectory, "simple-empty-value");
|
||||||
|
var content = new List<string>
|
||||||
|
{
|
||||||
|
"MY_ENV=",
|
||||||
|
};
|
||||||
|
WriteContent(envFile, content);
|
||||||
|
_setEnvFileCommand.ProcessCommand(_executionContext.Object, envFile, null);
|
||||||
|
Assert.Equal(0, _issues.Count);
|
||||||
|
Assert.Equal(1, _executionContext.Object.Global.EnvironmentVariables.Count);
|
||||||
|
Assert.Equal(string.Empty, _executionContext.Object.Global.EnvironmentVariables["MY_ENV"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
[Trait("Level", "L0")]
|
||||||
|
[Trait("Category", "Worker")]
|
||||||
|
public void SetEnvFileCommand_Simple_MultipleValues()
|
||||||
|
{
|
||||||
|
using (var hostContext = Setup())
|
||||||
|
{
|
||||||
|
var envFile = Path.Combine(_rootDirectory, "simple");
|
||||||
|
var content = new List<string>
|
||||||
|
{
|
||||||
|
"MY_ENV=my value",
|
||||||
|
"MY_ENV_2=",
|
||||||
|
"MY_ENV_3=my third value",
|
||||||
|
};
|
||||||
|
WriteContent(envFile, content);
|
||||||
|
_setEnvFileCommand.ProcessCommand(_executionContext.Object, envFile, null);
|
||||||
|
Assert.Equal(0, _issues.Count);
|
||||||
|
Assert.Equal(3, _executionContext.Object.Global.EnvironmentVariables.Count);
|
||||||
|
Assert.Equal("my value", _executionContext.Object.Global.EnvironmentVariables["MY_ENV"]);
|
||||||
|
Assert.Equal(string.Empty, _executionContext.Object.Global.EnvironmentVariables["MY_ENV_2"]);
|
||||||
|
Assert.Equal("my third value", _executionContext.Object.Global.EnvironmentVariables["MY_ENV_3"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
[Trait("Level", "L0")]
|
||||||
|
[Trait("Category", "Worker")]
|
||||||
|
public void SetEnvFileCommand_Simple_SpecialCharacters()
|
||||||
|
{
|
||||||
|
using (var hostContext = Setup())
|
||||||
|
{
|
||||||
|
var envFile = Path.Combine(_rootDirectory, "simple");
|
||||||
|
var content = new List<string>
|
||||||
|
{
|
||||||
|
"MY_ENV==abc",
|
||||||
|
"MY_ENV_2=def=ghi",
|
||||||
|
"MY_ENV_3=jkl=",
|
||||||
|
};
|
||||||
|
WriteContent(envFile, content);
|
||||||
|
_setEnvFileCommand.ProcessCommand(_executionContext.Object, envFile, null);
|
||||||
|
Assert.Equal(0, _issues.Count);
|
||||||
|
Assert.Equal(3, _executionContext.Object.Global.EnvironmentVariables.Count);
|
||||||
|
Assert.Equal("=abc", _executionContext.Object.Global.EnvironmentVariables["MY_ENV"]);
|
||||||
|
Assert.Equal("def=ghi", _executionContext.Object.Global.EnvironmentVariables["MY_ENV_2"]);
|
||||||
|
Assert.Equal("jkl=", _executionContext.Object.Global.EnvironmentVariables["MY_ENV_3"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
[Trait("Level", "L0")]
|
||||||
|
[Trait("Category", "Worker")]
|
||||||
|
public void SetEnvFileCommand_Heredoc()
|
||||||
|
{
|
||||||
|
using (var hostContext = Setup())
|
||||||
|
{
|
||||||
|
var envFile = Path.Combine(_rootDirectory, "heredoc");
|
||||||
|
var content = new List<string>
|
||||||
|
{
|
||||||
|
"MY_ENV<<EOF",
|
||||||
|
"line one",
|
||||||
|
"line two",
|
||||||
|
"line three",
|
||||||
|
"EOF",
|
||||||
|
};
|
||||||
|
WriteContent(envFile, content);
|
||||||
|
_setEnvFileCommand.ProcessCommand(_executionContext.Object, envFile, null);
|
||||||
|
Assert.Equal(0, _issues.Count);
|
||||||
|
Assert.Equal(1, _executionContext.Object.Global.EnvironmentVariables.Count);
|
||||||
|
Assert.Equal($"line one{Environment.NewLine}line two{Environment.NewLine}line three", _executionContext.Object.Global.EnvironmentVariables["MY_ENV"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
[Trait("Level", "L0")]
|
||||||
|
[Trait("Category", "Worker")]
|
||||||
|
public void SetEnvFileCommand_Heredoc_EmptyValue()
|
||||||
|
{
|
||||||
|
using (var hostContext = Setup())
|
||||||
|
{
|
||||||
|
var envFile = Path.Combine(_rootDirectory, "heredoc");
|
||||||
|
var content = new List<string>
|
||||||
|
{
|
||||||
|
"MY_ENV<<EOF",
|
||||||
|
"EOF",
|
||||||
|
};
|
||||||
|
WriteContent(envFile, content);
|
||||||
|
_setEnvFileCommand.ProcessCommand(_executionContext.Object, envFile, null);
|
||||||
|
Assert.Equal(0, _issues.Count);
|
||||||
|
Assert.Equal(1, _executionContext.Object.Global.EnvironmentVariables.Count);
|
||||||
|
Assert.Equal(string.Empty, _executionContext.Object.Global.EnvironmentVariables["MY_ENV"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
[Trait("Level", "L0")]
|
||||||
|
[Trait("Category", "Worker")]
|
||||||
|
public void SetEnvFileCommand_Heredoc_SkipEmptyLines()
|
||||||
|
{
|
||||||
|
using (var hostContext = Setup())
|
||||||
|
{
|
||||||
|
var envFile = Path.Combine(_rootDirectory, "heredoc");
|
||||||
|
var content = new List<string>
|
||||||
|
{
|
||||||
|
string.Empty,
|
||||||
|
"MY_ENV<<EOF",
|
||||||
|
"hello",
|
||||||
|
"world",
|
||||||
|
"EOF",
|
||||||
|
string.Empty,
|
||||||
|
"MY_ENV_2<<EOF",
|
||||||
|
"HELLO",
|
||||||
|
"AGAIN",
|
||||||
|
"EOF",
|
||||||
|
string.Empty,
|
||||||
|
};
|
||||||
|
WriteContent(envFile, content);
|
||||||
|
_setEnvFileCommand.ProcessCommand(_executionContext.Object, envFile, null);
|
||||||
|
Assert.Equal(0, _issues.Count);
|
||||||
|
Assert.Equal(2, _executionContext.Object.Global.EnvironmentVariables.Count);
|
||||||
|
Assert.Equal($"hello{Environment.NewLine}world", _executionContext.Object.Global.EnvironmentVariables["MY_ENV"]);
|
||||||
|
Assert.Equal($"HELLO{Environment.NewLine}AGAIN", _executionContext.Object.Global.EnvironmentVariables["MY_ENV_2"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
[Trait("Level", "L0")]
|
||||||
|
[Trait("Category", "Worker")]
|
||||||
|
public void SetEnvFileCommand_Heredoc_SpecialCharacters()
|
||||||
|
{
|
||||||
|
using (var hostContext = Setup())
|
||||||
|
{
|
||||||
|
var envFile = Path.Combine(_rootDirectory, "heredoc");
|
||||||
|
var content = new List<string>
|
||||||
|
{
|
||||||
|
"MY_ENV<<=EOF",
|
||||||
|
"hello",
|
||||||
|
"one",
|
||||||
|
"=EOF",
|
||||||
|
"MY_ENV_2<<<EOF",
|
||||||
|
"hello",
|
||||||
|
"two",
|
||||||
|
"<EOF",
|
||||||
|
"MY_ENV_3<<EOF",
|
||||||
|
"hello",
|
||||||
|
string.Empty,
|
||||||
|
"three",
|
||||||
|
string.Empty,
|
||||||
|
"EOF",
|
||||||
|
"MY_ENV_4<<EOF",
|
||||||
|
"hello=four",
|
||||||
|
"EOF",
|
||||||
|
"MY_ENV_5<<EOF",
|
||||||
|
" EOF",
|
||||||
|
"EOF",
|
||||||
|
};
|
||||||
|
WriteContent(envFile, content);
|
||||||
|
_setEnvFileCommand.ProcessCommand(_executionContext.Object, envFile, null);
|
||||||
|
Assert.Equal(0, _issues.Count);
|
||||||
|
Assert.Equal(5, _executionContext.Object.Global.EnvironmentVariables.Count);
|
||||||
|
Assert.Equal($"hello{Environment.NewLine}one", _executionContext.Object.Global.EnvironmentVariables["MY_ENV"]);
|
||||||
|
Assert.Equal($"hello{Environment.NewLine}two", _executionContext.Object.Global.EnvironmentVariables["MY_ENV_2"]);
|
||||||
|
Assert.Equal($"hello{Environment.NewLine}{Environment.NewLine}three{Environment.NewLine}", _executionContext.Object.Global.EnvironmentVariables["MY_ENV_3"]);
|
||||||
|
Assert.Equal($"hello=four", _executionContext.Object.Global.EnvironmentVariables["MY_ENV_4"]);
|
||||||
|
Assert.Equal($" EOF", _executionContext.Object.Global.EnvironmentVariables["MY_ENV_5"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#if OS_WINDOWS
|
||||||
|
[Fact]
|
||||||
|
[Trait("Level", "L0")]
|
||||||
|
[Trait("Category", "Worker")]
|
||||||
|
public void SetEnvFileCommand_Heredoc_PreservesNewline()
|
||||||
|
{
|
||||||
|
using (var hostContext = Setup())
|
||||||
|
{
|
||||||
|
var newline = "\n";
|
||||||
|
var envFile = Path.Combine(_rootDirectory, "heredoc");
|
||||||
|
var content = new List<string>
|
||||||
|
{
|
||||||
|
"MY_ENV<<EOF",
|
||||||
|
"hello",
|
||||||
|
"world",
|
||||||
|
"EOF",
|
||||||
|
};
|
||||||
|
WriteContent(envFile, content, newline: newline);
|
||||||
|
_setEnvFileCommand.ProcessCommand(_executionContext.Object, envFile, null);
|
||||||
|
Assert.Equal(0, _issues.Count);
|
||||||
|
Assert.Equal(1, _executionContext.Object.Global.EnvironmentVariables.Count);
|
||||||
|
Assert.Equal($"hello{newline}world", _executionContext.Object.Global.EnvironmentVariables["MY_ENV"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
private void WriteContent(
|
||||||
|
string path,
|
||||||
|
List<string> content,
|
||||||
|
string newline = null)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(newline))
|
||||||
|
{
|
||||||
|
newline = Environment.NewLine;
|
||||||
|
}
|
||||||
|
|
||||||
|
var encoding = new UTF8Encoding(true); // Emit BOM
|
||||||
|
var contentStr = string.Join(newline, content);
|
||||||
|
File.WriteAllText(path, contentStr, encoding);
|
||||||
|
}
|
||||||
|
|
||||||
|
private TestHostContext Setup([CallerMemberName] string name = "")
|
||||||
|
{
|
||||||
|
_issues = new List<Tuple<DTWebApi.Issue, string>>();
|
||||||
|
|
||||||
|
var hostContext = new TestHostContext(this, name);
|
||||||
|
|
||||||
|
// Trace
|
||||||
|
_trace = hostContext.GetTrace();
|
||||||
|
|
||||||
|
// Directory for test data
|
||||||
|
var workDirectory = hostContext.GetDirectory(WellKnownDirectory.Work);
|
||||||
|
ArgUtil.NotNullOrEmpty(workDirectory, nameof(workDirectory));
|
||||||
|
Directory.CreateDirectory(workDirectory);
|
||||||
|
_rootDirectory = Path.Combine(workDirectory, nameof(SetEnvFileCommandL0));
|
||||||
|
Directory.CreateDirectory(_rootDirectory);
|
||||||
|
|
||||||
|
// Execution context
|
||||||
|
_executionContext = new Mock<IExecutionContext>();
|
||||||
|
_executionContext.Setup(x => x.Global)
|
||||||
|
.Returns(new GlobalContext
|
||||||
|
{
|
||||||
|
EnvironmentVariables = new Dictionary<string, string>(VarUtil.EnvironmentVariableKeyComparer),
|
||||||
|
WriteDebug = true,
|
||||||
|
});
|
||||||
|
_executionContext.Setup(x => x.AddIssue(It.IsAny<DTWebApi.Issue>(), It.IsAny<string>()))
|
||||||
|
.Callback((DTWebApi.Issue issue, string logMessage) =>
|
||||||
|
{
|
||||||
|
_issues.Add(new Tuple<DTWebApi.Issue, string>(issue, logMessage));
|
||||||
|
var message = !string.IsNullOrEmpty(logMessage) ? logMessage : issue.Message;
|
||||||
|
_trace.Info($"Issue '{issue.Type}': {message}");
|
||||||
|
});
|
||||||
|
_executionContext.Setup(x => x.Write(It.IsAny<string>(), It.IsAny<string>()))
|
||||||
|
.Callback((string tag, string message) =>
|
||||||
|
{
|
||||||
|
_trace.Info($"{tag}{message}");
|
||||||
|
});
|
||||||
|
|
||||||
|
// SetEnvFileCommand
|
||||||
|
_setEnvFileCommand = new SetEnvFileCommand();
|
||||||
|
_setEnvFileCommand.Initialize(hostContext);
|
||||||
|
|
||||||
|
return hostContext;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -44,7 +44,7 @@ namespace GitHub.Runner.Common.Tests.Worker
|
|||||||
|
|
||||||
_contexts = new DictionaryContextData();
|
_contexts = new DictionaryContextData();
|
||||||
_jobContext = new JobContext();
|
_jobContext = new JobContext();
|
||||||
_contexts["github"] = new DictionaryContextData();
|
_contexts["github"] = new GitHubContext();
|
||||||
_contexts["runner"] = new DictionaryContextData();
|
_contexts["runner"] = new DictionaryContextData();
|
||||||
_contexts["job"] = _jobContext;
|
_contexts["job"] = _jobContext;
|
||||||
_ec.Setup(x => x.ExpressionValues).Returns(_contexts);
|
_ec.Setup(x => x.ExpressionValues).Returns(_contexts);
|
||||||
@@ -602,7 +602,12 @@ namespace GitHub.Runner.Common.Tests.Worker
|
|||||||
var stepContext = new Mock<IExecutionContext>();
|
var stepContext = new Mock<IExecutionContext>();
|
||||||
stepContext.SetupAllProperties();
|
stepContext.SetupAllProperties();
|
||||||
stepContext.Setup(x => x.Global).Returns(() => _ec.Object.Global);
|
stepContext.Setup(x => x.Global).Returns(() => _ec.Object.Global);
|
||||||
stepContext.Setup(x => x.ExpressionValues).Returns(new DictionaryContextData());
|
var expressionValues = new DictionaryContextData();
|
||||||
|
foreach (var pair in _ec.Object.ExpressionValues)
|
||||||
|
{
|
||||||
|
expressionValues[pair.Key] = pair.Value;
|
||||||
|
}
|
||||||
|
stepContext.Setup(x => x.ExpressionValues).Returns(expressionValues);
|
||||||
stepContext.Setup(x => x.ExpressionFunctions).Returns(new List<IFunctionInfo>());
|
stepContext.Setup(x => x.ExpressionFunctions).Returns(new List<IFunctionInfo>());
|
||||||
stepContext.Setup(x => x.JobContext).Returns(_jobContext);
|
stepContext.Setup(x => x.JobContext).Returns(_jobContext);
|
||||||
stepContext.Setup(x => x.ContextName).Returns(step.Object.Action.ContextName);
|
stepContext.Setup(x => x.ContextName).Returns(step.Object.Action.ContextName);
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
2.272.0
|
2.273.3
|
||||||
|
|||||||
Reference in New Issue
Block a user