Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[apiview] adding pr support #5932

Merged
merged 83 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
16800eb
add detect api changes
ckairen Aug 21, 2024
4c1d68b
add detect api changes
ckairen Aug 21, 2024
541533e
trigger test pipeline
ckairen Aug 22, 2024
6dae688
adding cpp.json ref
ckairen Aug 29, 2024
a98a0eb
yml syntax
ckairen Aug 29, 2024
4eaf9d4
move partial script below artifact publish
ckairen Aug 29, 2024
eebbb07
renaming + trimming down
ckairen Sep 4, 2024
9bf62bb
download parser
ckairen Sep 4, 2024
32aa7e2
download parser
ckairen Sep 4, 2024
630cf6a
download parser
ckairen Sep 4, 2024
1d29351
fix parser download
ckairen Sep 9, 2024
e3296ee
update to parser 2.0
ckairen Sep 9, 2024
5d22332
update to parser 2.1
ckairen Sep 9, 2024
a6eaeb1
update parser version
ckairen Sep 13, 2024
4517284
trigger pipeline
ckairen Sep 13, 2024
2b03e34
Merge branch 'main' into al/apiview
ckairen Sep 13, 2024
f4e22f4
trigger pipeline
ckairen Sep 13, 2024
ba230dd
Merge branch 'al/apiview' of https://github.com/ckairen/azure-sdk-for…
ckairen Sep 13, 2024
0e9511f
download ste7p testing
ckairen Sep 13, 2024
0f8dac0
download ste7p testing
ckairen Sep 13, 2024
2326e4f
download ste7p testing
ckairen Sep 13, 2024
5e54d5d
download parser from blob
ckairen Sep 17, 2024
ed493ea
download parser from blob
ckairen Sep 17, 2024
525b5ca
download parser from blob
ckairen Sep 17, 2024
6604947
download parser from blob
ckairen Sep 17, 2024
ef789ce
cspell
ckairen Sep 17, 2024
663558c
download parser from blob
ckairen Sep 17, 2024
ac697d8
download parser from blob
ckairen Sep 17, 2024
80b25ab
directory change for get artifacts
ckairen Sep 17, 2024
52bf54f
directory change for get artifacts
ckairen Sep 17, 2024
d12c9e5
publish packageinfo artifact
ckairen Sep 17, 2024
f7ac431
publish packageinfo artifact
ckairen Sep 17, 2024
b3a9ac3
publish packageinfo artifact
ckairen Sep 17, 2024
c729052
debug
ckairen Sep 18, 2024
a222425
debug
ckairen Sep 18, 2024
5348be8
artifact name
ckairen Sep 18, 2024
b878fe7
artifact name
ckairen Sep 18, 2024
1cc0dea
artifact name
ckairen Sep 18, 2024
4d3646e
artifact name
ckairen Sep 18, 2024
c299e35
api file
ckairen Sep 19, 2024
a94ece6
delete job
ckairen Sep 19, 2024
f0edfc1
debug
ckairen Sep 19, 2024
221fc01
debug
ckairen Sep 19, 2024
50ac051
debug
ckairen Sep 19, 2024
878befa
debug
ckairen Sep 19, 2024
254ca38
debug
ckairen Sep 19, 2024
165af9a
debug
ckairen Sep 19, 2024
9379092
debug
ckairen Sep 19, 2024
66b749a
debug
ckairen Sep 19, 2024
9b331b4
debug
ckairen Sep 20, 2024
7296268
debug
ckairen Sep 20, 2024
936ac23
debug
ckairen Sep 20, 2024
7f3213d
debug
ckairen Sep 20, 2024
8e83a54
dupe package json
ckairen Sep 20, 2024
26cee85
dupe package json
ckairen Sep 20, 2024
c7885b1
Merge branch 'main' into al/apiview
ckairen Sep 20, 2024
d821c70
codefile
ckairen Sep 20, 2024
b2f7141
codefile
ckairen Sep 20, 2024
81f4456
codefile
ckairen Sep 20, 2024
48fda93
codefile
ckairen Sep 20, 2024
e9355e2
codefile
ckairen Sep 20, 2024
12335cc
test in staging
ckairen Sep 23, 2024
34d4a56
cleanup
ckairen Sep 24, 2024
9d30bab
use api parser 0.15.0
ckairen Sep 24, 2024
002ce2e
ignore unfound package for apiview artifacts
ckairen Sep 24, 2024
288e9e5
pr adjustments
ckairen Sep 25, 2024
3d084b9
pr adjustments
ckairen Sep 25, 2024
6ad7f30
pr adjustments
ckairen Sep 25, 2024
4588a47
latest version update
ckairen Sep 27, 2024
d8d80ae
update latest parser version
ckairen Sep 30, 2024
6612b77
add api parser version
ckairen Sep 30, 2024
0886b24
Update sdk/template/azure-template/src/template_client.cpp
ckairen Sep 30, 2024
c7c54cf
add template testing for api changes
ckairen Sep 30, 2024
45132ea
Merge branch 'al/apiview' of https://github.com/ckairen/azure-sdk-for…
ckairen Sep 30, 2024
2185e70
add template testing for api changes
ckairen Sep 30, 2024
11a5db9
out path change
ckairen Sep 30, 2024
bf78024
out path change
ckairen Sep 30, 2024
4b83f88
delete parser path
ckairen Sep 30, 2024
d38dab4
delete parser path
ckairen Sep 30, 2024
206aa8c
move save package properties out of artifacts loop
ckairen Oct 2, 2024
430931c
Update sdk/template/azure-template/src/template_client.cpp
ckairen Oct 4, 2024
d162702
Update sdk/template/azure-template/src/private/package_version.hpp
ckairen Oct 4, 2024
62ddf1b
Update sdk/template/azure-template/inc/azure/template/template_client…
ckairen Oct 4, 2024
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
53 changes: 31 additions & 22 deletions eng/pipelines/templates/jobs/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,38 +108,18 @@ jobs:
vstsFeedPackage: 'parseazuresdkcpp'
downloadDirectory: '$(System.DefaultWorkingDirectory)/parser'
vstsPackageVersion: 0.13.0
condition: >-
and(
succeeded(),
ne(variables['Skip.CreateApiReview'], 'true'),
ne(variables['Build.Reason'],'PullRequest'),
eq(variables['System.TeamProject'], 'internal')
)
condition: succeeded()

- task: Powershell@2
inputs:
filePath: $(System.DefaultWorkingDirectory)/eng/scripts/Create-APIReview.ps1
filePath: $(System.DefaultWorkingDirectory)/eng/scripts/Generate-APIReview-Token-Files.ps1
arguments: >
-ArtifactList ('${{ convertToJson(parameters.Artifacts) }}' | ConvertFrom-Json | Select-Object Name)
-OutPath $(Build.ArtifactStagingDirectory)
-ApiKey "$(azuresdk-apiview-apikey)"
-SourceBranch $(Build.SourceBranchName)
-DefaultBranch $(DefaultBranch)
-ParserPath $(System.DefaultWorkingDirectory)/parser/RelWithDebInfo/ParseAzureSdkCpp.exe
-ServicePath $(Build.SourcesDirectory)/sdk/${{ parameters.ServiceDirectory }}
-BuildId $(Build.BuildId)
-RepoName "$(Build.Repository.Name)"
pwsh: true
workingDirectory: $(Pipeline.Workspace)
displayName: Create API Review
ckairen marked this conversation as resolved.
Show resolved Hide resolved
ckairen marked this conversation as resolved.
Show resolved Hide resolved
condition: >-
and(
succeeded(),
ne(variables['Skip.CreateApiReview'], 'true'),
ne(variables['Build.Reason'],'PullRequest'),
eq(variables['System.TeamProject'], 'internal')
)

- job: GenerateReleaseArtifacts
pool:
name: $(WINDOWSPOOL)
Expand Down Expand Up @@ -338,6 +318,35 @@ jobs:
parameters:
ArtifactPath: $(Build.ArtifactStagingDirectory)/packages
ArtifactName: packages

- task: Powershell@2
inputs:
filePath: $(System.DefaultWorkingDirectory)/eng/common/scripts/Create-APIReview.ps1
arguments: >
-ArtifactList ('${{ convertToJson(parameters.Artifacts) }}' | ConvertFrom-Json | Select-Object Name)
-OutPath $(Build.ArtifactStagingDirectory)
-ApiKey "$(azuresdk-apiview-apikey)"
-SourceBranch $(Build.SourceBranchName)
-DefaultBranch $(DefaultBranch)
-ParserPath $(System.DefaultWorkingDirectory)/parser/RelWithDebInfo/ParseAzureSdkCpp.exe
-ServicePath $(Build.SourcesDirectory)/sdk/${{ parameters.ServiceDirectory }}
-BuildId $(Build.BuildId)
-RepoName "$(Build.Repository.Name)"
pwsh: true
workingDirectory: $(Pipeline.Workspace)
displayName: Create API Review
condition: >-
and(
succeeded(),
ne(variables['Skip.CreateApiReview'], 'true'),
ne(variables['Build.Reason'],'PullRequest'),
eq(variables['System.TeamProject'], 'internal')
)
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
- template: /eng/common/pipelines/templates/steps/detect-api-changes.yml
parameters:
Artifacts: ${{ parameters.Artifacts }}
condition: succeeded()

- template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml
parameters:
Expand Down
2 changes: 1 addition & 1 deletion eng/scripts/Create-APIReview.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ foreach ($artifact in $ArtifactList)
$parentPath = Split-Path $ParserPath -Parent
Write-Host "Contents in $($parentPath)"
Get-ChildItem -Path $parentPath -Recurse
& $ParserPath -o $OutPath/$ArtifactName/$ArtifactName.json $SourcePath
& $ParserPath -o $OutPath/$ArtifactName/$ArtifactName_cpp.json $SourcePath
if ($LASTEXITCODE -ne 0)
{
Write-Host "Failed to generate API review file for $($ArtifactName)"
Expand Down
38 changes: 38 additions & 0 deletions eng/scripts/Generate-APIReview-Token-Files.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Param(
[Parameter(Mandatory=$True)]
[array] $ArtifactList,
[Parameter(Mandatory=$True)]
[string] $OutPath,
[Parameter(Mandatory=$True)]
[string] $ParserPath,
[Parameter(Mandatory=$True)]
[string] $ServicePath
)

Write-Host "$PSScriptRoot"
. (Join-Path $PSScriptRoot .. common scripts common.ps1)

foreach ($artifact in $ArtifactList)
{
$ArtifactName = $artifact.name
Write-Host "Generating artifact for $ArtifactName"
$SourcePath = Join-Path $ServicePath $ArtifactName "inc"
$apiviewSettings = Join-Path $SourcePath "ApiViewSettings.json"
if (!(Test-Path $apiviewSettings))
{
Write-Host "ApiViewSettings.json file is not found in $($SourcePath). APIView settings file is required to generate API review file."
exit 1
}

Write-Host "Creating API review artifact for $($ArtifactName)"
New-Item -ItemType Directory -Path $OutPath/$ArtifactName -force
ckairen marked this conversation as resolved.
Show resolved Hide resolved
$parentPath = Split-Path $ParserPath -Parent
Write-Host "Contents in $($parentPath)"
ckairen marked this conversation as resolved.
Show resolved Hide resolved
Get-ChildItem -Path $parentPath -Recurse
& $ParserPath -o $OutPath/$ArtifactName/$ArtifactName_cpp.json $SourcePath
ckairen marked this conversation as resolved.
Show resolved Hide resolved
if ($LASTEXITCODE -ne 0)
{
Write-Host "Failed to generate API review file for $($ArtifactName)"
exit 1
}
}
2 changes: 1 addition & 1 deletion eng/scripts/Language-Settings.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function SetPackageVersion ($PackageName, $Version, $ServiceDirectory, $ReleaseD

function Find-cpp-Artifacts-For-Apireview($ArtifactPath, $PackageName)
{
$artifact = @(Get-ChildItem -Path (Join-Path $ArtifactPath $PackageName) -Filter "*.json")
$artifact = @(Get-ChildItem -Path (Join-Path $ArtifactPath $PackageName) -Filter "*_cpp.json")
if ($artifact)
{
$packages = @{
Expand Down
1 change: 1 addition & 0 deletions sdk/template/azure-template/src/template_client.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
// Just Triggering Testing Pipelines
ckairen marked this conversation as resolved.
Show resolved Hide resolved

#include "azure/template/template_client.hpp"

Expand Down
Loading