diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index f06bc4ca2..792d7e861 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,5 +1,5 @@ # Refer to https://hub.docker.com/_/microsoft-dotnet-sdk for available versions -FROM mcr.microsoft.com/dotnet/sdk:9.0.301-noble@sha256:4fd7d3e5aeb6cfb75e923a54cdb0b6e858b27ad3b517837917c57c2e632b5694 +FROM mcr.microsoft.com/dotnet/sdk:9.0.304-noble@sha256:1f7ccf88e076bc1cb1ddbd81959fb55b886b01851b092867bb7a638435fa1f1f # Installing mono makes `dotnet test` work without errors even for net472. # But installing it takes a long time, so it's excluded by default. diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 000000000..085935029 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,23 @@ +# Copilot instructions for this repository + +## High level guidance + +* Review the `CONTRIBUTING.md` file for instructions to build and test the software. +* Set the `NBGV_GitEngine` environment variable to `Disabled` before running any `dotnet` or `msbuild` commands. + +## Software Design + +* Design APIs to be highly testable, and all functionality should be tested. +* Avoid introducing binary breaking changes in public APIs of projects under `src` unless their project files have `IsPackable` set to `false`. + +## Testing + +* There should generally be one test project (under the `test` directory) per shipping project (under the `src` directory). Test projects are named after the project being tested with a `.Test` suffix. +* Tests should use the Xunit testing framework. +* Some tests are known to be unstable. When running tests, you should skip the unstable ones by running `dotnet test --filter "TestCategory!=FailsInCloudTest"`. + +## Coding style + +* Honor StyleCop rules and fix any reported build warnings *after* getting tests to pass. +* In C# files, use namespace *statements* instead of namespace *blocks* for all new files. +* Add API doc comments to all new public and internal members. diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 053f56e95..eb69d92e8 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -26,7 +26,7 @@ jobs: # You can define any steps you want, and they will run before the agent starts. # If you do not check out your code, Copilot will do this for you. steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 with: fetch-depth: 0 # avoid shallow clone so nbgv can do its work. - name: ⚙ Install prerequisites diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0a8f8215d..6454d3c54 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -25,7 +25,7 @@ jobs: url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 with: fetch-depth: 0 # avoid shallow clone so nbgv can do its work. - name: ⚙ Install prerequisites diff --git a/.github/workflows/docs_validate.yml b/.github/workflows/docs_validate.yml index 2084849e8..ec87d32aa 100644 --- a/.github/workflows/docs_validate.yml +++ b/.github/workflows/docs_validate.yml @@ -17,7 +17,7 @@ jobs: with: fetch-depth: 0 # avoid shallow clone so nbgv can do its work. - name: 🔗 Markup Link Checker (mlc) - uses: becheran/mlc@88c9db09b8dabab813a2edd13f955b36aa73657a # v0.22.0 + uses: becheran/mlc@18a06b3aa2901ca197de59c8b0b1f54fdba6b3fa # v1.0.0 with: args: --do-not-warn-for-redirect-to https://learn.microsoft.com*,https://dotnet.microsoft.com/*,https://dev.azure.com/*,https://app.codecov.io/*,https://microsoft.github.io/vs-threading/* -p docfx -i https://aka.ms/onboardsupport,https://aka.ms/spot,https://msrc.microsoft.com/*,https://www.microsoft.com/msrc*,https://microsoft.com/msrc* - name: ⚙ Install prerequisites diff --git a/.github/workflows/libtemplate-update.yml b/.github/workflows/libtemplate-update.yml index 7d0a67a0b..f5cf8666f 100644 --- a/.github/workflows/libtemplate-update.yml +++ b/.github/workflows/libtemplate-update.yml @@ -17,7 +17,7 @@ jobs: contents: write pull-requests: write steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 with: fetch-depth: 0 # avoid shallow clone so nbgv can do its work. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d0f1002ba..ef7e28724 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -56,9 +56,9 @@ Push the tag. When your repo is hosted by GitHub and you are using GitHub Actions, you should create a GitHub Release using the standard GitHub UI. Having previously used `nbgv tag` and pushing the tag will help you identify the precise commit and name to use for this release. -After publishing the release, the `.github\workflows\release.yml` workflow will be automatically triggered, which will: +After publishing the release, the `.github/workflows/release.yml` workflow will be automatically triggered, which will: -1. Find the most recent `.github\workflows\build.yml` GitHub workflow run of the tagged release. +1. Find the most recent `.github/workflows/build.yml` GitHub workflow run of the tagged release. 1. Upload the `deployables` artifact from that workflow run to your GitHub Release. 1. If you have `NUGET_API_KEY` defined as a secret variable for your repo or org, any nuget packages in the `deployables` artifact will be pushed to nuget.org. @@ -95,7 +95,7 @@ The best way to keep your repo in sync with Library.Template's evolving features ```ps1 git fetch git checkout origin/main -.\tools\MergeFrom-Template.ps1 +./tools/MergeFrom-Template.ps1 # resolve any conflicts, then commit the merge commit. git push origin -u HEAD ``` diff --git a/CodeQL.yml b/CodeQL.yml new file mode 100644 index 000000000..903500b55 --- /dev/null +++ b/CodeQL.yml @@ -0,0 +1,3 @@ +path_classifiers: + library: + - 'test/**' diff --git a/Directory.Packages.props b/Directory.Packages.props index b8d1c8d88..ebd7572ad 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,7 +5,7 @@ true true 2.5.198 - 2.0.198 + 2.0.199 4.14.0 4.14.0 17.14.15 @@ -58,8 +58,8 @@ - - + + diff --git a/azure-pipelines/build.yml b/azure-pipelines/build.yml index a957e2136..88b7adc3f 100644 --- a/azure-pipelines/build.yml +++ b/azure-pipelines/build.yml @@ -248,6 +248,7 @@ jobs: parameters: Is1ESPT: ${{ parameters.Is1ESPT }} RunTests: ${{ parameters.RunTests }} + BuildRequiresAccessToken: ${{ parameters.RealSign }} # Real signing on non-Windows machines requires passing through access token to build steps that sign osRID: linux - ${{ if parameters.EnableDotNetFormatCheck }}: - script: dotnet format --verify-no-changes --exclude test/NativeAOTCompatibility.Test @@ -284,6 +285,7 @@ jobs: parameters: Is1ESPT: ${{ parameters.Is1ESPT }} RunTests: ${{ parameters.RunTests }} + BuildRequiresAccessToken: ${{ parameters.RealSign }} # Real signing on non-Windows machines requires passing through access token to build steps that sign osRID: osx - job: WrapUp diff --git a/azure-pipelines/dotnet.yml b/azure-pipelines/dotnet.yml index 7e9e25a83..f8b02c9be 100644 --- a/azure-pipelines/dotnet.yml +++ b/azure-pipelines/dotnet.yml @@ -7,11 +7,17 @@ parameters: default: false - name: Is1ESPT type: boolean +- name: BuildRequiresAccessToken + type: boolean + default: false steps: - script: dotnet build -t:build,pack --no-restore -c $(BuildConfiguration) -warnAsError -warnNotAsError:NU1901,NU1902,NU1903,NU1904,LOCTASK002 /bl:"$(Build.ArtifactStagingDirectory)/build_logs/build.binlog" displayName: 🛠 dotnet build + ${{ if parameters.BuildRequiresAccessToken }}: + env: + SYSTEM_ACCESSTOKEN: $(System.AccessToken) - ${{ if not(parameters.IsOptProf) }}: - powershell: tools/dotnet-test-cloud.ps1 -Configuration $(BuildConfiguration) -Agent $(Agent.JobName) -PublishResults diff --git a/azure-pipelines/libtemplate-update.yml b/azure-pipelines/libtemplate-update.yml index 3d7fb7e3b..384be7cfc 100644 --- a/azure-pipelines/libtemplate-update.yml +++ b/azure-pipelines/libtemplate-update.yml @@ -35,6 +35,8 @@ extends: name: AzurePipelines-EO demands: - ImageOverride -equals 1ESPT-Windows2022 + credscan: + enabled: false stages: - stage: Merge diff --git a/azure-pipelines/microbuild.before.yml b/azure-pipelines/microbuild.before.yml index 250715369..d09310b1e 100644 --- a/azure-pipelines/microbuild.before.yml +++ b/azure-pipelines/microbuild.before.yml @@ -17,9 +17,9 @@ parameters: steps: - ${{ if and(not(parameters.IsOptProf), ne(variables['Build.Reason'], 'PullRequest')) }}: # notice@0 requires CG detection to run first, and non-default branches don't inject it automatically. - - ${{ if ne(variables['Build.SourceBranch'], 'refs/heads/main') }}: - - task: ComponentGovernanceComponentDetection@0 - displayName: 🔍 Component Detection + # default branch injection (main) is happening too late for notice@0 to run successfully. Adding this as a workaround. + - task: ComponentGovernanceComponentDetection@0 + displayName: 🔍 Component Detection - task: notice@0 displayName: 🛠️ Generate NOTICE file diff --git a/azure-pipelines/unofficial.yml b/azure-pipelines/unofficial.yml index 127ca2c00..65a38adfd 100644 --- a/azure-pipelines/unofficial.yml +++ b/azure-pipelines/unofficial.yml @@ -58,6 +58,8 @@ extends: parameters: sdl: sourceAnalysisPool: VSEngSS-MicroBuild2022-1ES + credscan: + enabled: false suppression: suppressionFile: $(System.DefaultWorkingDirectory)\azure-pipelines\falsepositives.gdnsuppress enableProductionSDL: ${{ parameters.EnableProductionSDL }} diff --git a/azure-pipelines/vs-validation.yml b/azure-pipelines/vs-validation.yml index 3a40395e7..b9d46b7c7 100644 --- a/azure-pipelines/vs-validation.yml +++ b/azure-pipelines/vs-validation.yml @@ -28,6 +28,8 @@ extends: parameters: sdl: sourceAnalysisPool: VSEngSS-MicroBuild2022-1ES + credscan: + enabled: false stages: - stage: Build diff --git a/global.json b/global.json index a4a4b8c46..f8dd2c724 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "9.0.301", + "version": "9.0.304", "rollForward": "patch", "allowPrerelease": false },