From ba7a18773b07b27e083713e7530f381b2ca8cc53 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 14 Nov 2023 15:22:41 -0500 Subject: [PATCH 1/7] - removes obsolete dev container configuration --- .devcontainer/Dockerfile | 16 -------- .devcontainer/devcontainer.json | 73 --------------------------------- 2 files changed, 89 deletions(-) delete mode 100644 .devcontainer/Dockerfile delete mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index 556404d4..00000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/dotnet/.devcontainer/base.Dockerfile - -# [Choice] .NET version: 6.0, 3.1, 6.0-bullseye, 3.1-bullseye, 6.0-focal, 3.1-focal -ARG VARIANT="6.0-bullseye-slim" -FROM mcr.microsoft.com/vscode/devcontainers/dotnet:0-${VARIANT} - -# [Choice] Node.js version: none, lts/*, 18, 16, 14 -ARG NODE_VERSION="none" -RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi - -# [Optional] Uncomment this section to install additional OS packages. -# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ -# && apt-get -y install --no-install-recommends - -# [Optional] Uncomment this line to install global node packages. -# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g " 2>&1 \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index 7434900c..00000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,73 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: -// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/dotnet -{ - "name": "C# (.NET)", - "build": { - "dockerfile": "Dockerfile", - "args": { - // Update 'VARIANT' to pick a .NET Core version: 3.1, 6.0 - // Append -bullseye or -focal to pin to an OS version. - "VARIANT": "6.0-bullseye", - // Options - "NODE_VERSION": "lts/*" - } - }, - - // Configure tool-specific properties. - "customizations": { - // Configure properties specific to VS Code. - "vscode": { - // Add the IDs of extensions you want installed when the container is created. - "extensions": [ - "ms-dotnettools.csharp", - "formulahendry.dotnet-test-explorer", - "ms-azure-devops.azure-pipelines", - "streetsidesoftware.code-spell-checker", - "EditorConfig.EditorConfig", - "donjayamanne.githistory", - "cschleiden.vscode-github-actions", - "GitHub.copilot", - "GitHub.vscode-pull-request-github", - "ms-vsliveshare.vsliveshare", - "esbenp.prettier-vscode" - ] - } - }, - - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [5000, 5001], - - // [Optional] To reuse of your local HTTPS dev cert: - // - // 1. Export it locally using this command: - // * Windows PowerShell: - // dotnet dev-certs https --trust; dotnet dev-certs https -ep "$env:USERPROFILE/.aspnet/https/aspnetapp.pfx" -p "SecurePwdGoesHere" - // * macOS/Linux terminal: - // dotnet dev-certs https --trust; dotnet dev-certs https -ep "${HOME}/.aspnet/https/aspnetapp.pfx" -p "SecurePwdGoesHere" - // - // 2. Uncomment these 'remoteEnv' lines: - // "remoteEnv": { - // "ASPNETCORE_Kestrel__Certificates__Default__Password": "SecurePwdGoesHere", - // "ASPNETCORE_Kestrel__Certificates__Default__Path": "/home/vscode/.aspnet/https/aspnetapp.pfx", - // }, - // - // 3. Do one of the following depending on your scenario: - // * When using GitHub Codespaces and/or Remote - Containers: - // 1. Start the container - // 2. Drag ~/.aspnet/https/aspnetapp.pfx into the root of the file explorer - // 3. Open a terminal in VS Code and run "mkdir -p /home/vscode/.aspnet/https && mv aspnetapp.pfx /home/vscode/.aspnet/https" - // - // * If only using Remote - Containers with a local container, uncomment this line instead: - // "mounts": [ "source=${env:HOME}${env:USERPROFILE}/.aspnet/https,target=/home/vscode/.aspnet/https,type=bind" ], - - // Use 'postCreateCommand' to run commands after the container is created. - // "postCreateCommand": "dotnet restore", - - // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. - "remoteUser": "vscode", - "features": { - "github-cli": "latest", - "powershell": "latest" - }, - "postStartCommand": "git config gpg.program gpg" // in case commits sign in is configured on windows and mapped to the gpg4win proc. To reset (when starting locally) `git config --unset gpg.program -} From 852a29a754b318b466d9841a28616a9a88b64d3b Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 14 Nov 2023 15:23:00 -0500 Subject: [PATCH 2/7] - upgrades to dotnet 8 --- .github/workflows/build-and-test.yml | 10 ++-- .github/workflows/sonarcloud.yml | 28 +++++------ .vscode/launch.json | 50 +++++++++---------- .../Microsoft.Kiota.Abstractions.Tests.csproj | 7 +-- src/Microsoft.Kiota.Abstractions.csproj | 9 ++-- 5 files changed, 50 insertions(+), 54 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index bb4d3e01..c809c7f5 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -3,21 +3,21 @@ name: Build and Test on: workflow_dispatch: push: - branches: [ 'main', 'dev', 'feature/*' ] + branches: ["main", "dev", "feature/*"] pull_request: - branches: [ 'main', 'dev' ] + branches: ["main", "dev"] jobs: build-and-test: - runs-on: windows-latest # Temporary switch to windows till https://github.com/microsoft/vstest/issues/4549 is released in dotnet version after 7.0.400 + runs-on: ubuntu-latest env: solutionName: Microsoft.Kiota.Abstractions.sln steps: - uses: actions/checkout@v4 - name: Setup .NET - uses: actions/setup-dotnet@v3.0.3 + uses: actions/setup-dotnet@v3 with: - dotnet-version: 6.0.x + dotnet-version: 8.x - name: Initialize CodeQL uses: github/codeql-action/init@v2 with: diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 9ee49bc2..a2c7e947 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -4,10 +4,10 @@ on: push: branches: - main - paths-ignore: ['.vscode/**'] + paths-ignore: [".vscode/**"] pull_request: types: [opened, synchronize, reopened] - paths-ignore: ['.vscode/**'] + paths-ignore: [".vscode/**"] env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} @@ -22,7 +22,7 @@ jobs: - name: Check whether unity activation requests should be done id: checksecret_job run: | - echo "is_SONAR_TOKEN_set=${{ env.SONAR_TOKEN != '' }}" >> $GITHUB_OUTPUT + echo "is_SONAR_TOKEN_set=${{ env.SONAR_TOKEN != '' }}" >> $GITHUB_OUTPUT build: needs: [checksecret] if: needs.checksecret.outputs.is_SONAR_TOKEN_set == 'true' @@ -32,19 +32,17 @@ jobs: - name: Set up JDK 17 uses: actions/setup-java@v3 with: - distribution: 'adopt' + distribution: "adopt" java-version: 17 - - name: Setup .NET 5 # At the moment the scanner requires dotnet 5 https://www.nuget.org/packages/dotnet-sonarscanner - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 5.0.x - name: Setup .NET uses: actions/setup-dotnet@v3 - with: - dotnet-version: 7.0.x + with: # At the moment the scanner requires dotnet 5 https://www.nuget.org/packages/dotnet-sonarscanner + dotnet-version: | + 5.x + 8.x - uses: actions/checkout@v4 with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - name: Cache SonarCloud packages uses: actions/cache@v3 with: @@ -66,13 +64,13 @@ jobs: dotnet tool update dotnet-sonarscanner --tool-path ./.sonar/scanner - name: Build and analyze env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any CollectCoverage: true - CoverletOutputFormat: 'opencover' # https://github.com/microsoft/vstest/issues/4014#issuecomment-1307913682 + CoverletOutputFormat: "opencover" # https://github.com/microsoft/vstest/issues/4014#issuecomment-1307913682 shell: pwsh run: | - ./.sonar/scanner/dotnet-sonarscanner begin /k:"microsoft_kiota-abstractions-dotnet" /o:"microsoft" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="Microsoft.Kiota.Abstractions.Tests/coverage.net6.0.opencover.xml" + ./.sonar/scanner/dotnet-sonarscanner begin /k:"microsoft_kiota-abstractions-dotnet" /o:"microsoft" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="Microsoft.Kiota.Abstractions.Tests/coverage.net8.0.opencover.xml" dotnet workload restore dotnet build dotnet test Microsoft.Kiota.Abstractions.sln --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover - ./.sonar/scanner/dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}" \ No newline at end of file + ./.sonar/scanner/dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}" diff --git a/.vscode/launch.json b/.vscode/launch.json index fa5e7f88..13e514aa 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,26 +1,26 @@ { - "version": "0.2.0", - "configurations": [ - { - // Use IntelliSense to find out which attributes exist for C# debugging - // Use hover for the description of the existing attributes - // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md - "name": ".NET Core Launch (console)", - "type": "coreclr", - "request": "launch", - "preLaunchTask": "build", - // If you have changed target frameworks, make sure to update the program path. - "program": "${workspaceFolder}/Microsoft.Kiota.Abstractions.Tests/bin/Debug/net6.0/Microsoft.Kiota.Abstractions.Tests.dll", - "args": [], - "cwd": "${workspaceFolder}/Microsoft.Kiota.Abstractions.Tests", - // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console - "console": "internalConsole", - "stopAtEntry": false - }, - { - "name": ".NET Core Attach", - "type": "coreclr", - "request": "attach" - } - ] -} \ No newline at end of file + "version": "0.2.0", + "configurations": [ + { + // Use IntelliSense to find out which attributes exist for C# debugging + // Use hover for the description of the existing attributes + // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md + "name": ".NET Core Launch (console)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + // If you have changed target frameworks, make sure to update the program path. + "program": "${workspaceFolder}/Microsoft.Kiota.Abstractions.Tests/bin/Debug/net8.0/Microsoft.Kiota.Abstractions.Tests.dll", + "args": [], + "cwd": "${workspaceFolder}/Microsoft.Kiota.Abstractions.Tests", + // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console + "console": "internalConsole", + "stopAtEntry": false + }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach" + } + ] +} diff --git a/Microsoft.Kiota.Abstractions.Tests/Microsoft.Kiota.Abstractions.Tests.csproj b/Microsoft.Kiota.Abstractions.Tests/Microsoft.Kiota.Abstractions.Tests.csproj index 55224b7f..ff0d2113 100644 --- a/Microsoft.Kiota.Abstractions.Tests/Microsoft.Kiota.Abstractions.Tests.csproj +++ b/Microsoft.Kiota.Abstractions.Tests/Microsoft.Kiota.Abstractions.Tests.csproj @@ -2,7 +2,7 @@ false - net462;net6.0 + net462;net8.0 latest Library true @@ -14,7 +14,8 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + @@ -32,4 +33,4 @@ - + \ No newline at end of file diff --git a/src/Microsoft.Kiota.Abstractions.csproj b/src/Microsoft.Kiota.Abstractions.csproj index 5b232d2d..f0cd2cad 100644 --- a/src/Microsoft.Kiota.Abstractions.csproj +++ b/src/Microsoft.Kiota.Abstractions.csproj @@ -23,7 +23,6 @@ true latest enable - true true @@ -34,16 +33,14 @@ LICENSE README.md $(NoWarn);NU5048;NETSDK1138 + + true - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - + From 729dfd0e9f4ffbcfb8ea8327cdaf5b032cc0b590 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 14 Nov 2023 15:23:36 -0500 Subject: [PATCH 3/7] - bumps patch version --- CHANGELOG.md | 6 ++++++ src/Microsoft.Kiota.Abstractions.csproj | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da4f3f6c..b3ee3a2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.7.2] - 2023-11-14 + +### Added + +- Added support for dotnet 8. + ## [1.7.1] - 2023-11-13 ### Changed diff --git a/src/Microsoft.Kiota.Abstractions.csproj b/src/Microsoft.Kiota.Abstractions.csproj index f0cd2cad..508425e5 100644 --- a/src/Microsoft.Kiota.Abstractions.csproj +++ b/src/Microsoft.Kiota.Abstractions.csproj @@ -14,7 +14,7 @@ https://aka.ms/kiota/docs true true - 1.7.1 + 1.7.2 true false From be32e1c1bbab5292c0022a89b9ec8daa6e8fcddf Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 14 Nov 2023 15:29:08 -0500 Subject: [PATCH 4/7] - bumps net version for ADO pipeline Signed-off-by: Vincent Biret --- .azure-pipelines/ci-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index 4c0449b4..af5ef50c 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -32,7 +32,7 @@ stages: - task: UseDotNet@2 displayName: 'Use .NET 6' inputs: - version: 6.x + version: 8.x - task: PoliCheck@2 displayName: 'Run PoliCheck "/src"' @@ -75,7 +75,7 @@ stages: inputs: command: test projects: '$(Build.SourcesDirectory)\Microsoft.Kiota.Abstractions.sln' - arguments: '--configuration $(BuildConfiguration) --no-build --framework net6.0' + arguments: '--configuration $(BuildConfiguration) --no-build --framework net8.0' # CredScan - task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@3 From f7944f853fdb8ca60e4fe23bd43d65cf9476908b Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 14 Nov 2023 15:37:57 -0500 Subject: [PATCH 5/7] - reverts change to ubuntu runner Signed-off-by: Vincent Biret --- .github/workflows/build-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index c809c7f5..a91938bc 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -9,7 +9,7 @@ on: jobs: build-and-test: - runs-on: ubuntu-latest + runs-on: windows-latest env: solutionName: Microsoft.Kiota.Abstractions.sln steps: From a458944235336c6f90da4bcc0d94da3efbb5b0c6 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 14 Nov 2023 15:46:17 -0500 Subject: [PATCH 6/7] - adds dotnet 6 for ESRP tasks Signed-off-by: Vincent Biret --- .azure-pipelines/ci-build.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index af5ef50c..ddb64b07 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -29,8 +29,13 @@ stages: - job: build steps: + - task: UseDotNet@2 # needed for ESRP sign + displayName: 'Use .NET 8' + inputs: + version: 6.x + - task: UseDotNet@2 - displayName: 'Use .NET 6' + displayName: 'Use .NET 8' inputs: version: 8.x From 5485afa0f9ece96aac2d7747ebc21788bfd95e6c Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Wed, 15 Nov 2023 09:37:03 +0300 Subject: [PATCH 7/7] PR review feedback --- .azure-pipelines/ci-build.yml | 2 +- .github/workflows/build-and-test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index ddb64b07..acd78c28 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -30,7 +30,7 @@ stages: steps: - task: UseDotNet@2 # needed for ESRP sign - displayName: 'Use .NET 8' + displayName: 'Use .NET 6' inputs: version: 6.x diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index a91938bc..c809c7f5 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -9,7 +9,7 @@ on: jobs: build-and-test: - runs-on: windows-latest + runs-on: ubuntu-latest env: solutionName: Microsoft.Kiota.Abstractions.sln steps: