Skip to content
Draft
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
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,24 @@ jobs:
throw 'converge.ps1 must run user-path.ps1 as a named step.'
}

# Native Windows dotfiles linking is not canonical yet: the user-level
# agent configuration is owned by the WSL side until the Windows link
# adapter is enabled. A failing link step must not fail the machine
# convergence.
- name: Validate the Windows dotfiles link step stays non-fatal
shell: pwsh
run: |
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'

$converge = Get-Content -LiteralPath ./platforms/windows-11/converge.ps1 -Raw
if ($converge -notmatch "Add-Step 'dotfiles-link' 'pending'") {
throw 'the Windows dotfiles link step must be recorded as pending, not as an error.'
}
if ($converge -match "Add-Step 'dotfiles-link' 'error'") {
throw 'the Windows dotfiles link step must not be recorded as an error.'
}

- name: Validate converge survives a step error and always reports
shell: pwsh
run: |
Expand Down
9 changes: 7 additions & 2 deletions platforms/windows-11/converge.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ function Invoke-DotfilesSync {
}
$link = Join-Path (Join-Path $DotfilesDir 'script') 'link.ps1'
if (-not (Test-Path -LiteralPath $link)) {
Add-Step 'dotfiles-link' 'error' ($link + ' is missing')
Add-Step 'dotfiles-link' 'pending' ($link + ' is missing; native Windows dotfiles linking is not canonical yet')
return
}
# -Apply is adoption-first in link.ps1: it creates absent links and never
Expand All @@ -302,7 +302,12 @@ function Invoke-DotfilesSync {
$why = '; ' + ([string]$conflict[0]).Trim()
if ($why.Length -gt 200) { $why = $why.Substring(0, 200) }
}
Add-Step 'dotfiles-link' 'error' ('link.ps1 exited ' + $LASTEXITCODE + $why + '; see ' + $script:LogFile)
# Native Windows dotfiles linking is not canonical yet: the user-level
# agent configuration is owned by the WSL side until the Windows link
# adapter is enabled (platforms/windows-11/README.md). A failure here is
# therefore recorded as pending instead of failing the machine
# convergence (rebuildup/pc-setup#288).
Add-Step 'dotfiles-link' 'pending' ('link.ps1 exited ' + $LASTEXITCODE + $why + '; native Windows dotfiles linking is not canonical yet; see ' + $script:LogFile)
}
}

Expand Down