Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
3e4359a
Route update_appsettings version lookups through private Azure Artifa…
gavinbarron Jul 23, 2026
b8971bf
ci: route build_binaries NuGet restore through private feed
gavinbarron Jul 23, 2026
714018d
ci: exclude it/ integration fixtures from Component Governance scanning
gavinbarron Jul 23, 2026
622a127
fix(update-versions): use npm packument instead of /latest dist-tag path
gavinbarron Jul 23, 2026
fc51534
fix(ci): exclude it/ from Component Governance under both scan roots
gavinbarron Jul 23, 2026
96b3329
ci: add CFSClean network isolation policy
gavinbarron Jul 23, 2026
89301f6
ci: drop Permissive from network isolation policy
gavinbarron Jul 24, 2026
6b4260f
ci: add GitHub allow policy to network isolation
gavinbarron Jul 24, 2026
66d5741
ci: reorder network isolation policy to GitHub,CFSClean
gavinbarron Jul 24, 2026
d183efa
add preferred policy
gavinbarron Jul 24, 2026
93a9173
disable version update script to trace other violations
gavinbarron Jul 24, 2026
2276ff7
disable network isolation policies
gavinbarron Jul 24, 2026
6bc0f8b
ci: route ReportGenerator tool install through private feed
gavinbarron Jul 24, 2026
4ec34ed
ci: bootstrap arm64 PowerShell install via private feed
gavinbarron Jul 25, 2026
3e50f98
ci: single unconditional NuGetAuthenticate in binary job
gavinbarron Jul 25, 2026
31a6dd3
ci: remove unused it/ fixtures after checkout in all jobs
gavinbarron Jul 25, 2026
12e0b89
ci: drop redundant CG it/ exclusion and centralize privateFeedBaseUrl
gavinbarron Jul 26, 2026
ca8c979
ci: route PushDockerImage update-versions through private feed
gavinbarron Jul 26, 2026
54b0cf0
fix(scripts): only send feed OAuth token to Azure Artifacts hosts
gavinbarron Jul 26, 2026
b76f7d4
fix(scripts): use PEP 503 name normalization for PyPI simple index
gavinbarron Jul 26, 2026
cf24e73
fix(scripts): make PyPI resolver work without a PEP 700 versions array
gavinbarron Jul 26, 2026
8e38d5b
Strip known PyPI project name when parsing version from distribution …
gavinbarron Jul 26, 2026
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
93 changes: 88 additions & 5 deletions .azure-pipelines/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ variables:
IMAGE_NAME: "public/openapi/kiota"
PREVIEW_BRANCH: "refs/heads/main"
TAG: "$(Build.BuildId)"
# Base URL for the authenticated Azure Artifacts feed (GraphDeveloperExperiences_Public) used to route
# package operations (version lookups + NuGet restore) through configured upstream sources instead of
# public registries. Defined once here and referenced as $(privateFeedBaseUrl) throughout the pipeline.
# NOTE: confirm this against the feed's "Connect to Feed" dialog if the feed/org/project changes.
privateFeedBaseUrl: "https://microsoftgraph.pkgs.visualstudio.com/0985d294-5762-4bc2-a565-161ef349ca3e/_packaging/GraphDeveloperExperiences_Public"

parameters:
- name: previewBranch
Expand Down Expand Up @@ -94,6 +99,16 @@ resources:
extends:
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
parameters:
settings:
# Network isolation policy. "CFSClean" enforces Central Feed Service isolation: package restores
# are constrained to approved/authenticated feeds and direct calls to public package registries
# (nuget.org, npmjs, pypi.org, Maven Central, etc.) are blocked. "GitHub" is a shared allow policy
# that permits github.com / api.github.com (needed for the Go dependency release lookups). The
# "Permissive" base policy is intentionally omitted so other banned-endpoint calls still fail the
# run, surfacing exactly which steps egress to public registries.
# See https://aka.ms/1espt-networkisolation
# explicitly unset until we can get an approval for our required use-cases as these policies will break the build.
# networkIsolationPolicy: Preferred,GitHub,CFSClean
sdl:
sourceAnalysisPool:
name: Azure-Pipelines-1ESPT-ExDShared
Expand All @@ -118,8 +133,27 @@ extends:
clean: true
submodules: true

- pwsh: $(Build.SourcesDirectory)/scripts/update-versions.ps1
# The it/ integration-test fixtures are not used by this pipeline and their per-language
# manifests trigger Component Governance to reach public registries under network isolation.
# Remove them right after checkout so no later scan/build sees them.
- script: git -C "$(Build.SourcesDirectory)" rm -r --quiet --ignore-unmatch -- it
displayName: "Remove unused integration-test fixtures (it/)"

# Route package-version lookups through the authenticated Azure Artifacts feed
# (GraphDeveloperExperiences_Public) so CI does not call public registries directly.
# NuGet, npm, PyPI and Maven Central are configured as upstream sources on that feed.
# PHP (Packagist), Dart (pub.dev), Go (api.github.com) and Ruby (rubygems.org) have no
# Azure Artifacts upstream type, so those lookups remain on public (allow-listed) registries.
- pwsh: >
$(Build.SourcesDirectory)/scripts/update-versions.ps1
-NuGetServiceIndexUrl "$(privateFeedBaseUrl)/nuget/v3/index.json"
-NpmRegistryUrl "$(privateFeedBaseUrl)/npm/registry"
-PyPiSimpleIndexUrl "$(privateFeedBaseUrl)/pypi/simple"
Comment thread
gavinbarron marked this conversation as resolved.
-MavenRepositoryUrl "$(privateFeedBaseUrl)/maven/v1"
displayName: "Update dependencies versions"
name: update_versions
env:
FEED_ACCESS_TOKEN: $(System.AccessToken)
Comment thread
Copilot marked this conversation as resolved.
Comment thread
gavinbarron marked this conversation as resolved.

- pwsh: |
New-Item -Path $(Build.ArtifactStagingDirectory)/AppSettings -ItemType Directory -Force -Verbose
Expand Down Expand Up @@ -191,6 +225,9 @@ extends:
clean: true
submodules: true

- script: git -C "$(Build.SourcesDirectory)" rm -r --quiet --ignore-unmatch -- it
displayName: "Remove unused integration-test fixtures (it/)"

- pwsh: |
Copy-Item $(Build.ArtifactStagingDirectory)/AppSettings/appsettings.json $(Build.SourcesDirectory)/src/kiota/appsettings.json -Force -Verbose
displayName: Copy the appsettings.json
Expand Down Expand Up @@ -248,7 +285,7 @@ extends:
<configuration>
<packageSources>
<clear />
<add key="GraphDeveloperExperiences_Public" value="https://microsoftgraph.pkgs.visualstudio.com/0985d294-5762-4bc2-a565-161ef349ca3e/_packaging/GraphDeveloperExperiences_Public/nuget/v3/index.json" />
<add key="GraphDeveloperExperiences_Public" value="$(privateFeedBaseUrl)/nuget/v3/index.json" />
</packageSources>
</configuration>
"@ | Set-Content -Path "$(Build.SourcesDirectory)/nuget.config" -Encoding UTF8
Expand Down Expand Up @@ -277,9 +314,10 @@ extends:
projects: '$(Build.SourcesDirectory)\kiota.slnx'
arguments: '--configuration $(BuildConfiguration) --no-build --collect:"XPlat Code Coverage"'

- pwsh: dotnet tool install --global dotnet-reportgenerator-globaltool
- pwsh: dotnet tool install --global dotnet-reportgenerator-globaltool --configfile "$(Build.SourcesDirectory)/nuget.config"
condition: succeededOrFailed()
displayName: "Install ReportGenerator"
name: install_reportgenerator

- pwsh: reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/reports/coverage -reporttypes:"HtmlInline_AzurePipelines;Cobertura"
condition: succeeded()
Expand Down Expand Up @@ -440,6 +478,8 @@ extends:
- checkout: self
clean: true
submodules: true
- script: git -C "$(Build.SourcesDirectory)" rm -r --quiet --ignore-unmatch -- it
displayName: "Remove unused integration-test fixtures (it/)"
- task: UseDotNet@2
displayName: "Use .NET 6" # needed for ESRP signing
inputs:
Expand All @@ -455,7 +495,23 @@ extends:
inputs:
version: 9.x

- script: dotnet tool install --global PowerShell
# On arm64 (Windows) PowerShell Core is not preinstalled, so it is acquired via
# `dotnet tool install`. That restore must flow through the authenticated central feed,
# so both NuGetAuthenticate and a nuget.config have to exist *before* this step. The
# config is authored with cmd rather than pwsh because pwsh is not available yet on
# this host (that is exactly what we are bootstrapping).
- task: NuGetAuthenticate@1
displayName: "Authenticate to Azure Artifacts"
- script: |
Comment thread
gavinbarron marked this conversation as resolved.
set "CFG=$(Build.SourcesDirectory)\nuget.config"
> "%CFG%" echo ^<?xml version="1.0" encoding="utf-8"?^>
>>"%CFG%" echo ^<configuration^>
>>"%CFG%" echo ^<packageSources^>
>>"%CFG%" echo ^<clear /^>
>>"%CFG%" echo ^<add key="GraphDeveloperExperiences_Public" value="$(privateFeedBaseUrl)/nuget/v3/index.json" /^>
>>"%CFG%" echo ^</packageSources^>
>>"%CFG%" echo ^</configuration^>
dotnet tool install --global PowerShell --configfile "%CFG%"
displayName: "Install PowerShell"
condition: and(succeeded(), eq('${{ distribution.hostArchitecture }}', 'arm64'))
# powershell is not installed by default on arm64 images
Expand All @@ -470,6 +526,18 @@ extends:
- pwsh: $(Build.SourcesDirectory)/scripts/update-version-suffix-for-source-generator.ps1 -versionSuffix "$(versionSuffix)"
displayName: "Set version suffix in csproj for generators"

- pwsh: |
@"
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="GraphDeveloperExperiences_Public" value="$(privateFeedBaseUrl)/nuget/v3/index.json" />
</packageSources>
</configuration>
"@ | Set-Content -Path "$(Build.SourcesDirectory)/nuget.config" -Encoding UTF8
displayName: 'Create nuget.config (central feed)'

- 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 net10.0
condition: eq(variables['isPrerelease'], 'true')
displayName: publish kiota as executable
Expand Down Expand Up @@ -655,6 +723,8 @@ extends:
- checkout: self
clean: true
submodules: true
- script: git -C "$(Build.SourcesDirectory)" rm -r --quiet --ignore-unmatch -- it
displayName: "Remove unused integration-test fixtures (it/)"
- task: UseNode@1
inputs:
version: "22.x"
Expand Down Expand Up @@ -774,6 +844,8 @@ extends:
- checkout: self
clean: true
submodules: true
- script: git -C "$(Build.SourcesDirectory)" rm -r --quiet --ignore-unmatch -- it
displayName: "Remove unused integration-test fixtures (it/)"
- task: UseNode@1
inputs:
version: "22.x"
Expand Down Expand Up @@ -1090,6 +1162,9 @@ extends:
steps:
- checkout: self

- script: git -C "$(Build.SourcesDirectory)" rm -r --quiet --ignore-unmatch -- it
displayName: "Remove unused integration-test fixtures (it/)"

- task: AzureCLI@2
displayName: "Login to Azure Container Registry"
inputs:
Expand Down Expand Up @@ -1124,9 +1199,17 @@ extends:
displayName: "Get Kiota version number"
name: getversion

- pwsh: |
# Route package-version lookups through the authenticated Azure Artifacts feed
# (GraphDeveloperExperiences_Public) so CI does not call public registries directly.
- pwsh: >
./scripts/update-versions.ps1
-NuGetServiceIndexUrl "$(privateFeedBaseUrl)/nuget/v3/index.json"
-NpmRegistryUrl "$(privateFeedBaseUrl)/npm/registry"
-PyPiSimpleIndexUrl "$(privateFeedBaseUrl)/pypi/simple"
-MavenRepositoryUrl "$(privateFeedBaseUrl)/maven/v1"
displayName: "Update dependencies versions"
env:
FEED_ACCESS_TOKEN: $(System.AccessToken)

- script: |
docker run --privileged --rm msgraphprodregistry.azurecr.io/tonistiigi/binfmt --install all
Expand Down
Loading
Loading