From d441abd20f69b3986dbe02ae9bc97474cd6b29c4 Mon Sep 17 00:00:00 2001 From: cproudlock Date: Sun, 14 Jun 2026 13:12:07 -0400 Subject: [PATCH] CMM: goCMM restore - canonicalize the SHARE segment case, not just the host goCMM showed an empty parts list after restore though the bay reached the share. Decompiled goCMM: PartGroupViewModel matches the registry Selected Part Group against ApplicationSettings.xml with a CASE-SENSITIVE compare, then enumerates that FullName for the parts. The host-canon rewrite fixed only the hostname, leaving xml '\shared' (lowercase) vs registry '\SHARED' (uppercase) -> Find null -> SelectedPartGroup null -> empty list. Fix spans the share segment too, pinning both to \tsgwp00525.wjs.geaerospace.net\SHARED. Verified in PowerShell (-ceq True). Runs at imaging in Restore-CMM, so all captured backups are fixed on restore with no re-backup. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../scripts/Install-goCMMSettings.ps1 | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/playbook/shopfloor-setup/gea-shopfloor-cmm/scripts/Install-goCMMSettings.ps1 b/playbook/shopfloor-setup/gea-shopfloor-cmm/scripts/Install-goCMMSettings.ps1 index acabff1..e7e8a3a 100644 --- a/playbook/shopfloor-setup/gea-shopfloor-cmm/scripts/Install-goCMMSettings.ps1 +++ b/playbook/shopfloor-setup/gea-shopfloor-cmm/scripts/Install-goCMMSettings.ps1 @@ -54,9 +54,18 @@ $DefaultRewrites = @( # already-correct FQDN maps to itself). Disabled by -NoDefaultRewrite. $PartGroupHostShort = 'tsgwp00525' $PartGroupHostFqdn = 'tsgwp00525.wjs.geaerospace.net' -# \\HOST or \\HOST.any.domain (followed by the next path backslash) -> \\FQDN -$PartGroupHostRx = '(?i)\\\\' + [regex]::Escape($PartGroupHostShort) + '(?:\.[A-Za-z0-9.\-]+)?(?=\\)' -$PartGroupHostTo = '\\' + $PartGroupHostFqdn +# \\HOST or \\HOST.any.domain PLUS the \shared share segment (any case) -> +# the exact canonical \\FQDN\SHARED. The share segment case MUST be normalized +# too, not just the host: goCMM matches the registry 'Selected Part Group' +# against the ApplicationSettings.xml with a CASE-SENSITIVE +# string compare (PartGroupViewModel: Find(pg => pg.FullName == regValue)). If +# only the host were fixed, the xml kept '\shared' (lowercase, as captured) while +# the override/09-Setup form is '\SHARED' (uppercase) -> Find returns null -> +# SelectedPartGroup null -> goCMM enumerates nothing -> EMPTY parts list even +# though the bay can reach the share. Match the whole host+share span and pin +# both to '\\tsgwp00525.wjs.geaerospace.net\SHARED'. Idempotent. +$PartGroupHostRx = '(?i)\\\\' + [regex]::Escape($PartGroupHostShort) + '(?:\.[A-Za-z0-9.\-]+)?\\shared(?=\\|$)' +$PartGroupHostTo = '\\' + $PartGroupHostFqdn + '\SHARED' $ErrorActionPreference = 'Continue' $ts = Get-Date -Format 'yyyyMMdd-HHmmss' $logDir = 'C:\Logs\CMM'