Skip to content

Commit 47c70cc

Browse files
committed
Merge branch 'feat/add-ccs-sdks' of https://github.com/microsoftgraph/MSGraph-SDK-Code-Generator into feat/add-ccs-sdks
2 parents f0f163b + e3ee2f4 commit 47c70cc

7 files changed

Lines changed: 38 additions & 6 deletions

File tree

.azure-pipelines/generation-pipeline.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,7 @@ stages:
845845
customArguments: "-b -i '**/copilot/**'" # Enable the backing store, include only copilot paths
846846
cleanMetadataFolder: $(cleanOpenAPIFolderBeta)
847847
pathExclusionArguments: ''
848+
isCopilotGeneration: true
848849
languageSpecificSteps:
849850
- template: generation-templates/dotnet-kiota.yml
850851
parameters:
@@ -878,6 +879,7 @@ stages:
878879
cleanMetadataFolder: $(cleanOpenAPIFolderBeta)
879880
commitMessagePrefix: "feat(generation): update request builders and models"
880881
pathExclusionArguments: ''
882+
isCopilotGeneration: true
881883
languageSpecificSteps:
882884
- template: generation-templates/python.yml
883885
parameters:
@@ -911,6 +913,7 @@ stages:
911913
customArguments: "-b -i '**/copilot/**'" # Enable the backing store, include only copilot paths
912914
cleanMetadataFolder: $(cleanOpenAPIFolderBeta)
913915
pathExclusionArguments: ''
916+
isCopilotGeneration: true
914917
languageSpecificSteps:
915918
- template: generation-templates/ccs-typescript-sdk.yml
916919
parameters:
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
parameters:
22
- name: repoName
33
type: string
4+
- name: packageName
5+
type: string
6+
default: '@microsoft/copilot-beta-sdk'
47

58
steps:
6-
- pwsh: '$(scriptsDirectory)/copy-ccs-typescript-sdk-models.ps1 -sourceDirectory "$(kiotaDirectory)/output/" -targetDirectory "$(Build.SourcesDirectory)/${{ parameters.repoName }}/packages/"'
9+
- pwsh: '$(scriptsDirectory)/clean-typescript-files.ps1 -targetDirectory "$(Build.SourcesDirectory)/${{ parameters.repoName }}/packages/" -packageName "${{ parameters.packageName }}"'
10+
displayName: 'Remove generated models and requests from the repo folder'
11+
12+
- pwsh: '$(scriptsDirectory)/copy-ccs-typescript-sdk-models.ps1 -sourceDirectory "$(kiotaDirectory)/output/*" -targetDirectory "$(Build.SourcesDirectory)/${{ parameters.repoName }}/packages/"'
713
displayName: "Update models"

.azure-pipelines/generation-templates/language-generation-kiota.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ parameters:
4040
type: boolean
4141
displayName: Generate PR after publish changes?
4242

43+
- name: isCopilotGeneration
44+
default: false
45+
type: boolean
46+
4347
- name: customArguments
4448
type: string
4549
default: ''
@@ -60,6 +64,7 @@ steps:
6064
- template: set-up-for-generation-kiota.yml
6165
parameters:
6266
cleanMetadataFolder: ${{ parameters.cleanMetadataFolder }}
67+
isCopilotGeneration: ${{ parameters.isCopilotGeneration }}
6368
downloadSteps:
6469
- template: download-kiota.yml
6570

.azure-pipelines/generation-templates/set-up-for-generation-kiota.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ parameters:
66
default:
77
- pwsh: |
88
Write-Error "No download step is provided"
9+
- name: isCopilotGeneration
10+
type: boolean
911

1012
steps:
1113
- template: set-user-config.yml
@@ -23,13 +25,29 @@ steps:
2325
submodules: recursive
2426
condition: or(eq(variables.skipMetadataCaptureAndClean, true), eq(variables.skipOpenApiCaptureAndClean, true))
2527

28+
- checkout: ccs-beta-sdk-dotnet
29+
displayName: checkout ccs-beta-sdk-dotnet to grab the openapi.yaml
30+
fetchDepth: 1
31+
persistCredentials: true
32+
submodules: recursive
33+
condition: ${{ eq(parameters.isCopilotGeneration, true) }}
34+
35+
- pwsh: |
36+
md $(Build.SourcesDirectory)/msgraph-metadata/clean_v10_openapi
37+
md $(Build.SourcesDirectory)/msgraph-metadata/clean_beta_openapi
38+
Copy-Item -Path $(Build.SourcesDirectory)/ccs-beta-sdk-dotnet/openApiDocs/ccs-beta-review-openapi.yml -Destination $(Build.SourcesDirectory)/msgraph-metadata/clean_v10_openapi/openapi.yaml
39+
Copy-Item -Path $(Build.SourcesDirectory)/ccs-beta-sdk-dotnet/openApiDocs/ccs-beta-review-openapi.yml -Destination $(Build.SourcesDirectory)/msgraph-metadata/clean_beta_openapi/openapi.yaml
40+
displayName: Move Custom CCS metadata to expected location
41+
condition: ${{ eq(parameters.isCopilotGeneration, true) }}
42+
43+
2644
- pwsh: |
2745
md $(Build.SourcesDirectory)/msgraph-metadata/clean_v10_openapi
2846
md $(Build.SourcesDirectory)/msgraph-metadata/clean_beta_openapi
2947
Move-Item -Path $(Build.SourcesDirectory)/msgraph-metadata/openapi/v1.0/openapi.yaml -Destination $(Build.SourcesDirectory)/msgraph-metadata/clean_v10_openapi/
3048
Move-Item -Path $(Build.SourcesDirectory)/msgraph-metadata/openapi/beta/openapi.yaml -Destination $(Build.SourcesDirectory)/msgraph-metadata/clean_beta_openapi/
3149
displayName: Move metadata to expected location
32-
condition: or(eq(variables.skipMetadataCaptureAndClean, true), eq(variables.skipOpenApiCaptureAndClean, true))
50+
condition: and(or(eq(variables.skipMetadataCaptureAndClean, true), eq(variables.skipOpenApiCaptureAndClean, true)), ${{ eq(parameters.isCopilotGeneration, false) }})
3351

3452
# if capture and clean step is not skipped
3553
# then download the artifact from capture and clean steps
@@ -41,5 +59,5 @@ steps:
4159
downloadType: 'single'
4260
artifactName: ${{ parameters.cleanMetadataFolder }}
4361
downloadPath: '$(Build.SourcesDirectory)/msgraph-metadata'
44-
condition: and(eq(variables.skipMetadataCaptureAndClean, false), eq(variables.skipOpenApiCaptureAndClean, false))
62+
condition: and(eq(variables.skipMetadataCaptureAndClean, false), eq(variables.skipOpenApiCaptureAndClean, false), ${{ eq(parameters.isCopilotGeneration, false) }})
4563
displayName: Downloading metadata from artifacts

scripts/copy-ccs-typescript-sdk-models.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ param (
1212
Write-Host "Path to repo models directory: $targetDirectory"
1313
$mainPackageDirectoryName = $packageName.Split("/")[1]
1414
$modelsPackagePath = Join-Path $targetDirectory -ChildPath $mainPackageDirectoryName
15-
Copy-Item (Join-Path $sourceDirectory -ChildPath "models") -Destination $modelsPackagePath -Recurse -Force
15+
Copy-Item $sourceDirectory -Destination $modelsPackagePath -Recurse -Force

src/GraphODataTemplateWriter/GraphODataTemplateWriter.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
</ItemGroup>
3737
<ItemGroup>
3838
<PackageReference Include="Inflector.NetStandard" Version="1.2.2" />
39-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.12.0" />
39+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.13.0" />
4040
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
4141
<PackageReference Include="Mono.TextTemplating">
4242
<Version>3.0.0</Version>

test/Typewriter.Test/Typewriter.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<Version>4.3.2</Version>
4343
</PackageReference>
4444
<PackageReference Include="NUnit3TestAdapter">
45-
<Version>4.6.0</Version>
45+
<Version>5.0.0</Version>
4646
</PackageReference>
4747
</ItemGroup>
4848
</Project>

0 commit comments

Comments
 (0)