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

Add check for valid API review directory #13375

Closed
Closed
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions eng/scripts/Language-Settings.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,11 @@ function Find-javascript-Artifacts-For-Apireview($artifactDir, $packageName = ""
[regex]$pattern = "azure-"
$pkgName = $pattern.replace($packageName, "", 1)
$packageDir = Join-Path $artifactDir $pkgName "temp"
if (-not (Test-Path $packageDir))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who are we expecting to create this temp directory?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is created by api-extractor if docmodel is enabled.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be better to move this error check closer to where we expect it to be created, as if this step fails it isn't clear how someone would go and fix it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually within the api-extractor tool itself. I have added the log with info on how to enable api-extractor json output file. I am going to put this change on hold until I get a confirmation from JS team whether they plan to skip API-extract step for few packages or not.

{
Write-Host "Temp directory is not found in package root. Verify if docmodel is enabled in api-extractor.json."
return $null
}
Write-Host "Searching for *.api.json in path $($packageDir)"
$files = Get-ChildItem "${packageDir}" | Where-Object -FilterScript { $_.Name.EndsWith(".api.json") }
if (!$files)
Expand Down