Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
37ef13e
[tsp-client] Fix tool version (#8818)
catalinaperalta Aug 12, 2024
f2506c2
[tsp-client] Fix bundled dependency issue (#8817)
tjprescott Aug 12, 2024
062cdcf
Ensure Commets are added in correct line when docs are expanded (#8798)
chidozieononiwu Aug 12, 2024
b444030
Add Button for Disabling CodeLines Lazy Loading (#8803)
chidozieononiwu Aug 12, 2024
34de2dc
Replace Global Rush (#8820)
wanlwanl Aug 13, 2024
dd35ef2
adopt tsp-client command instead of pwsh script (#8723)
kazrael2119 Aug 13, 2024
7bd7a29
Clear Package Folder Before Generation (#8826)
wanlwanl Aug 13, 2024
08698d3
Improve Logging (#8795)
wanlwanl Aug 13, 2024
310645b
upgrade openapi-to-typespec (#8827)
pshao25 Aug 13, 2024
42598e1
[GitHub] Add common service label (#8828)
jsquire Aug 13, 2024
6e8d78e
[TSP Client] Update dependency for compare command (#8829)
tjprescott Aug 13, 2024
0732701
[tsp-client] Miscellaneous fixes (#8825)
catalinaperalta Aug 13, 2024
6829db8
Fix test-commands. (#8832)
tjprescott Aug 13, 2024
0c1b964
[tsp-client] Revert openapi-to-typespec changes (#8833)
catalinaperalta Aug 13, 2024
0b9efdb
Add exception for Utf8JsonReader/Writer to AZC0014 (#8752)
pshao25 Aug 14, 2024
a62328f
071824.01/conversation (#8834)
chidozieononiwu Aug 15, 2024
51d0611
Add RestAPISpecsDocsRepos to branch cleanup and update the delete scr…
JimSuplizio Aug 15, 2024
4148bf2
Clean-up publish-blobs.yml to have better defaults (#8842)
weshaggard Aug 15, 2024
e4bf857
[tsp-client] Report diagnostic errors and exit with an error (#8844)
catalinaperalta Aug 15, 2024
c376240
Ensure assets resolution script handles special-case file paths (#8831)
scbedd Aug 15, 2024
571fc6a
Add FilePattern support for .github\workflow sync (#8849)
weshaggard Aug 16, 2024
9d583e6
Upgrade openapi-to-typespec to 0.9.0 (#8845)
pshao25 Aug 16, 2024
ee00555
[tsp-client] Add gh action for tests (#8847)
catalinaperalta Aug 16, 2024
a37817c
Support RLC Changelog Generation Based on Inline Usage (#8751)
wanlwanl Aug 19, 2024
ef3c919
Adding Workflow to label description (#8855)
ronniegeraghty Aug 19, 2024
aa0fc47
APIView code file token tsp and json schema (#8816)
praveenkuttappan Aug 19, 2024
414852c
examples automation examples-dir for tsp (#8854)
weidongxu-microsoft Aug 20, 2024
2eaf22b
[tsp-client] Update rest-api-diff dependency (#8840)
tjprescott Aug 20, 2024
7aea8e6
prettier (#8836)
catalinaperalta Aug 21, 2024
f5b732c
.NET API review parser changes to use new token schema (#8850)
praveenkuttappan Aug 22, 2024
5590e2b
Apiview token changes (#8851)
praveenkuttappan Aug 23, 2024
a371747
Avoid code file caching when for new tree style code files (#8874)
praveenkuttappan Aug 23, 2024
c6475aa
Include RenderClasses in serialized JSON code file (#8877)
praveenkuttappan Aug 23, 2024
969d7f1
Allow Save-package-properties to exit 0 when prs produce no package c…
hallipr Aug 24, 2024
4aea26a
Skip documentation node id remapping if node is not changed (#8876)
praveenkuttappan Aug 24, 2024
c597728
Compare json object values instead of byte streams when matching bodi…
scbedd Aug 25, 2024
a434ce6
Test Proxy Version w/ Json Value Compare (#8865)
scbedd Aug 25, 2024
69ff96c
[Pylint] Disallow using legacy type hinting (#8801)
MJoshuaB Aug 26, 2024
80b4e64
feat(pylint): Add httpx as a blocked networking import (#8870)
kdestin Aug 26, 2024
461c1f1
Update azure-sdk-build-tools Repository Resource Refs in Yaml files (…
azure-sdk Aug 26, 2024
9040deb
fixes issue description over 100 characters (#8869)
ronniegeraghty Aug 26, 2024
bd0fc39
Fix apiviewgo download paths (#8856) (#8883)
praveenkuttappan Aug 26, 2024
4f63562
.NET API review parser tests (#8881)
praveenkuttappan Aug 26, 2024
b6d0b88
Fix Tree and node view diff and add more test cases for parser (#8880)
praveenkuttappan Aug 26, 2024
d039913
Apiview revision upgradability to new parser version test (#8882)
praveenkuttappan Aug 26, 2024
7b333b1
APIView server and client unit tests (#8889)
praveenkuttappan Aug 27, 2024
2afc9d4
Fixed issue when processing code file for metapackage (#8892)
praveenkuttappan Aug 27, 2024
5835f21
Fix issue in attribute line with attribute class name (#8897)
praveenkuttappan Aug 28, 2024
3051445
Add RealTime Comment Updates (#8868)
chidozieononiwu Aug 28, 2024
6bfb884
chore(): add playwright-testing to product slugs (#8875)
Sid200026 Aug 28, 2024
2489a64
Pull Request automation feedback (#8878)
scbedd Aug 29, 2024
21c1ba4
Add hubs URL to Build Pipeline (#8901)
chidozieononiwu Aug 29, 2024
da75627
Encapsulate Save-Package-Properties.ps1 invocation into yaml (#8900)
hallipr Aug 29, 2024
0fb9cd4
Surface Associated Pull Request Information (#8890)
chidozieononiwu Aug 30, 2024
6550939
upgrade openapi-to-typespec version to 0.9.1 (#8904)
pshao25 Aug 30, 2024
0e3daff
Switch to User Delegate SAS for vcpkg caching (#8907)
weshaggard Aug 30, 2024
5dda57e
add quotes to powershell args (#8909)
hallipr Aug 30, 2024
0576d81
Remove unused variable group (old cpp cache key) (#8920)
weshaggard Sep 3, 2024
5424b37
Update default API parser version for .NET (#8913)
praveenkuttappan Sep 3, 2024
d3169e4
Avoid adding the same package twice, use TrimStart instead of substri…
hallipr Sep 3, 2024
58a0759
Add support for aka.ms, github wiki and crates.io checking (#8887)
hallipr Sep 3, 2024
e2658f6
073124.02/subscribe (#8886)
chidozieononiwu Sep 4, 2024
f305a42
Updated API review tokens to include two additional properties (#8885)
praveenkuttappan Sep 4, 2024
9e0cb37
Adding Network - Cloud label (#8911)
ronniegeraghty Sep 4, 2024
d8e8f8d
Ensure all parts of comment updates in real time (#8924)
chidozieononiwu Sep 4, 2024
fc3bda5
Add real time updates for review and revisions (#8925)
chidozieononiwu Sep 4, 2024
4ce99f0
Address `micromatch` cspell lock update (#8928)
scbedd Sep 4, 2024
ea8390c
Rename autorest.csharp branch feature/v3 to main (#8923)
hallipr Sep 5, 2024
f9bbdd2
Add support for missing build processing (#8424)
hallipr Sep 5, 2024
cfc4c9f
Support Modular Auto Generation (#8906)
wanlwanl Sep 6, 2024
39dacb7
Test apiviewgo review names for v2 module (#8933)
chlowell Sep 6, 2024
65dbdb2
Add CI to verify APIView token schema (#8930)
praveenkuttappan Sep 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
57 changes: 57 additions & 0 deletions .github/workflows/tsp-client-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: tsp-client - Test

on:
push:
branches:
- main
pull_request:
paths:
- .github/workflows/tsp-client-tests.yml
- tools/tsp-client/**

jobs:
tsp-client:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node-version: [18, 20]
exclude:
- os: ubuntu-latest
node-version: 20
- os: windows-latest
node-version: 18

runs-on: ${{ matrix.os }}

steps:
- if: runner.os == 'Windows'
run: git config --global core.longpaths true
shell: pwsh

- uses: actions/checkout@v4
with:
sparse-checkout: |
.github/workflows
tools/tsp-client

- name: Use Node ${{ matrix.node-version }}.x
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}.x

- run: npm ci
shell: pwsh
working-directory: tools/tsp-client

- run: npm ls -a
shell: pwsh
continue-on-error: true
working-directory: tools/tsp-client

- run: npm run build
shell: pwsh
working-directory: tools/tsp-client

- run: npm run test
shell: pwsh
working-directory: tools/tsp-client
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ steps:
}
if ((!"$(System.PullRequest.SourceBranch)".StartsWith("sync-.github/workflows")) -and "$(System.PullRequest.TargetBranch)" -match "^(refs/heads/)?$(DefaultBranch)$")
{
$filesInCommonDir = & "eng/common/scripts/get-changedfiles.ps1" -DiffPath '.github/workflows/*' -DiffFilterType ""
$filesInCommonDir = & "eng/common/scripts/get-changedfiles.ps1" -DiffPath '.github/workflows/*event*' -DiffFilterType ""
if (($LASTEXITCODE -eq 0) -and ($filesInCommonDir.Count -gt 0))
{
Write-Host "##vso[task.LogIssue type=error;]Changes to files under '.github/workflows' directory should not be made in this Repo`n${filesInCommonDir}"
Expand Down
15 changes: 4 additions & 11 deletions eng/common/pipelines/templates/steps/publish-blobs.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
parameters:
FolderForUpload: ''
TargetLanguage: ''
BlobName: ''
ScriptPath: ''
BlobName: '' # To be removed once all usages are removed in the languages
BlobAccountName: 'https://azuresdkdocs.blob.core.windows.net'
ScriptPath: 'eng/common/scripts/copy-docs-to-blobstorage.ps1'
ArtifactLocation: ''
RepoId: $(Build.Repository.Name)

steps:
- template: /eng/common/pipelines/templates/steps/set-default-branch.yml
- pwsh: |
if (!(Test-Path '$(Build.BinariesDirectory)/azcopy/azcopy_windows_amd64_*/azcopy.exe')) {
Invoke-WebRequest -MaximumRetryCount 10 -Uri "https://aka.ms/downloadazcopy-v10-windows" -OutFile "azcopy.zip" | Wait-Process;
Expand-Archive -Path "azcopy.zip" -DestinationPath "$(Build.BinariesDirectory)/azcopy/" -Force
}
workingDirectory: $(Build.BinariesDirectory)
displayName: Download and Extract azcopy Zip

- task: AzurePowerShell@5
displayName: 'Copy Docs to Blob Storage'
Expand All @@ -24,9 +18,8 @@ steps:
ScriptType: 'FilePath'
ScriptPath: ${{ parameters.ScriptPath }}
ScriptArguments: >
-AzCopy $(Resolve-Path "$(Build.BinariesDirectory)/azcopy/azcopy_windows_amd64_*/azcopy.exe")[0]
-DocLocation "${{ parameters.FolderForUpload }}"
-BlobName "${{ parameters.BlobName }}"
-BlobAccountName "${{ parameters.BlobAccountName }}"
-PublicArtifactLocation "${{ parameters.ArtifactLocation }}"
-RepoReplaceRegex "(https://github.com/${{ parameters.RepoId }}/(?:blob|tree)/)$(DefaultBranch)"
azurePowerShellVersion: latestVersion
Expand Down
46 changes: 46 additions & 0 deletions eng/common/pipelines/templates/steps/save-package-properties.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
parameters:
- name: ServiceDirectory
type: string
default: ""
- name: DiffDirectory
type: string
default: $(Build.ArtifactStagingDirectory)/diff
- name: PackageInfoDirectory
type: string
default: $(Build.ArtifactStagingDirectory)/PackageInfo
- name: TargetPath
type: string
default: $(Build.SourcesDirectory)
- name: ScriptDirectory
type: string
default: eng/common/scripts

steps:
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
- task: Powershell@2
displayName: Generate PR Diff
inputs:
filePath: ${{ parameters.ScriptDirectory }}/Generate-PR-Diff.ps1
arguments: >
-TargetPath '${{ parameters.TargetPath }}'
-ArtifactPath '${{ parameters.DiffDirectory }}'
pwsh: true

- task: Powershell@2
displayName: Save package properties filtered for PR
inputs:
filePath: ${{ parameters.ScriptDirectory }}/Save-Package-Properties.ps1
arguments: >
-PrDiff '${{ parameters.DiffDirectory }}/diff.json'
-OutDirectory '${{ parameters.PackageInfoDirectory }}'
pwsh: true
- ${{ else }}:
- task: Powershell@2
displayName: Save package properties
inputs:
filePath: ${{ parameters.ScriptDirectory }}/Save-Package-Properties.ps1
arguments: >
-ServiceDirectory '${{parameters.ServiceDirectory}}'
-OutDirectory '${{ parameters.PackageInfoDirectory }}'
-AddDevVersion:$${{ eq(variables['SetDevVersion'],'true') }}
pwsh: true
152 changes: 104 additions & 48 deletions eng/common/scripts/Delete-RemoteBranches.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ param(
$AuthToken
)
Set-StrictMode -version 3

. (Join-Path $PSScriptRoot common.ps1)

function Get-AllBranchesAndPullRequestInfo($owner, $repo) {
Expand Down Expand Up @@ -66,67 +65,124 @@ if ($AuthToken) {
}

$owner, $repo = $RepoId -split "/"
$branches = Get-AllBranchesAndPullRequestInfo $owner $repo

foreach ($branch in $branches)
{
$branchName = $branch.Name
if ($branchName -notmatch $BranchRegex) {
continue
# These will always be output at the end of the script. Their only purpose is for information gathering
# Total number returned from query
$totalBranchesFromQuery = 0
# reasons why a branch was skipped
$skippedBranchNotMatchRegex = 0
$skippedForCommitDate = 0
$skippedForOpenPRs = 0
$skippedForPRNotInBranch = 0
$skippedForPRNotInRepo = 0
# gh call counters
$ghPRViewCalls = 0
$ghBranchDeleteCalls = 0

try {
# Output the core rate limit at the start of processing. There's no real need
# to output this at the end because the GH call counts are being output
$coreRateLimit = Get-RateLimit core
Write-RateLimit $coreRateLimit
# Output the GraphQL rate limit before and after the call
$graphqlRateLimit = Get-RateLimit graphql
Write-RateLimit $graphqlRateLimit "Before GraphQL Call"
$branches = Get-AllBranchesAndPullRequestInfo $owner $repo
$graphqlRateLimit = Get-RateLimit graphql
Write-RateLimit $graphqlRateLimit "After GraphQL Call"

if ($branches) {
$totalBranchesFromQuery = $branches.Count
}
$openPullRequests = @($branch.pullRequests | Where-Object { !$_.Closed })

# If we have a central PR that created this branch still open don't delete the branch
if ($CentralRepoId)
foreach ($branch in $branches)
{
$pullRequestNumber = $matches["PrNumber"]
# If central PR number is not found, then skip
if (!$pullRequestNumber) {
LogError "No PR number found in the branch name. Please check the branch name '$branchName'. Skipping..."
$branchName = $branch.Name
if ($branchName -notmatch $BranchRegex) {
$skippedBranchNotMatchRegex++
continue
}
$openPullRequests = @($branch.pullRequests | Where-Object { !$_.Closed })

$centralPR = gh pr view --json 'url,closed' --repo $CentralRepoId $pullRequestNumber | ConvertFrom-Json
if ($LASTEXITCODE) {
LogError "PR '$pullRequestNumber' not found in repo '$CentralRepoId'. Skipping..."
continue;
} else {
LogDebug "Found central PR $($centralPR.url) and Closed=$($centralPR.closed)"
if (!$centralPR.Closed) {
# Skipping if there is an open central PR open for the branch.
LogDebug "Central PR is still open so skipping the deletion of branch '$branchName'. Skipping..."
continue;
# If we have a central PR that created this branch still open don't delete the branch
if ($CentralRepoId)
{
$pullRequestNumber = $matches["PrNumber"]
# If central PR number is not found, then skip
if (!$pullRequestNumber) {
LogError "No PR number found in the branch name. Please check the branch name '$branchName'. Skipping..."
$skippedForPRNotInBranch++
continue
}

$ghPRViewCalls++
$centralPR = gh pr view --json 'url,closed' --repo $CentralRepoId $pullRequestNumber | ConvertFrom-Json
if ($LASTEXITCODE) {
LogError "PR '$pullRequestNumber' not found in repo '$CentralRepoId'. Skipping..."
$skippedForPRNotInRepo++
continue
} else {
LogDebug "Found central PR $($centralPR.url) and Closed=$($centralPR.closed)"
if (!$centralPR.Closed) {
$skippedForOpenPRs++
# Skipping if there is an open central PR open for the branch.
LogDebug "Central PR is still open so skipping the deletion of branch '$branchName'. Skipping..."
continue
}
}
}
}
else {
# Not CentralRepoId - not associated with a central repo PR
if ($openPullRequests.Count -gt 0 -and !$DeleteBranchesEvenIfThereIsOpenPR) {
LogDebug "Found open PRs associate with branch '$branchName'. Skipping..."
continue
else {
# Not CentralRepoId - not associated with a central repo PR
if ($openPullRequests.Count -gt 0 -and !$DeleteBranchesEvenIfThereIsOpenPR) {
$skippedForOpenPRs++
LogDebug "Found open PRs associate with branch '$branchName'. Skipping..."
continue
}
}
}

# If there is date filter, then check if branch last commit is older than the date.
if ($LastCommitOlderThan)
{
$commitDate = $branch.committedDate
if ($commitDate -gt $LastCommitOlderThan) {
LogDebug "The branch $branch last commit date '$commitDate' is newer than the date '$LastCommitOlderThan'. Skipping..."
continue
# If there is date filter, then check if branch last commit is older than the date.
if ($LastCommitOlderThan)
{
$commitDate = $branch.committedDate
if ($commitDate -gt $LastCommitOlderThan) {
$skippedForCommitDate++
LogDebug "The branch $branch last commit date '$commitDate' is newer than the date '$LastCommitOlderThan'. Skipping..."
continue
}
}
}

foreach ($openPullRequest in $openPullRequests) {
Write-Host "Note: Open pull Request '$($openPullRequest.url)' will be closed after branch deletion, given the central PR is closed."
}
foreach ($openPullRequest in $openPullRequests) {
LogDebug "Note: Open pull Request '$($openPullRequest.url)' will be closed after branch deletion, given the central PR is closed."
}

$commitUrl = $branch.commitUrl
if ($PSCmdlet.ShouldProcess("'$branchName' in '$RepoId'", "Deleting branch on cleanup script")) {
gh api "repos/${RepoId}/git/refs/heads/${branchName}" -X DELETE
if ($LASTEXITCODE) {
LogError "Deletion of branch '$branchName` failed"
$commitUrl = $branch.commitUrl
if ($PSCmdlet.ShouldProcess("'$branchName' in '$RepoId'", "Deleting branch on cleanup script")) {
$ghBranchDeleteCalls++
gh api "repos/${RepoId}/git/refs/heads/${branchName}" -X DELETE
if ($LASTEXITCODE) {
LogError "Deletion of branch '$branchName` failed, see command output above"
exit $LASTEXITCODE
}
LogDebug "The branch '$branchName' at commit '$commitUrl' in '$RepoId' has been deleted."
}
Write-Host "The branch '$branchName' at commit '$commitUrl' in '$RepoId' has been deleted."
}
}
finally {


Write-Host "Number of branches returned from graphql query: $totalBranchesFromQuery"
# The $BranchRegex seems to be always set
if ($BranchRegex) {
Write-Host "Number of branches that didn't match the BranchRegex: $skippedBranchNotMatchRegex"
}
Write-Host "Number of branches skipped for newer last commit date: $skippedForCommitDate"
Write-Host "Number of branches skipped for open PRs: $skippedForOpenPRs"
Write-Host "Number of gh api calls to delete branches: $ghBranchDeleteCalls"
# The following are only applicable when $CentralRepoId is passed in
if ($CentralRepoId) {
Write-Host "The following are applicable because CentralRepoId was passed in:"
Write-Host " Number of gh pr view calls: $ghPRViewCalls"
Write-Host " Number of branches skipped due to PR not in the repository: $skippedForPRNotInRepo "
Write-Host " Number of branches skipped due to PR not in the branch name: $skippedForPRNotInBranch"
}
}
36 changes: 21 additions & 15 deletions eng/common/scripts/Generate-PR-Diff.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,29 @@ The path under which changes will be detected.
#>
[CmdletBinding()]
Param (
[Parameter(Mandatory=$True)]
[Parameter(Mandatory = $True)]
[string] $ArtifactPath,
[Parameter(Mandatory=$True)]
[Parameter(Mandatory = $True)]
[string] $TargetPath
)

. (Join-Path $PSScriptRoot "Helpers" "git-helpers.ps1")

function Get-ChangedServices {
Param (
[Parameter(Mandatory=$True)]
[string[]] $ChangedFiles
)
function Get-ChangedServices
{
Param (
[Parameter(Mandatory = $True)]
[string[]] $ChangedFiles
)

$changedServices = $ChangedFiles | Foreach-Object { if ($_ -match "sdk/([^/]+)") { $matches[1] } } | Sort-Object -Unique
$changedServices = $ChangedFiles | Foreach-Object { if ($_ -match "sdk/([^/]+)") { $matches[1] } } | Sort-Object -Unique

return $changedServices
return $changedServices
}

if (!(Test-Path $ArtifactPath)) {
New-Item -ItemType Directory -Path $ArtifactPath | Out-Null
if (!(Test-Path $ArtifactPath))
{
New-Item -ItemType Directory -Path $ArtifactPath | Out-Null
}

$ArtifactPath = Resolve-Path $ArtifactPath
Expand All @@ -43,9 +45,13 @@ $changedFiles = Get-ChangedFiles -DiffPath $TargetPath
$changedServices = Get-ChangedServices -ChangedFiles $changedFiles

$result = [PSCustomObject]@{
"ChangedFiles" = $changedFiles
"ChangedServices" = $changedServices
"PRNumber" = if ($env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER) { $env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER } else { "-1" }
"ChangedFiles" = $changedFiles
"ChangedServices" = $changedServices
"PRNumber" = if ($env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER) { $env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER } else { "-1" }
}

$result | ConvertTo-Json | Out-File $ArtifactName
$json = $result | ConvertTo-Json
$json | Out-File $ArtifactName

Write-Host "`nGenerated diff.json file at $ArtifactName"
Write-Host " $($json -replace "`n", "`n ")"
Loading