Skip to content

Commit fa03666

Browse files
Merge pull request #96 from TaskarCenterAtUW/feat/2026-06-24-update-run-utils
feat: update run-utils to support skipping internal or external links
2 parents e10f495 + a793fe1 commit fa03666

4 files changed

Lines changed: 53 additions & 15 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ Changes to the TCAT Wiki are documented here.
66

77
This project adheres to [Semantic Versioning](https://semver.org/) and [Conventional Commits](https://www.conventionalcommits.org/).
88

9+
## v12.2.0 (2026-06-24)
10+
11+
### Features
12+
13+
- **Core**: Update `run-utils` utility to support skipping internal or external links
14+
915
## v12.1.0 (2026-06-24)
1016

1117
### Fixes

utilities/run-utils.Tests.ps1

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,16 +222,20 @@ Describe "Script Structure" {
222222
$scriptContent | Should -Match '\[switch\]\$TestsOnly'
223223
}
224224

225-
It "Should have SkipLinkCheck parameter" {
226-
$scriptContent | Should -Match '\[switch\]\$SkipLinkCheck'
225+
It "Should have SkipInternalLinksCheck parameter" {
226+
$scriptContent | Should -Match '\[switch\]\$SkipInternalLinksCheck'
227+
}
228+
229+
It "Should have SkipExternalLinksCheck parameter" {
230+
$scriptContent | Should -Match '\[switch\]\$SkipExternalLinksCheck'
227231
}
228232

229233
It "Should have NoCache parameter" {
230234
$scriptContent | Should -Match '\[switch\]\$NoCache'
231235
}
232236

233-
It "Should validate mutual exclusivity of SkipLinkCheck and NoCache" {
234-
$scriptContent | Should -Match 'SkipLinkCheck.*NoCache.*cannot be used together'
237+
It "Should validate mutual exclusivity of SkipExternalLinksCheck and NoCache" {
238+
$scriptContent | Should -Match 'SkipExternalLinksCheck.*NoCache.*cannot be used together'
235239
}
236240

237241
It "Should reference generate-guides-lists.ps1" {

utilities/run-utils.ps1

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,16 @@
3535
.PARAMETER TestsOnly
3636
Run only Phase 1 (Pester tests) without running the utilities.
3737
38-
.PARAMETER SkipLinkCheck
38+
.PARAMETER SkipInternalLinksCheck
39+
Skip internal link checking in Phase 2. Useful for quick iterations.
40+
41+
.PARAMETER SkipExternalLinksCheck
3942
Skip external link checking in Phase 2 (internal links are still checked). Useful for quick iterations.
4043
Mutually exclusive with -NoCache.
4144
4245
.PARAMETER NoCache
4346
Force fresh external link checks by bypassing the cache. Passes -NoCache to check-links.ps1.
44-
Mutually exclusive with -SkipLinkCheck.
47+
Mutually exclusive with -SkipExternalLinksCheck.
4548
4649
.EXAMPLE
4750
.\run-utils.ps1
@@ -56,9 +59,13 @@
5659
Skips tests and runs utilities directly.
5760
5861
.EXAMPLE
59-
.\run-utils.ps1 -SkipLinkCheck
62+
.\run-utils.ps1 -SkipExternalLinksCheck
6063
Runs tests and utilities, but skips external link checking (internal links still checked).
6164
65+
.EXAMPLE
66+
.\run-utils.ps1 -SkipInternalLinksCheck
67+
Runs tests and utilities, but skips internal link checking (external links still checked).
68+
6269
.EXAMPLE
6370
.\run-utils.ps1 -NoCache
6471
Runs tests and utilities, forcing fresh external link checks (bypasses cache).
@@ -67,14 +74,15 @@
6774
param(
6875
[switch]$SkipTests,
6976
[switch]$TestsOnly,
70-
[switch]$SkipLinkCheck,
77+
[switch]$SkipInternalLinksCheck,
78+
[switch]$SkipExternalLinksCheck,
7179
[switch]$NoCache
7280
)
7381

7482
# Validate mutually exclusive parameters
75-
if ($SkipLinkCheck -and $NoCache) {
76-
Write-Host "ERROR: -SkipLinkCheck and -NoCache cannot be used together." -ForegroundColor Red
77-
Write-Host " -SkipLinkCheck: Skips external link checking entirely (only internal links checked)" -ForegroundColor Yellow
83+
if ($SkipExternalLinksCheck -and $NoCache) {
84+
Write-Host "ERROR: -SkipExternalLinksCheck and -NoCache cannot be used together." -ForegroundColor Red
85+
Write-Host " -SkipExternalLinksCheck: Skips external link checking entirely" -ForegroundColor Yellow
7886
Write-Host " -NoCache: Forces fresh external link checks (bypasses cache)" -ForegroundColor Yellow
7987
exit 1
8088
}
@@ -368,9 +376,12 @@ if (-not $TestsOnly) {
368376

369377
# 3. Check links
370378
$linkCheckScript = Join-Path $utilPath "check-links.ps1"
371-
if ($SkipLinkCheck) {
372-
# Only check internal links when -SkipLinkCheck is used
373-
Write-Host " Step 3/3: Checking internal links only (-SkipLinkCheck)" -ForegroundColor Cyan
379+
if ($SkipInternalLinksCheck -and $SkipExternalLinksCheck) {
380+
# Skip link checking entirely
381+
Write-Host " Step 3/3: Skipping link check (-SkipInternalLinksCheck -SkipExternalLinksCheck)" -ForegroundColor Yellow
382+
} elseif ($SkipExternalLinksCheck) {
383+
# Only check internal links when -SkipExternalLinksCheck is used
384+
Write-Host " Step 3/3: Checking internal links only (-SkipExternalLinksCheck)" -ForegroundColor Cyan
374385
Write-Host ""
375386
& $linkCheckScript -internal
376387
if ($LASTEXITCODE -ne 0) {
@@ -379,6 +390,23 @@ if (-not $TestsOnly) {
379390
Write-Host "PHASE 2 FAILED at Step 3" -ForegroundColor Red
380391
exit 1
381392
}
393+
} elseif ($SkipInternalLinksCheck) {
394+
# Only check external links when -SkipInternalLinksCheck is used
395+
if ($NoCache) {
396+
Write-Host " Step 3/3: Checking external links only (-SkipInternalLinksCheck -NoCache)" -ForegroundColor Cyan
397+
Write-Host ""
398+
& $linkCheckScript -external -NoCache
399+
} else {
400+
Write-Host " Step 3/3: Checking external links only (-SkipInternalLinksCheck)" -ForegroundColor Cyan
401+
Write-Host ""
402+
& $linkCheckScript -external
403+
}
404+
if ($LASTEXITCODE -ne 0) {
405+
Write-Host ""
406+
Write-Host "==========================================="
407+
Write-Host "PHASE 2 FAILED at Step 3" -ForegroundColor Red
408+
exit 1
409+
}
382410
} elseif ($NoCache) {
383411
# Check all links with fresh cache
384412
Write-Host " Step 3/3: Checking all links (-NoCache)" -ForegroundColor Cyan

zensical.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ nav = [
734734
{"Why is the dataset not global like OSM?" = "assistant/workspaces/why-is-the-dataset-not-global-like-osm.md"},
735735
{"Why is Workspaces compatible with OSM tools?" = "assistant/workspaces/why-is-workspaces-compatible-with-osm-tools.md"},
736736
{"Why must imagery use raw JSON links?" = "assistant/workspaces/why-must-imagery-use-raw-json-links.md"},
737-
{"Policies" = [ "assistant/workspaces/policies/index.md" ]},
737+
{"Policy" = [ "assistant/workspaces/policy/index.md" ]},
738738
{"Workflow" = [
739739
"assistant/workspaces/workflow/index.md",
740740
{"Configure imagery layers in a workspace" = "assistant/workspaces/workflow/configure-imagery-layers.md"},

0 commit comments

Comments
 (0)