Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .azure-pipelines/generation-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -175,8 +171,6 @@ extends:
parameters:
sdl:
sourceRepositoriesToScan:
include:
- repository: kiota
exclude:
- repository: msgraph-sdk-dotnet
- repository: msgraph-beta-sdk-dotnet
Expand Down
35 changes: 18 additions & 17 deletions .azure-pipelines/generation-templates/build-and-publish-kiota.yml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we downloading from the github releases rather than installing the dotnet tool?

Also we need to use actual script for multi-line scripts not inline.

Original file line number Diff line number Diff line change
@@ -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
- 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'
5 changes: 0 additions & 5 deletions .azure-pipelines/generation-templates/download-kiota.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading