Skip to content

Commit f01d6e1

Browse files
Merge branch 'main' into use-default-encoding
2 parents f0e827a + 919b2de commit f01d6e1

1,138 files changed

Lines changed: 36539 additions & 13954 deletions

File tree

Some content is hidden

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

.azuredevops/dependabot.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
version: 2
2+
3+
# Disabling dependabot on Azure DevOps as this is a mirrored repo. Updates should go through github.
4+
enable-campaigned-updates: false
5+
enable-security-updates: false

.editorconfig

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,8 @@ dotnet_diagnostic.CA5381.severity = warning
265265
dotnet_diagnostic.CA5384.severity = warning
266266
# Use Rivest–Shamir–Adleman (RSA) Algorithm With Sufficient Key Size
267267
dotnet_diagnostic.CA5385.severity = warning
268+
# Parameter has no matching param tag in the XML comment
269+
dotnet_diagnostic.CS1573.severity = suggestion
268270
dotnet_diagnostic.CS1591.severity = suggestion
269271
# UseIsNullCheck
270272
dotnet_diagnostic.IDE0041.severity = warning
@@ -515,11 +517,11 @@ dotnet_diagnostic.IDE0040.severity = warning
515517
insert_final_newline = false
516518

517519
# Verify settings
518-
[*.{received,verified}.{txt,xml,json}]
520+
[*.{received,verified}.{txt,xml,json,sh,zsh,nu,fish,ps1}]
519521
charset = "utf-8-bom"
520522
end_of_line = lf
521523
indent_size = unset
522524
indent_style = unset
523525
insert_final_newline = false
524526
tab_width = unset
525-
trim_trailing_whitespace = false
527+
trim_trailing_whitespace = false

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,7 @@
6767
*.verified.txt text eol=lf working-tree-encoding=UTF-8
6868
*.verified.xml text eol=lf working-tree-encoding=UTF-8
6969
*.verified.json text eol=lf working-tree-encoding=UTF-8
70+
*.verified.sh text eol=lf working-tree-encoding=UTF-8
71+
*.verified.zsh text eol=lf working-tree-encoding=UTF-8
72+
*.verified.nu text eol=lf working-tree-encoding=UTF-8
73+
*.verified.fish text eol=lf working-tree-encoding=UTF-8

.github/copilot-instructions.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
Use the instructions from the main branch if available: @dotnet/sdk/files/.github/copilot-instructions.md
2+
3+
If the instructions from main are not available, use the following as a fallback:
4+
15
Coding Style and Changes:
26
- Code should match the style of the file it's in.
37
- Changes should be minimal to resolve a problem in a clean way.
@@ -34,3 +38,8 @@ Localization:
3438

3539
Documentation:
3640
- Do not manually edit files under documentation/manpages/sdk as these are generated based on documentation and should not be manually modified.
41+
42+
External Dependencies:
43+
- Changes that require modifications to the dotnet/templating repository (Microsoft.TemplateEngine packages) should be made directly in that repository, not worked around in this repo.
44+
- The dotnet/templating repository owns the TemplateEngine.Edge, TemplateEngine.Abstractions, and related packages.
45+
- If a change requires updates to template engine behavior or formatting (e.g., DisplayName properties), file an issue in dotnet/templating and make the changes there rather than adding workarounds in this SDK repository.

.github/policies/resourceManagement.yml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
id:
1+
id:
22
name: GitOps.PullRequestIssueManagement
33
description: GitOps.PullRequestIssueManagement primitive
4-
owner:
4+
owner:
55
resource: repository
66
disabled: false
7-
where:
7+
where:
88
configuration:
99
resourceManagementConfiguration:
1010
scheduledSearches:
@@ -90,7 +90,7 @@ configuration:
9090
label: needs-breaking-change-doc-created
9191
- addReply:
9292
reply: >-
93-
Added `needs-breaking-change-doc-created` label because this PR has the `breaking-change` label.
93+
Added `needs-breaking-change-doc-created` label because this PR has the `breaking-change` label.
9494
9595
9696
When you commit this breaking change:
@@ -103,5 +103,23 @@ configuration:
103103
104104
You can refer to the [.NET SDK breaking change guidelines](https://github.com/dotnet/sdk/blob/main/documentation/project-docs/breaking-change-guidelines.md)
105105
description: Add breaking change instructions to PR.
106-
onFailure:
107-
onSuccess:
106+
- description: Remind Telemetry PR authors of the telemetry guidelines
107+
if:
108+
- payloadType: Pull_Request
109+
- labelAdded:
110+
label: Area-Telemetry
111+
then:
112+
- addReply:
113+
reply: >-
114+
This PR has been labeled with `Area-Telemetry`. Please ensure that any telemetry changes in this PR
115+
116+
* comply with the [published guidance](https://learn.microsoft.com/dotnet/core/tools/telemetry#data-points)
117+
* are added to the [repo-local telemetry documentation](./documentation/project-docs/telemetry.md)
118+
* get a matching .NET Docs issue raised to document the telemetry changes
119+
* Go to https://learn.microsoft.com/dotnet/core/tools/telemetry
120+
* Scroll down to the bottom and click the 'Open a documentation issue' link to create an issue with pre-filled details
121+
- requestReview:
122+
reviewer: dsplaisted
123+
124+
onFailure:
125+
onSuccess:

.github/workflows/add-lockdown-label.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ name: Add Branch Lockdown Label to PRs
33
on:
44
pull_request_target:
55
workflow_dispatch: # Allows manual triggering of the workflow
6+
branches:
7+
- 'release/8.*'
8+
- 'release/9.*'
9+
- 'release/10.*'
10+
- 'main'
611

712
permissions:
813
actions: write # For managing the operation state cache
@@ -11,6 +16,8 @@ permissions:
1116
jobs:
1217
add-label:
1318
runs-on: ubuntu-latest
19+
# Only run on the main repository, not forks
20+
if: github.repository == 'dotnet/sdk'
1421

1522
permissions:
1623
contents: read
@@ -19,6 +26,8 @@ jobs:
1926
steps:
2027
- name: Checkout repository
2128
uses: actions/checkout@v2
29+
with:
30+
persist-credentials: false
2231

2332
- name: Install jq
2433
run: sudo apt-get install -y jq

.github/workflows/copilot-setup-steps.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
runs-on: ubuntu-latest
2121
steps:
2222
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
23+
with:
24+
persist-credentials: false
2325
- name: Do an initial build to ensure all dependencies are restored
2426
continue-on-error: true
2527
run: |
Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
name: Fix completion snapshots on command
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
issues: write
11+
12+
jobs:
13+
fix-completions:
14+
# Only run on PR comments that start with /fixcompletions or /completions
15+
if: github.event.issue.pull_request &&
16+
(startsWith(github.event.comment.body, '/fixcompletions') || startsWith(github.event.comment.body, '/completions'))
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: React to comment
21+
uses: actions/github-script@v7
22+
with:
23+
script: |
24+
await github.rest.reactions.createForIssueComment({
25+
owner: context.repo.owner,
26+
repo: context.repo.repo,
27+
comment_id: context.payload.comment.id,
28+
content: 'eyes'
29+
});
30+
31+
- name: Comment on PR - Started
32+
uses: actions/github-script@v7
33+
with:
34+
script: |
35+
const runUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${process.env.GITHUB_RUN_ID}`;
36+
await github.rest.issues.createComment({
37+
owner: context.repo.owner,
38+
repo: context.repo.repo,
39+
issue_number: context.payload.issue.number,
40+
body: `▶️ CLI completion snapshot update started. Track progress in [this workflow run](${runUrl}).`
41+
});
42+
43+
- name: Checkout repository
44+
uses: actions/checkout@v4
45+
with:
46+
token: ${{ secrets.GITHUB_TOKEN }}
47+
fetch-depth: 0
48+
49+
- name: Checkout PR branch
50+
run: |
51+
gh pr checkout ${{ github.event.issue.number }}
52+
env:
53+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
55+
- name: Build repository
56+
id: build
57+
run: |
58+
chmod +x ./build.sh
59+
./build.sh
60+
continue-on-error: true
61+
timeout-minutes: 15
62+
63+
- name: Run completion tests
64+
id: test
65+
if: steps.build.outcome == 'success'
66+
run: |
67+
# Use the repo-local dotnet that was built
68+
./.dotnet/dotnet test test/dotnet.Tests/dotnet.Tests.csproj --filter "FullyQualifiedName~VerifyCompletions"
69+
continue-on-error: true
70+
timeout-minutes: 10
71+
72+
- name: Compare snapshots
73+
id: compare
74+
if: steps.test.outcome != 'skipped'
75+
run: |
76+
# Use repo-local dotnet so we only restore the project we need on the runner
77+
./.dotnet/dotnet msbuild test/dotnet.Tests/dotnet.Tests.csproj -restore -t:CompareCliSnapshots
78+
continue-on-error: true
79+
80+
- name: Check for snapshot changes
81+
id: check-changes
82+
if: steps.compare.outcome == 'success'
83+
run: |
84+
# Detect new received files (ignored by git) and diff-ed verified files
85+
shopt -s nullglob
86+
received_files=(test/dotnet.Tests/CompletionTests/snapshots/**/*.received.*)
87+
shopt -u nullglob
88+
89+
diff_output=$(git diff --name-only -- test/dotnet.Tests/CompletionTests/snapshots/ | grep -E '\.verified\.' || true)
90+
91+
if [ ${#received_files[@]} -gt 0 ] || [ -n "$diff_output" ]; then
92+
echo "changes=true" >> $GITHUB_OUTPUT
93+
echo "Changed snapshot files:"
94+
printf '%s\n' "${received_files[@]}"
95+
if [ -n "$diff_output" ]; then
96+
echo "$diff_output"
97+
fi
98+
else
99+
echo "changes=false" >> $GITHUB_OUTPUT
100+
fi
101+
102+
- name: Update verified snapshots
103+
id: update
104+
if: steps.check-changes.outputs.changes == 'true'
105+
run: |
106+
# This renames .received.* files to .verified.*
107+
./.dotnet/dotnet msbuild test/dotnet.Tests/dotnet.Tests.csproj -restore -t:UpdateCliSnapshots
108+
continue-on-error: true
109+
110+
- name: Commit and push snapshot changes
111+
id: commit
112+
if: steps.update.outcome == 'success'
113+
run: |
114+
git config --global user.name 'github-actions[bot]'
115+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
116+
117+
# Add snapshot files
118+
git add test/dotnet.Tests/CompletionTests/snapshots/
119+
120+
# Create commit
121+
COMMIT_DATE=$(date -u +"%Y-%m-%d")
122+
git commit -m "Update CLI completion snapshots - $COMMIT_DATE"
123+
124+
# Push to the PR branch
125+
git push
126+
continue-on-error: true
127+
128+
- name: Comment on PR - Success
129+
if: steps.commit.outcome == 'success'
130+
uses: actions/github-script@v7
131+
with:
132+
script: |
133+
const runUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${process.env.GITHUB_RUN_ID}`;
134+
await github.rest.issues.createComment({
135+
owner: context.repo.owner,
136+
repo: context.repo.repo,
137+
issue_number: context.payload.issue.number,
138+
body: `✅ CLI completion snapshots have been updated and committed to this PR. See [workflow details](${runUrl}).`
139+
});
140+
await github.rest.reactions.createForIssueComment({
141+
owner: context.repo.owner,
142+
repo: context.repo.repo,
143+
comment_id: context.payload.comment.id,
144+
content: '+1'
145+
});
146+
147+
- name: Comment on PR - No changes
148+
if: steps.compare.outcome == 'success' && steps.check-changes.outputs.changes == 'false'
149+
uses: actions/github-script@v7
150+
with:
151+
script: |
152+
const runUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${process.env.GITHUB_RUN_ID}`;
153+
await github.rest.issues.createComment({
154+
owner: context.repo.owner,
155+
repo: context.repo.repo,
156+
issue_number: context.payload.issue.number,
157+
body: `ℹ️ No completion snapshot files needed to be updated. Review [the workflow run](${runUrl}).`
158+
});
159+
await github.rest.reactions.createForIssueComment({
160+
owner: context.repo.owner,
161+
repo: context.repo.repo,
162+
comment_id: context.payload.comment.id,
163+
content: '+1'
164+
});
165+
166+
- name: Comment on PR - Failure
167+
if: steps.build.outcome == 'failure' || (steps.test.outcome == 'failure' && steps.compare.outcome != 'success') || (steps.check-changes.outputs.changes == 'true' && (steps.update.outcome == 'failure' || steps.commit.outcome == 'failure'))
168+
uses: actions/github-script@v7
169+
with:
170+
script: |
171+
let errorMsg = '❌ Failed to update completion snapshots.';
172+
const runUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${process.env.GITHUB_RUN_ID}`;
173+
174+
if ('${{ steps.build.outcome }}' === 'failure') {
175+
errorMsg += ' The build failed.';
176+
} else if ('${{ steps.update.outcome }}' === 'failure') {
177+
errorMsg += ' Could not update snapshot files.';
178+
} else if ('${{ steps.commit.outcome }}' === 'failure') {
179+
errorMsg += ' Could not commit changes.';
180+
}
181+
182+
await github.rest.issues.createComment({
183+
owner: context.repo.owner,
184+
repo: context.repo.repo,
185+
issue_number: context.payload.issue.number,
186+
body: `${errorMsg} Please check [the workflow run](${runUrl}) for details.`
187+
});
188+
await github.rest.reactions.createForIssueComment({
189+
owner: context.repo.owner,
190+
repo: context.repo.repo,
191+
comment_id: context.payload.comment.id,
192+
content: 'confused'
193+
});

.github/workflows/pr-main-warning.yml

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

.github/workflows/remove-lockdown-label.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,20 @@ name: Remove Lockdown Label from PRs
22

33
on:
44
pull_request_target:
5-
types: [closed]
5+
branches:
6+
- 'release/8.*'
7+
- 'release/9.*'
8+
- 'release/10.*'
9+
- 'main'
610

711
permissions:
812
actions: write
913
pull-requests: write
1014

1115
jobs:
1216
remove-labels:
13-
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'Branding')
17+
# Only run on the main repository, not forks
18+
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'Branding') && github.repository == 'dotnet/sdk'
1419
runs-on: ubuntu-latest
1520
steps:
1621
- name: PR's only change is <VersionFeature> in eng/Versions.props

0 commit comments

Comments
 (0)