Skip to content

Commit 03cf161

Browse files
authored
[Pipeline] Update link check error display (#343)
# Description - Update link check error display ![image](https://github.com/microsoft/promptflow/assets/2572521/507f3af8-7883-4d97-b22f-e703eb0553b5) - Update publish doc pipeline to include promptflow source code path # All Promptflow Contribution checklist: - [ ] **The pull request does not introduce [breaking changes]** - [ ] **CHANGELOG is updated for new features, bug fixes or other significant changes.** - [ ] **I have read the [contribution guidelines](../CONTRIBUTING.md).** ## General Guidelines and Best Practices - [ ] Title of the pull request is clear and informative. - [ ] There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, [see this page](https://github.com/Azure/azure-powershell/blob/master/documentation/development-docs/cleaning-up-commits.md). ### Testing Guidelines - [ ] Pull request includes test coverage for the included changes.
1 parent 241c145 commit 03cf161

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

.github/workflows/publish_doc.yml

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
- 'docs/**'
1212
- 'scripts/docs/**'
1313
- '.github/workflows/publish_doc.yml'
14+
- 'src/promptflow/promptflow/**'
1415

1516
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
1617
permissions:

scripts/docs/doc_generation.ps1

+23-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ param(
2121
[string] $TempDocPath = New-TemporaryFile | % { Remove-Item $_; New-Item -ItemType Directory -Path $_ }
2222
[string] $PkgSrcPath = [System.IO.Path]::Combine($RepoRootPath, "src\promptflow\promptflow")
2323
[string] $OutPath = [System.IO.Path]::Combine($ScriptPath, "_build")
24+
[string] $SphinxApiDoc = [System.IO.Path]::Combine($DocPath, "sphinx_apidoc.log")
25+
[string] $SphinxBuildDoc = [System.IO.Path]::Combine($DocPath, "sphinx_build.log")
26+
[string] $WarningErrorPattern = "WARNING:|ERROR:"
27+
$apidocWarningsAndErrors = $null
28+
$buildWarningsAndErrors = $null
2429

2530
if (-not $SkipInstall){
2631
# Prepare doc generation packages
@@ -65,7 +70,8 @@ if($WithReferenceDoc){
6570
}
6671
Remove-Item $RefDocPath -Recurse -Force
6772
Write-Host "===============Build Promptflow Reference Doc==============="
68-
sphinx-apidoc --module-first --no-headings --no-toc --implicit-namespaces "$PkgSrcPath" -o "$RefDocPath"
73+
sphinx-apidoc --module-first --no-headings --no-toc --implicit-namespaces "$PkgSrcPath" -o "$RefDocPath" | Tee-Object -FilePath $SphinxApiDoc
74+
$apidocWarningsAndErrors = Select-String -Path $SphinxApiDoc -Pattern $WarningErrorPattern
6975
}
7076

7177

@@ -78,7 +84,22 @@ if($WarningAsError){
7884
if($BuildLinkCheck){
7985
$BuildParams.Add("-blinkcheck")
8086
}
81-
sphinx-build $TempDocPath $OutPath -c $ScriptPath $BuildParams
87+
sphinx-build $TempDocPath $OutPath -c $ScriptPath $BuildParams | Tee-Object -FilePath $SphinxBuildDoc
88+
$buildWarningsAndErrors = Select-String -Path $SphinxBuildDoc -Pattern $WarningErrorPattern
8289

8390
Write-Host "Clean path: $TempDocPath"
8491
Remove-Item $TempDocPath -Recurse -Confirm:$False -Force
92+
93+
if ($apidocWarningsAndErrors) {
94+
Write-Host "=============== API doc warnings and errors ==============="
95+
foreach ($line in $apidocWarningsAndErrors) {
96+
Write-Host $line -ForegroundColor Red
97+
}
98+
}
99+
100+
if ($buildWarningsAndErrors) {
101+
Write-Host "=============== Build warnings and errors ==============="
102+
foreach ($line in $buildWarningsAndErrors) {
103+
Write-Host $line -ForegroundColor Red
104+
}
105+
}

0 commit comments

Comments
 (0)