Skip to content

Commit

Permalink
Merge branch 'main' into feat/OAI-3-1
Browse files Browse the repository at this point in the history
  • Loading branch information
baywet authored Jan 20, 2025
2 parents c7390c5 + 5a1f758 commit 269ff50
Show file tree
Hide file tree
Showing 28 changed files with 102 additions and 93 deletions.
12 changes: 6 additions & 6 deletions .azure-pipelines/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ extends:
version: 6.x

- task: UseDotNet@2
displayName: "Use .NET 8"
displayName: "Use .NET 9"
inputs:
version: 8.x
version: 9.x

# Install the nuget tool.
- task: NuGetToolInstaller@1
Expand Down Expand Up @@ -396,9 +396,9 @@ extends:
inputs:
version: 6.x
- task: UseDotNet@2
displayName: "Use .NET 8"
displayName: "Use .NET 9"
inputs:
version: 8.x
version: 9.x

- pwsh: |
Copy-Item $(Build.ArtifactStagingDirectory)/AppSettings/appsettings.json $(Build.SourcesDirectory)/src/kiota/appsettings.json -Force -Verbose
Expand All @@ -410,11 +410,11 @@ extends:
- pwsh: $(Build.SourcesDirectory)/scripts/update-version-suffix-for-source-generator.ps1 -versionSuffix "$(versionSuffix)"
displayName: "Set version suffix in csproj for generators"

- pwsh: dotnet publish src/kiota/kiota.csproj -c Release --runtime ${{ distribution.architecture }} -p:PublishSingleFile=true --self-contained --output $(Build.ArtifactStagingDirectory)/binaries/${{ distribution.architecture }} --version-suffix "$(versionSuffix)"
- pwsh: dotnet publish src/kiota/kiota.csproj -c Release --runtime ${{ distribution.architecture }} -p:PublishSingleFile=true --self-contained --output $(Build.ArtifactStagingDirectory)/binaries/${{ distribution.architecture }} --version-suffix "$(versionSuffix)" -f net9.0
condition: eq(variables['isPrerelease'], 'true')
displayName: publish kiota as executable

- pwsh: dotnet publish src/kiota/kiota.csproj -c Release --runtime ${{ distribution.architecture }} -p:PublishSingleFile=true --self-contained --output $(Build.ArtifactStagingDirectory)/binaries/${{ distribution.architecture }}
- pwsh: dotnet publish src/kiota/kiota.csproj -c Release --runtime ${{ distribution.architecture }} -p:PublishSingleFile=true --self-contained --output $(Build.ArtifactStagingDirectory)/binaries/${{ distribution.architecture }} -f net9.0
condition: eq(variables['isPrerelease'], 'false')
displayName: publish kiota as executable

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
dotnet-version: 9.x

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
dotnet-version: 9.x
- name: Restore dependencies
run: dotnet restore kiota.sln
- name: Check formatting
Expand Down Expand Up @@ -64,11 +64,11 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
dotnet-version: 9.x
- name: Restore dependencies
run: dotnet restore kiota.sln
- name: Publish ${{ matrix.os }}
run: dotnet publish ./src/kiota/kiota.csproj -c Release -p:PublishSingleFile=true -o ./${{ matrix.os }}
run: dotnet publish ./src/kiota/kiota.csproj -c Release -p:PublishSingleFile=true -o ./${{ matrix.os }} -f net9.0

- name: Upload artifact
uses: actions/upload-artifact@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/idempotency-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
dotnet-version: 9.x
- name: Restore dependencies
run: dotnet restore kiota.sln
- name: Build
run: dotnet publish ./src/kiota/kiota.csproj -c Release -p:PublishSingleFile=true -p:PublishReadyToRun=true -o ./publish
run: dotnet publish ./src/kiota/kiota.csproj -c Release -p:PublishSingleFile=true -p:PublishReadyToRun=true -o ./publish -f net9.0
# -p:PublishTrimmed=true -p:PublishAot=true should be enabled to make test run faster, but there are still limitations
- uses: actions/upload-artifact@v4
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
dotnet-version: 9.x
- name: Restore dependencies
run: dotnet restore kiota.sln
- name: Build
run: dotnet publish ./src/kiota/kiota.csproj -c Release -p:PublishSingleFile=true -p:PublishReadyToRun=true -o ./publish
run: dotnet publish ./src/kiota/kiota.csproj -c Release -p:PublishSingleFile=true -p:PublishReadyToRun=true -o ./publish -f net9.0
# -p:PublishTrimmed=true -p:PublishAot=true should be enabled to make test run faster, but there are still limitations
- uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
if: matrix.language == 'csharp'
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
dotnet-version: 9.x
- name: Setup Go
if: matrix.language == 'go'
uses: actions/setup-go@v5
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/load-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
dotnet-version: 9.x
- name: Compile the CLI in debug mode
run: |
dotnet restore ./src/kiota
Expand All @@ -59,13 +59,13 @@ jobs:
nohup sh -c "for i in 1 2 3 4 5 6 7 8 9 10; do while : ; do : ; done & done" > /dev/null 2> /dev/null &
for ((n=0;n<100;n++))
do
src/kiota/bin/Debug/net8.0/kiota generate --openapi="$(pwd)/petstore.yaml" --output=tmp --clean-output --clear-cache --language java --dvr all
src/kiota/bin/Debug/net8.0/kiota generate --openapi="$(pwd)/twitter.json" --output=tmp --clean-output --clear-cache --language java --dvr all
src/kiota/bin/Debug/net8.0/kiota generate --openapi="$(pwd)/notion.json" --output=tmp --clean-output --clear-cache --language java --dvr all
src/kiota/bin/Debug/net8.0/kiota generate --openapi="$(pwd)/stripe.json" --output=tmp --clean-output --clear-cache --language java --dvr all
src/kiota/bin/Debug/net8.0/kiota generate --openapi="$(pwd)/maps.yaml" --output=tmp --clean-output --clear-cache --language java --dvr all
src/kiota/bin/Debug/net8.0/kiota generate --openapi="$(pwd)/meraki.json" --output=tmp --clean-output --clear-cache --language java --dvr all
src/kiota/bin/Debug/net8.0/kiota generate --openapi="$(pwd)/pipedrive.yaml" --output=tmp --clean-output --clear-cache --language java --dvr all
src/kiota/bin/Debug/net8.0/kiota generate --openapi="$(pwd)/twilio.json" --output=tmp --clean-output --clear-cache --language java --dvr all
src/kiota/bin/Debug/net8.0/kiota generate --openapi="$(pwd)/docusign.json" --output=tmp --clean-output --clear-cache --language java --dvr all
src/kiota/bin/Debug/net9.0/kiota generate --openapi="$(pwd)/petstore.yaml" --output=tmp --clean-output --clear-cache --language java --dvr all
src/kiota/bin/Debug/net9.0/kiota generate --openapi="$(pwd)/twitter.json" --output=tmp --clean-output --clear-cache --language java --dvr all
src/kiota/bin/Debug/net9.0/kiota generate --openapi="$(pwd)/notion.json" --output=tmp --clean-output --clear-cache --language java --dvr all
src/kiota/bin/Debug/net9.0/kiota generate --openapi="$(pwd)/stripe.json" --output=tmp --clean-output --clear-cache --language java --dvr all
src/kiota/bin/Debug/net9.0/kiota generate --openapi="$(pwd)/maps.yaml" --output=tmp --clean-output --clear-cache --language java --dvr all
src/kiota/bin/Debug/net9.0/kiota generate --openapi="$(pwd)/meraki.json" --output=tmp --clean-output --clear-cache --language java --dvr all
src/kiota/bin/Debug/net9.0/kiota generate --openapi="$(pwd)/pipedrive.yaml" --output=tmp --clean-output --clear-cache --language java --dvr all
src/kiota/bin/Debug/net9.0/kiota generate --openapi="$(pwd)/twilio.json" --output=tmp --clean-output --clear-cache --language java --dvr all
src/kiota/bin/Debug/net9.0/kiota generate --openapi="$(pwd)/docusign.json" --output=tmp --clean-output --clear-cache --language java --dvr all
done
5 changes: 2 additions & 3 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,9 @@ jobs:
java-version: 17
- name: Setup .NET
uses: actions/setup-dotnet@v4
with: # At the moment the scanner requires dotnet 5 https://www.nuget.org/packages/dotnet-sonarscanner
with:
dotnet-version: |
5.x
8.x
9.x
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
Expand Down
44 changes: 22 additions & 22 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net8.0/kiota.dll",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net9.0/kiota.dll",
"args": [
"generate",
"--openapi",
Expand All @@ -27,7 +27,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net8.0/kiota.dll",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net9.0/kiota.dll",
"args": [
"generate",
"--openapi",
Expand All @@ -48,7 +48,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net8.0/kiota.dll",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net9.0/kiota.dll",
"args": [
"generate",
"--openapi",
Expand All @@ -69,7 +69,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net8.0/kiota.dll",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net9.0/kiota.dll",
"args": [
"generate",
"--openapi",
Expand All @@ -90,7 +90,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net8.0/kiota.dll",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net9.0/kiota.dll",
"args": [
"generate",
"--openapi",
Expand All @@ -111,7 +111,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net8.0/kiota.dll",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net9.0/kiota.dll",
"args": [
"generate",
"--openapi",
Expand All @@ -132,7 +132,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net8.0/kiota.dll",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net9.0/kiota.dll",
"args": [
"generate",
"--openapi",
Expand All @@ -154,7 +154,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net8.0/kiota.dll",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net9.0/kiota.dll",
"args": [
"generate",
"--openapi",
Expand All @@ -175,7 +175,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net8.0/kiota.dll",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net9.0/kiota.dll",
"args": [
"generate",
"--openapi",
Expand All @@ -196,7 +196,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net8.0/kiota.dll",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net9.0/kiota.dll",
"args": [
"generate",
"--openapi",
Expand All @@ -216,7 +216,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net8.0/kiota.dll",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net9.0/kiota.dll",
"args": [
"search",
"microsoft"
Expand All @@ -230,7 +230,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net8.0/kiota.dll",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net9.0/kiota.dll",
"args": [
"search",
"test"
Expand All @@ -244,7 +244,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net8.0/kiota.dll",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net9.0/kiota.dll",
"args": [
"show",
"-d",
Expand All @@ -259,12 +259,12 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net8.0/kiota.dll",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net9.0/kiota.dll",
"args": [
"download",
"msgraph::microsoft-graph",
"-o",
"${workspaceFolder}/src/kiota/bin/Debug/net8.0/graphv1.yml"
"${workspaceFolder}/src/kiota/bin/Debug/net9.0/graphv1.yml"
],
"cwd": "${workspaceFolder}/src/kiota",
"console": "internalConsole",
Expand All @@ -275,7 +275,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net8.0/kiota.dll",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net9.0/kiota.dll",
"args": [
"info",
"-l",
Expand All @@ -290,7 +290,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net8.0/kiota.dll",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net9.0/kiota.dll",
"args": [
"update",
"-o",
Expand All @@ -305,7 +305,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net8.0/kiota.dll",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net9.0/kiota.dll",
"args": [
"workspace",
"migrate"
Expand All @@ -322,7 +322,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net8.0/kiota.dll",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net9.0/kiota.dll",
"args": [
"client",
"generate"
Expand All @@ -339,7 +339,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net8.0/kiota.dll",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net9.0/kiota.dll",
"args": [
"client",
"edit",
Expand All @@ -360,7 +360,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net8.0/kiota.dll",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net9.0/kiota.dll",
"args": [
"plugin",
"add",
Expand Down Expand Up @@ -389,7 +389,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net8.0/kiota.dll",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net9.0/kiota.dll",
"args": [
"login",
"github",
Expand Down
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0 AS build-env
ARG version_suffix
WORKDIR /app

COPY ./src ./kiota/src
COPY ./resources ./kiota/resources
WORKDIR /app/kiota
RUN if [ -z "$version_suffix" ]; then \
dotnet publish ./src/kiota/kiota.csproj -c Release -p:TreatWarningsAsErrors=false; \
dotnet publish ./src/kiota/kiota.csproj -c Release -p:TreatWarningsAsErrors=false -f net9.0; \
else \
dotnet publish ./src/kiota/kiota.csproj -c Release -p:TreatWarningsAsErrors=false --version-suffix "$version_suffix"; \
dotnet publish ./src/kiota/kiota.csproj -c Release -p:TreatWarningsAsErrors=false -f net9.0 --version-suffix "$version_suffix"; \
fi

FROM mcr.microsoft.com/dotnet/runtime:8.0-jammy-chiseled AS runtime
FROM mcr.microsoft.com/dotnet/runtime:9.0-noble-chiseled AS runtime
WORKDIR /app

COPY --from=build-env /app/kiota/src/kiota/bin/Release/net8.0 ./
COPY --from=build-env /app/kiota/src/kiota/bin/Release/net9.0 ./

VOLUME /app/output
VOLUME /app/openapi.yaml
Expand Down
2 changes: 1 addition & 1 deletion it/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Run the following steps to locally run the integration tests.
Publish locally a development version of `kiota`:

```bash
dotnet publish ./src/kiota/kiota.csproj -c Release -p:PublishSingleFile=true -p:PublishReadyToRun=true -o ./publish
dotnet publish ./src/kiota/kiota.csproj -c Release -p:PublishSingleFile=true -p:PublishReadyToRun=true -o ./publish -f net9.0
```

Generate the code:
Expand Down
2 changes: 1 addition & 1 deletion it/csharp/basic/basic.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand Down
2 changes: 1 addition & 1 deletion it/csharp/dotnet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>App</RootNamespace>
Expand Down
Loading

0 comments on commit 269ff50

Please sign in to comment.