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 all 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
1 change: 1 addition & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"avro",
"antkmsft",
"azcmagent",
"azcopy",
"azcore",
"azsdk",
"azsdkengsys",
Expand Down
127 changes: 67 additions & 60 deletions eng/pipelines/templates/jobs/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,75 +80,17 @@ jobs:

# Disable build for cpp - client
- ${{ if and(eq(parameters.RunMetaJobs, 'true'), ne(parameters.ServiceDirectory, 'not-specified' )) }}:
- job:
displayName: Create API Review
pool:
name: $(WINDOWSPOOL)
image: $(WINDOWSVMIMAGE)
os: windows
steps:
- task: Powershell@2
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/scripts/Save-Package-Properties.ps1
arguments: >
-ServiceDirectory ${{ parameters.ServiceDirectory }}
-OutDirectory $(Build.ArtifactStagingDirectory)/PackageInfo
pwsh: true
workingDirectory: $(Pipeline.Workspace)
displayName: Dump Package properties
condition: succeeded()

- template: /eng/common/pipelines/templates/steps/set-default-branch.yml

- task: UniversalPackages@0
displayName: Download ApiView Parser.
inputs:
command: download
vstsFeed: 'internal/AzureSDKForCpp'
vstsFeedPackage: 'parseazuresdkcpp'
downloadDirectory: '$(System.DefaultWorkingDirectory)/parser'
vstsPackageVersion: 0.14.0
condition: >-
and(
succeeded(),
ne(variables['Skip.CreateApiReview'], 'true'),
ne(variables['Build.Reason'],'PullRequest'),
eq(variables['System.TeamProject'], 'internal')
)

- task: Powershell@2
inputs:
filePath: $(System.DefaultWorkingDirectory)/eng/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
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)
image: $(WINDOWSVMIMAGE)
os: windows
variables:
apiviewParserVersion: "20240927.5"
VCPKG_DEFAULT_TRIPLET: 'x64-windows-static'
Package.EnableSBOMSigning: true
steps:
- template: /eng/common/pipelines/templates/steps/set-default-branch.yml
- template: /eng/common/pipelines/templates/steps/credscan.yml
parameters:
SuppressionFilePath: $(Build.SourcesDirectory)/eng/CredScanSuppression.json
Expand Down Expand Up @@ -219,13 +161,41 @@ jobs:
- pwsh: npm install -g moxygen
displayName: Install Moxygen to generate markdown for docs.microsoft.com

- pwsh: |
Write-Host "Using apiview parser version ${{ variables.apiviewParserVersion }}"
ckairen marked this conversation as resolved.
Show resolved Hide resolved
azcopy copy "https://azuresdkartifacts.blob.core.windows.net/azure-sdk-for-cpp/parseazuresdkcpp/${{ variables.apiviewParserVersion }}/*" "$(System.DefaultWorkingDirectory)/parser" --recursive
ckairen marked this conversation as resolved.
Show resolved Hide resolved
displayName: Download ApiView Parser.

- task: Powershell@2
inputs:
filePath: $(System.DefaultWorkingDirectory)/eng/scripts/Generate-APIReview-Token-Files.ps1
arguments: >
-ArtifactList ('${{ convertToJson(parameters.Artifacts) }}' | ConvertFrom-Json | Select-Object Name)
-OutPath $(Build.ArtifactStagingDirectory)
-ParserPath $(System.DefaultWorkingDirectory)/parser/RelWithDebInfo/ParseAzureSdkCpp.exe
-ServicePath $(Build.SourcesDirectory)/sdk/${{ parameters.ServiceDirectory }}
pwsh: true
workingDirectory: $(Pipeline.Workspace)
displayName: Generate APIReview Token Files

- task: Powershell@2
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/scripts/Save-Package-Properties.ps1
arguments: >
-ServiceDirectory ${{parameters.ServiceDirectory}}
-OutDirectory $(Build.ArtifactStagingDirectory)/packages/PackageInfo
pwsh: true
workingDirectory: $(Pipeline.Workspace)
displayName: Dump Package properties

# Generate package spec JSON files for tagging the repo
- ${{ each artifact in parameters.Artifacts }}:
- pwsh: >-
New-Item
-ItemType directory
-Path $(Build.ArtifactStagingDirectory)
-Name packages/${{ artifact.Name }}
-Force
ckairen marked this conversation as resolved.
Show resolved Hide resolved
displayName: Create package info artifact location

- pwsh: |
Expand Down Expand Up @@ -334,10 +304,47 @@ jobs:
continueOnError: true
condition: and(succeeded(), eq(variables['VerifyChangeLogForRelease'], 'true'))

- pwsh: |
$packageJsonDest = Join-Path -Path $(Build.ArtifactStagingDirectory) PackageInfo
$packageJsonSource = Join-Path -Path $(Build.ArtifactStagingDirectory) packages/PackageInfo
mkdir $packageJsonDest
Copy-Item $packageJsonSource/* $packageJsonDest -Force
displayName: Copy Package Json
- template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml
parameters:
ArtifactPath: $(Build.ArtifactStagingDirectory)/packages
ArtifactName: packages
- template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml
parameters:
ArtifactPath: $(Build.ArtifactStagingDirectory)/PackageInfo
ArtifactName: PackageInfo

- task: Powershell@2
inputs:
filePath: $(System.DefaultWorkingDirectory)/eng/common/scripts/Create-APIReview.ps1
arguments: >
-ArtifactList ('${{ convertToJson(parameters.Artifacts) }}' | ConvertFrom-Json | Select-Object Name)
-ArtifactPath "$(Build.ArtifactStagingDirectory)/packages"
-ApiKey "$(azuresdk-apiview-apikey)"
-SourceBranch $(Build.SourceBranchName)
-DefaultBranch $(DefaultBranch)
-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') }}:
- ${{ each artifact in parameters.Artifacts }}:
- template: /eng/common/pipelines/templates/steps/detect-api-changes.yml
parameters:
ArtifactPath: $(Build.ArtifactStagingDirectory)\packages
ckairen marked this conversation as resolved.
Show resolved Hide resolved

- template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml
parameters:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,9 @@ Param(
[Parameter(Mandatory=$True)]
[string] $OutPath,
[Parameter(Mandatory=$True)]
[string] $ApiKey,
[Parameter(Mandatory=$True)]
[string] $SourceBranch,
[Parameter(Mandatory=$True)]
[string] $DefaultBranch,
[Parameter(Mandatory=$True)]
[string] $ParserPath,
[Parameter(Mandatory=$True)]
[string] $ServicePath,
[Parameter(Mandatory=$True)]
[string] $RepoName,
[Parameter(Mandatory=$True)]
[string] $BuildId
[string] $ServicePath
)

Write-Host "$PSScriptRoot"
Expand All @@ -34,19 +24,15 @@ foreach ($artifact in $ArtifactList)
exit 1
}

Write-Host "Creating API review artifact for $($ArtifactName)"
New-Item -ItemType Directory -Path $OutPath/$ArtifactName -force
Write-Host "Creating API review artifact for $ArtifactName"
New-Item -ItemType Directory -Path "$OutPath/packages/$ArtifactName" -Force
$parentPath = Split-Path $ParserPath -Parent
Write-Host "Contents in $($parentPath)"
Write-Host "Contents in ${parentPath}:"
Get-ChildItem -Path $parentPath -Recurse
& $ParserPath -o $OutPath/$ArtifactName/$ArtifactName.json $SourcePath
& $ParserPath -o "$OutPath/packages/$ArtifactName/${ArtifactName}_cpp.json" $SourcePath
if ($LASTEXITCODE -ne 0)
{
Write-Host "Failed to generate API review file for $($ArtifactName)"
exit 1
}
}

$createReviewScript = (Join-Path $PSScriptRoot .. common scripts Create-APIReview.ps1)
Write-Host "Running script to create review for all artifacts."
&($createReviewScript) -ArtifactList $ArtifactList -ArtifactPath $OutPath -APIKey $ApiKey -SourceBranch $SourceBranch -DefaultBranch $DefaultBranch -RepoName $RepoName -BuildId $BuildId
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 "PackageInfo") -Filter "${PackageName}.json" -ErrorAction Ignore)
if ($artifact)
{
$packages = @{
Expand Down