Skip to content

Sync eng/common directory with azure-sdk-tools for PR 10895 #1924

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

Merged
merged 4 commits into from
Jun 13, 2025
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion eng/common/pipelines/templates/steps/verify-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ steps:
-ignoreLinksFile ${{ parameters.IgnoreLinksFile }}
-branchReplaceRegex "${{ parameters.BranchReplaceRegex }}"
-branchReplacementName ${{ parameters.BranchReplacementName }}
-devOpsLogging: $true
-checkLinkGuidance: ${{ parameters.CheckLinkGuidance }}
-localBuildRepoName "$env:BUILD_REPOSITORY_NAME"
-localBuildRepoPath $(Build.SourcesDirectory)
Expand Down
39 changes: 5 additions & 34 deletions eng/common/scripts/Verify-Links.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
.PARAMETER ignoreLinksFile
Specifies the file that contains a set of links to ignore when verifying.

.PARAMETER devOpsLogging
Switch that will enable devops specific logging for warnings.

.PARAMETER recursive
Check the links recurisvely. Applies to links starting with 'baseUrl' parameter. Defaults to true.

Expand Down Expand Up @@ -70,7 +67,6 @@
param (
[string[]] $urls,
[string] $ignoreLinksFile = "$PSScriptRoot/ignore-links.txt",
[switch] $devOpsLogging = $false,
[switch] $recursive = $true,
[string] $baseUrl = "",
[string] $rootUrl = "",
Expand All @@ -89,6 +85,8 @@ param (

Set-StrictMode -Version 3.0

. "$PSScriptRoot/logging.ps1"

$ProgressPreference = "SilentlyContinue"; # Disable invoke-webrequest progress dialog

function ProcessLink([System.Uri]$linkUri) {
Expand Down Expand Up @@ -211,30 +209,6 @@ function NormalizeUrl([string]$url) {
return $uri
}

function LogWarning
{
if ($devOpsLogging)
{
Write-Host "##vso[task.LogIssue type=warning;]$args"
}
else
{
Write-Warning "$args"
}
}

function LogError
{
if ($devOpsLogging)
{
Write-Host "##vso[task.logissue type=error]$args"
}
else
{
Write-Error "$args"
}
}

function ResolveUri ([System.Uri]$referralUri, [string]$link)
{
# If the link is mailto, skip it.
Expand Down Expand Up @@ -554,9 +528,8 @@ foreach ($url in $urls) {
$pageUrisToCheck.Enqueue($uri);
}

if ($devOpsLogging) {
Write-Host "##[group]Link checking details"
}
LogGroupStart "Link checking details"

while ($pageUrisToCheck.Count -ne 0)
{
$pageUri = $pageUrisToCheck.Dequeue();
Expand Down Expand Up @@ -592,9 +565,7 @@ while ($pageUrisToCheck.Count -ne 0)
}

try {
if ($devOpsLogging) {
Write-Host "##[endgroup]"
}
LogGroupEnd

if ($badLinks.Count -gt 0) {
Write-Host "Summary of broken links:"
Expand Down