Skip to content

Commit a49e70d

Browse files
gavinbarronCopilot
andcommitted
Fix typewriter/kiota CFS nuget.config ordering (CFSClean)
The typewriter/kiota nuget.config was created in the job before build-and-publish-typewriter.yml runs 'checkout: self', which cleans the sources dir and wiped the untracked config -> dotnet build restored from nuget.org (22 api.nuget.org hits in build_and_publish_typewriter). Move the CFS config creation to the reusable create-cfs-nuget-config.yml (writes to Agent.TempDirectory, checkout-proof). For typewriter, create it AFTER 'checkout: self' and restore via -p:RestoreConfigFile. For kiota, pass --configfile to the tool install. Remove the now-redundant inline NuGetAuthenticate/create-config steps from generation-pipeline.yml. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d3f8fec7-b00b-46be-ba39-7e1f3e7f7188
1 parent bd8a781 commit a49e70d

3 files changed

Lines changed: 8 additions & 30 deletions

File tree

‎.azure-pipelines/generation-pipeline.yml‎

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -201,20 +201,6 @@ extends:
201201
targetPath: '$(Build.ArtifactStagingDirectory)'
202202
artifactName: typewriter
203203
steps:
204-
- task: NuGetAuthenticate@1
205-
displayName: 'Authenticate to Azure Artifacts'
206-
207-
- pwsh: |
208-
@"
209-
<?xml version="1.0" encoding="utf-8"?>
210-
<configuration>
211-
<packageSources>
212-
<clear />
213-
<add key="GraphDeveloperExperiences_Public" value="https://microsoftgraph.pkgs.visualstudio.com/0985d294-5762-4bc2-a565-161ef349ca3e/_packaging/GraphDeveloperExperiences_Public/nuget/v3/index.json" />
214-
</packageSources>
215-
</configuration>
216-
"@ | Set-Content -Path "$(Build.SourcesDirectory)/nuget.config" -Encoding UTF8
217-
displayName: 'Create nuget.config (central feed)'
218204
- template: /.azure-pipelines/generation-templates/build-and-publish-typewriter.yml@self
219205
- stage: stage_build_and_publish_kiota
220206
dependsOn: [] # remove the implicit dependency to any previous stage
@@ -226,20 +212,7 @@ extends:
226212
targetPath: '$(Build.ArtifactStagingDirectory)'
227213
artifactName: kiota
228214
steps:
229-
- task: NuGetAuthenticate@1
230-
displayName: 'Authenticate to Azure Artifacts'
231-
232-
- pwsh: |
233-
@"
234-
<?xml version="1.0" encoding="utf-8"?>
235-
<configuration>
236-
<packageSources>
237-
<clear />
238-
<add key="GraphDeveloperExperiences_Public" value="https://microsoftgraph.pkgs.visualstudio.com/0985d294-5762-4bc2-a565-161ef349ca3e/_packaging/GraphDeveloperExperiences_Public/nuget/v3/index.json" />
239-
</packageSources>
240-
</configuration>
241-
"@ | Set-Content -Path "$(Build.SourcesDirectory)/nuget.config" -Encoding UTF8
242-
displayName: 'Create nuget.config (central feed)'
215+
- template: /.azure-pipelines/generation-templates/create-cfs-nuget-config.yml@self
243216
- template: /.azure-pipelines/generation-templates/build-and-publish-kiota.yml@self
244217
# Downloads the latest public beta metadata. If there are changes, we checkin
245218
# the public metadata into microsoftgraph/msgraph-metadata, and then run the
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
steps:
22
- pwsh: |
33
dotnet tool install Microsoft.OpenApi.Kiota `
4-
--tool-path "$(Build.ArtifactStagingDirectory)"
4+
--tool-path "$(Build.ArtifactStagingDirectory)" `
5+
--configfile "$(Agent.TempDirectory)/nuget.config"
56
displayName: 'Install Kiota via dotnet tool'

‎.azure-pipelines/generation-templates/build-and-publish-typewriter.yml‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ steps:
66
submodules: recursive
77
persistCredentials: true
88

9-
- pwsh: dotnet build $(Build.SourcesDirectory)/src/Typewriter/Typewriter.csproj --configuration $(buildConfiguration)
9+
# Create the CFS nuget.config AFTER checkout (a checkout clean would wipe a config written
10+
# into the sources dir) and restore against it, so dotnet build does not reach nuget.org.
11+
- template: /.azure-pipelines/generation-templates/create-cfs-nuget-config.yml@self
12+
13+
- pwsh: dotnet build $(Build.SourcesDirectory)/src/Typewriter/Typewriter.csproj --configuration $(buildConfiguration) -p:RestoreConfigFile="$(Agent.TempDirectory)/nuget.config"
1014
displayName: 'Build Typewriter'
1115

1216
- task: CopyFiles@2

0 commit comments

Comments
 (0)