diff --git a/.azure-pipelines/generation-pipeline.yml b/.azure-pipelines/generation-pipeline.yml index 39280ede9..cf9d1baa6 100644 --- a/.azure-pipelines/generation-pipeline.yml +++ b/.azure-pipelines/generation-pipeline.yml @@ -97,10 +97,6 @@ resources: type: github endpoint: microsoftgraph (22) name: microsoftgraph/microsoft-graph-docs - - repository: kiota - type: github - endpoint: microsoftkiota - name: microsoft/kiota - repository: Agents-M365Copilot type: github endpoint: microsoftkiota @@ -175,8 +171,6 @@ extends: parameters: sdl: sourceRepositoriesToScan: - include: - - repository: kiota exclude: - repository: msgraph-sdk-dotnet - repository: msgraph-beta-sdk-dotnet diff --git a/.azure-pipelines/generation-templates/build-and-publish-kiota.yml b/.azure-pipelines/generation-templates/build-and-publish-kiota.yml index 1a5a996a1..8790df160 100644 --- a/.azure-pipelines/generation-templates/build-and-publish-kiota.yml +++ b/.azure-pipelines/generation-templates/build-and-publish-kiota.yml @@ -1,18 +1,19 @@ steps: -- template: /.azure-pipelines/generation-templates/use-dotnet-sdk.yml@self - parameters: - version: "10.x" #kiota uses a net10 target - -- checkout: kiota - displayName: checkout kiota - fetchDepth: 1 - -- pwsh: dotnet build $(Build.SourcesDirectory)/src/kiota/kiota.csproj --configuration $(buildConfiguration) - displayName: 'Build Kiota' - -- task: CopyFiles@2 - inputs: - sourceFolder: '$(Build.SourcesDirectory)/src/kiota/bin/$(BuildConfiguration)/net10.0' - contents: '**/*' - targetFolder: '$(Build.ArtifactStagingDirectory)' - displayName: Copy Kiota executable \ No newline at end of file +- bash: | + RELEASE_JSON=$(curl -s "https://api.github.com/repos/microsoft/kiota/releases/latest") + LATEST_TAG=$(echo "$RELEASE_JSON" | jq -r '.tag_name') + ASSET_URL=$(echo "$RELEASE_JSON" | jq -r '.assets[] | select(.name | test("linux-x64")) | .browser_download_url') + echo "Downloading Kiota $LATEST_TAG" + echo "Asset URL: $ASSET_URL" + curl -L "$ASSET_URL" -o kiota_download + mkdir -p /tmp/kiota_extract + if [[ "$ASSET_URL" == *.zip ]]; then + unzip kiota_download -d /tmp/kiota_extract + else + tar -xzf kiota_download -C /tmp/kiota_extract + fi + KIOTA_BIN=$(find /tmp/kiota_extract -name kiota -type f | head -1) + echo "Found Kiota binary at: $KIOTA_BIN" + mkdir -p "$(Build.ArtifactStagingDirectory)" + cp "$KIOTA_BIN" "$(Build.ArtifactStagingDirectory)/kiota" + displayName: 'Download latest Kiota from GitHub' diff --git a/.azure-pipelines/generation-templates/download-kiota.yml b/.azure-pipelines/generation-templates/download-kiota.yml deleted file mode 100644 index 3ec33e096..000000000 --- a/.azure-pipelines/generation-templates/download-kiota.yml +++ /dev/null @@ -1,5 +0,0 @@ -# This Yaml Document has been converted by ESAI Yaml Pipeline Conversion Tool. -# Please make sure to check all the converted content, it is your team's responsibility to make sure that the pipeline is still valid and functions as expected. -# The 'DownloadBuildArtifacts@0' tasks have been converted to inputs within the `templateContext` section of each job. -steps: -- bash: chmod +x $(Build.SourcesDirectory)/kiota/kiota \ No newline at end of file diff --git a/.azure-pipelines/generation-templates/language-generation-kiota.yml b/.azure-pipelines/generation-templates/language-generation-kiota.yml index aedeb6c82..3c122c707 100644 --- a/.azure-pipelines/generation-templates/language-generation-kiota.yml +++ b/.azure-pipelines/generation-templates/language-generation-kiota.yml @@ -96,7 +96,7 @@ steps: Write-Warning "Kiota directory not found: $(kiotaDirectory)" } displayName: 'List files in Kiota directory' -- pwsh: '& "$(kiotaDirectory)/kiota.exe" generate --openapi "$(Build.SourcesDirectory)/msgraph-metadata/${{ parameters.cleanMetadataFolder }}/openapi.yaml" --language "${{ parameters.language }}" -o "$(kiotaDirectory)/output" -n "${{ parameters.targetNamespace }}" -c "${{ parameters.targetClassName }}" ${{ parameters.customArguments }} ${{ parameters.pathExclusionArguments }}' +- pwsh: '& "$(kiotaExecutable)" generate --openapi "$(Build.SourcesDirectory)/msgraph-metadata/${{ parameters.cleanMetadataFolder }}/openapi.yaml" --language "${{ parameters.language }}" -o "$(kiotaDirectory)/output" -n "${{ parameters.targetNamespace }}" -c "${{ parameters.targetClassName }}" ${{ parameters.customArguments }} ${{ parameters.pathExclusionArguments }}' displayName: 'Run Kiota for ${{ parameters.language }} ${{ parameters.version }}' env: KIOTA_GENERATION:EXPORTPUBLICAPI: ${{ parameters.exportDom }} diff --git a/.azure-pipelines/generation-templates/set-up-for-generation-kiota.yml b/.azure-pipelines/generation-templates/set-up-for-generation-kiota.yml index 980cad008..525ed1edd 100644 --- a/.azure-pipelines/generation-templates/set-up-for-generation-kiota.yml +++ b/.azure-pipelines/generation-templates/set-up-for-generation-kiota.yml @@ -6,7 +6,20 @@ steps: - template: /.azure-pipelines/generation-templates/set-user-config.yml@self - template: /.azure-pipelines/generation-templates/use-dotnet-sdk.yml@self parameters: - version: "10.x" #kiota uses a net10 target + version: "10.x" + +- bash: | + KIOTA_BIN=$(find "$(kiotaDirectory)" -name "kiota" -type f | head -1) + if [ -z "$KIOTA_BIN" ]; then + echo "ERROR: kiota binary not found under $(kiotaDirectory)" + echo "Directory contents:" + ls -laR "$(kiotaDirectory)" || echo "Directory does not exist" + exit 1 + fi + chmod +x "$KIOTA_BIN" + echo "Kiota binary ready at: $KIOTA_BIN" + echo "##vso[task.setvariable variable=kiotaExecutable]$KIOTA_BIN" + displayName: 'Make Kiota executable' # checkout metadata repo if capture and clean step is skipped - checkout: msgraph-metadata diff --git a/submodules/vipr b/submodules/vipr index 0921e5504..c5c220440 160000 --- a/submodules/vipr +++ b/submodules/vipr @@ -1 +1 @@ -Subproject commit 0921e550479b18d11ccccc4f21ce4c72c8170b9b +Subproject commit c5c2204400b27503a3b9fb75a36b5a3cf9ed90f0