Skip to content

Commit 1221e9f

Browse files
authored
Merge branch 'master' into justingrote/feature/webRequestLogging
2 parents 7128f0c + d5b63e1 commit 1221e9f

File tree

67 files changed

+1881
-1755
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1881
-1755
lines changed

.github/CODEOWNERS

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
src/System.Management.Automation/security/wldpNativeMethods.cs @TravisEz13 @seeminglyscience
1111

1212
# Area: CI Build
13-
.github/workflows @PowerShell/powershell-maintainers
14-
.github/actions @PowerShell/powershell-maintainers
13+
.github/workflows @PowerShell/powershell-maintainers @jshigetomi
14+
.github/actions @PowerShell/powershell-maintainers @jshigetomi
1515

1616
# Now, areas that should have paths or filters, although we might not have them defined
1717
# According to the docs, order here must be by precedence of the filter, with later rules overwritting
@@ -53,13 +53,13 @@ src/System.Management.Automation/engine/remoting @daxian-dbw @TravisEz13
5353

5454
# Areas: Build
5555
# Must be last
56-
*.config @PowerShell/powershell-maintainers
57-
*.props @PowerShell/powershell-maintainers
58-
*.yml @PowerShell/powershell-maintainers
59-
*.csproj @PowerShell/powershell-maintainers
60-
build.* @PowerShell/powershell-maintainers
61-
tools/ @PowerShell/powershell-maintainers
62-
# docker/ @PowerShell/powershell-maintainers
56+
*.config @PowerShell/powershell-maintainers @jshigetomi
57+
*.props @PowerShell/powershell-maintainers @jshigetomi
58+
*.yml @PowerShell/powershell-maintainers @jshigetomi
59+
*.csproj @PowerShell/powershell-maintainers @jshigetomi
60+
build.* @PowerShell/powershell-maintainers @jshigetomi
61+
tools/ @PowerShell/powershell-maintainers @jshigetomi
62+
# docker/ @PowerShell/powershell-maintainers @jshigetomi
6363

6464
# Area: Compliance
6565
tools/terms @TravisEz13

.github/ISSUE_TEMPLATE/Distribution_Request.yaml

Lines changed: 0 additions & 64 deletions
This file was deleted.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
- Use the present tense and imperative mood when describing your changes
1515
- [ ] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
1616
- [ ] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
17-
- [ ] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress).
18-
- If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready.
17+
- [ ] This PR is ready to merge. If this PR is a work in progress, please open this as a [Draft Pull Request and mark it as Ready to Review when it is ready to merge](https://docs.github.com/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests#draft-pull-requests).
1918
- **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)**
2019
- [ ] None
2120
- **OR**
@@ -25,21 +24,8 @@
2524
- [ ] Not Applicable
2625
- **OR**
2726
- [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
28-
- [ ] Issue filed: <!-- Number/link of that issue here -->
27+
- [ ] Issue filed: <!-- Number/link of that issue here -->
2928
- **Testing - New and feature**
3029
- [ ] N/A or can only be tested interactively
3130
- **OR**
3231
- [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting)
33-
- **Tooling**
34-
- [ ] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted.
35-
- **OR**
36-
- [ ] I have considered the user experience from a tooling perspective and opened an issue in the relevant tool repository. This may include:
37-
- [ ] Impact on [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) which is used in the [PowerShell extension](https://github.com/PowerShell/vscode-powershell) for VSCode
38-
(which runs in a different PS Host).
39-
- [ ] Issue filed: <!-- Number/link of that issue here -->
40-
- [ ] Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features.
41-
- [ ] Issue filed: <!-- Number/link of that issue here -->
42-
- [ ] Impact on [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) (which provides linting & formatting in the editor extensions).
43-
- [ ] Issue filed: <!-- Number/link of that issue here -->
44-
- [ ] Impact on [EditorSyntax](https://github.com/PowerShell/EditorSyntax) (which provides syntax highlighting with in VSCode, GitHub, and many other editors).
45-
- [ ] Issue filed: <!-- Number/link of that issue here -->
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: Path Filters
2+
description: 'Path Filters'
3+
inputs:
4+
GITHUB_TOKEN:
5+
description: 'GitHub token'
6+
required: true
7+
outputs:
8+
source:
9+
description: 'Source code changes (composite of all changes)'
10+
value: ${{ steps.filter.outputs.source }}
11+
githubChanged:
12+
description: 'GitHub workflow changes'
13+
value: ${{ steps.filter.outputs.githubChanged }}
14+
toolsChanged:
15+
description: 'Tools changes'
16+
value: ${{ steps.filter.outputs.toolsChanged }}
17+
propsChanged:
18+
description: 'Props changes'
19+
value: ${{ steps.filter.outputs.propsChanged }}
20+
testsChanged:
21+
description: 'Tests changes'
22+
value: ${{ steps.filter.outputs.testsChanged }}
23+
mainSourceChanged:
24+
description: 'Main source code changes (any changes in src/)'
25+
value: ${{ steps.filter.outputs.mainSourceChanged }}
26+
buildModuleChanged:
27+
description: 'Build module changes'
28+
value: ${{ steps.filter.outputs.buildModuleChanged }}
29+
runs:
30+
using: composite
31+
steps:
32+
- name: Check if GitHubWorkflowChanges is present
33+
id: filter
34+
uses: actions/[email protected]
35+
with:
36+
github-token: ${{ inputs.GITHUB_TOKEN }}
37+
script: |
38+
console.log(`Event Name: ${context.eventName}`);
39+
40+
// Just say everything changed if this is not a PR
41+
if (context.eventName !== 'pull_request') {
42+
console.log('Not a pull request, setting all outputs to true');
43+
core.setOutput('toolsChanged', true);
44+
core.setOutput('githubChanged', true);
45+
core.setOutput('propsChanged', true);
46+
core.setOutput('testsChanged', true);
47+
core.setOutput('mainSourceChanged', true);
48+
core.setOutput('buildModuleChanged', true);
49+
core.setOutput('source', true);
50+
return;
51+
}
52+
53+
console.log(`Getting files changed in PR #${context.issue.number}`);
54+
55+
// Fetch the list of files changed in the PR
56+
let files = [];
57+
let page = 1;
58+
let fetchedFiles;
59+
do {
60+
fetchedFiles = await github.rest.pulls.listFiles({
61+
owner: context.repo.owner,
62+
repo: context.repo.repo,
63+
pull_number: context.issue.number,
64+
per_page: 100,
65+
page: page++
66+
});
67+
files = files.concat(fetchedFiles.data);
68+
} while (fetchedFiles.data.length > 0);
69+
70+
const actionsChanged = files.some(file => file.filename.startsWith('.github/actions'));
71+
const workflowsChanged = files.some(file => file.filename.startsWith('.github/workflows'));
72+
const githubChanged = actionsChanged || workflowsChanged;
73+
74+
const toolsCiPsm1Changed = files.some(file => file.filename.startsWith('tools/ci.psm1'));
75+
const toolsBuildCommonChanged = files.some(file => file.filename.startsWith('tools/buildCommon/'));
76+
const toolsChanged = toolsCiPsm1Changed || toolsBuildCommonChanged;
77+
78+
const propsChanged = files.some(file => file.filename.endsWith('.props'));
79+
80+
const testsChanged = files.some(file => file.filename.startsWith('test/powershell/') || file.filename.startsWith('test/tools/') || file.filename.startsWith('test/xUnit/'));
81+
82+
const mainSourceChanged = files.some(file => file.filename.startsWith('src/'));
83+
84+
const buildModuleChanged = files.some(file => file.filename.startsWith('build.psm1'));
85+
86+
const source = mainSourceChanged || toolsChanged || githubChanged || propsChanged || testsChanged;
87+
88+
core.setOutput('toolsChanged', toolsChanged);
89+
core.setOutput('githubChanged', githubChanged);
90+
core.setOutput('propsChanged', propsChanged);
91+
core.setOutput('testsChanged', testsChanged);
92+
core.setOutput('mainSourceChanged', mainSourceChanged);
93+
core.setOutput('buildModuleChanged', buildModuleChanged);
94+
core.setOutput('source', source);
95+
96+
- name: Capture outputs
97+
run: |
98+
Write-Verbose -Verbose "source: ${{ steps.filter.outputs.source }}"
99+
Write-Verbose -Verbose "github: ${{ steps.filter.outputs.githubChanged }}"
100+
Write-Verbose -Verbose "tools: ${{ steps.filter.outputs.toolsChanged }}"
101+
Write-Verbose -Verbose "props: ${{ steps.filter.outputs.propsChanged }}"
102+
Write-Verbose -Verbose "tests: ${{ steps.filter.outputs.testsChanged }}"
103+
Write-Verbose -Verbose "mainSource: ${{ steps.filter.outputs.mainSourceChanged }}"
104+
Write-Verbose -Verbose "buildModule: ${{ steps.filter.outputs.buildModuleChanged }}"
105+
shell: pwsh

.github/actions/test/nix/action.yml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,39 @@ runs:
2020
steps:
2121
- name: Capture Environment
2222
if: success() || failure()
23-
run: 'Get-ChildItem -Path env: | Out-String -width 9999 -Stream | write-Verbose -Verbose'
23+
run: |-
24+
Import-Module ./build.psm1
25+
Write-LogGroupStart -Title 'Environment'
26+
Get-ChildItem -Path env: | Out-String -width 9999 -Stream | write-Verbose -Verbose
27+
Write-LogGroupEnd -Title 'Environment'
2428
shell: pwsh
29+
2530
- name: Download Build Artifacts
2631
uses: actions/download-artifact@v4
2732
with:
2833
path: "${{ github.workspace }}"
34+
2935
- name: Capture Artifacts Directory
3036
continue-on-error: true
31-
run: Get-ChildItem "${{ github.workspace }}/build/*" -Recurse
37+
run: |-
38+
Import-Module ./build.psm1
39+
Write-LogGroupStart -Title 'Artifacts Directory'
40+
Get-ChildItem "${{ github.workspace }}/build/*" -Recurse
41+
Write-LogGroupEnd -Title 'Artifacts Directory'
3242
shell: pwsh
33-
43+
3444
- uses: actions/setup-dotnet@v4
3545
with:
3646
global-json-file: ./global.json
37-
47+
3848
- name: Bootstrap
3949
shell: pwsh
4050
run: |-
51+
Import-Module ./build.psm1
52+
Write-LogGroupStart -Title 'Bootstrap'
4153
Import-Module ./tools/ci.psm1
4254
Invoke-CIInstall -SkipUser
55+
Write-LogGroupEnd -Title 'Bootstrap'
4356
4457
- name: Extract Files
4558
uses: actions/[email protected]
@@ -68,7 +81,11 @@ runs:
6881

6982
- name: Capture Extracted Build ZIP
7083
continue-on-error: true
71-
run: Get-ChildItem "${{ github.workspace }}/bins/*" -Recurse -ErrorAction SilentlyContinue
84+
run: |-
85+
Import-Module ./build.psm1
86+
Write-LogGroupStart -Title 'Extracted Build ZIP'
87+
Get-ChildItem "${{ github.workspace }}/bins/*" -Recurse -ErrorAction SilentlyContinue
88+
Write-LogGroupEnd -Title 'Extracted Build ZIP'
7289
shell: pwsh
7390

7491
- name: Test
@@ -84,7 +101,7 @@ runs:
84101
chmod a+x $pwshPath
85102
$options.Output = $pwshPath
86103
Set-PSOptions $options
87-
Invoke-CITest -Purpose '${{ inputs.purpose }}' -TagSet '${{ inputs.tagSet }}' -TitlePrefix '${{ inputs.buildName }}' -OutputFormat JUnitXml
104+
Invoke-CITest -Purpose '${{ inputs.purpose }}' -TagSet '${{ inputs.tagSet }}' -TitlePrefix '${{ inputs.buildName }}' -OutputFormat NUnitXml
88105
shell: pwsh
89106

90107
- name: Convert, Publish, and Upload Pester Test Results

.github/actions/test/process-pester-results/action.yml

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -10,55 +10,18 @@ inputs:
1010
required: false
1111
default: "${{ runner.workspace }}/testResults"
1212
type: string
13-
ctrfFolder:
14-
required: false
15-
default: ctrf
16-
type: string
1713

1814
runs:
1915
using: composite
2016
steps:
21-
- name: Convert JUnit to CTRF
17+
- name: Log Summary
2218
run: |-
23-
Get-ChildItem -Path "${{ inputs.testResultsFolder }}/*.xml" -Recurse | ForEach-Object {
24-
npx --yes junit-to-ctrf $_.FullName --output ./${{ inputs.ctrfFolder }}/$($_.BaseName).json --tool Pester
25-
}
19+
& "$env:GITHUB_ACTION_PATH/process-pester-results.ps1" -Name '${{ inputs.name }}' -TestResultsFolder '${{ inputs.testResultsFolder }}'
2620
shell: pwsh
2721

28-
# this task only takes / as directory separators
29-
- name: Publish Test Report
30-
uses: ctrf-io/github-test-reporter@v1
31-
with:
32-
report-path: './${{ inputs.ctrfFolder }}/*.json'
33-
exit-on-fail: true
34-
summary-report: true
35-
test-report: false
36-
test-list-report: false
37-
failed-report: false
38-
fail-rate-report: false
39-
flaky-report: false
40-
flaky-rate-report: false
41-
failed-folded-report: true
42-
previous-results-report: false
43-
ai-report: true
44-
skipped-report: false
45-
suite-folded-report: false
46-
suite-list-report: false
47-
pull-request-report: false
48-
commit-report: false
49-
custom-report: false
50-
if: always()
51-
5222
- name: Upload testResults artifact
5323
if: always()
5424
uses: actions/upload-artifact@v4
5525
with:
5626
name: junit-pester-${{ inputs.name }}
5727
path: ${{ runner.workspace }}/testResults
58-
59-
- name: Upload ctrf artifact
60-
if: always()
61-
uses: actions/upload-artifact@v4
62-
with:
63-
name: ctrf-pester-${{ inputs.name }}
64-
path: ${{ inputs.ctrfFolder }}

0 commit comments

Comments
 (0)