Skip to content

chore: improve build, test, and installer reliability#908

Open
johnml1135 wants to merge 3 commits into
mainfrom
cleanup/non-render-build-installer
Open

chore: improve build, test, and installer reliability#908
johnml1135 wants to merge 3 commits into
mainfrom
cleanup/non-render-build-installer

Conversation

@johnml1135
Copy link
Copy Markdown
Contributor

@johnml1135 johnml1135 commented May 21, 2026

Summary

This is a focused non-render cleanup for FieldWorks build, test, and installer reliability. It does not change product UI behavior; it makes local and CI workflows easier to reason about after branch switches, interrupted builds, installer work, and machine-specific test output.

What changed and why

Build and native-test reliability

  • Add shared timestamp helpers in Build/Agent/FwBuildHelpers.psm1 and use them from build.ps1 / Build/scripts/Invoke-CppTest.ps1 to detect stale Views/FwKernel native artifacts before building or running TestViews.
  • Keep the freshness scan targeted by enumerating matching file patterns directly and including native project/build inputs such as *.vcxproj, *.props, *.targets, *.inl, and related files.
  • Rationale: after branch switches or partial native builds, generated headers and native artifacts can exist but be older than their inputs. Treating "exists" as "fresh" leads to confusing downstream build/test failures.

SDK-style build hygiene

  • Set default SolutionDir / SolutionName in Directory.Build.props for nested SDK-style projects.
  • Exclude known stale WPF temp project file types from SDK auto-globbing and clean those files before MarkupCompilePass2 for WPF projects.
  • Rationale: deeply nested test projects do not always infer solution metadata correctly, and interrupted WPF builds can leave temporary project files behind that break the next build. FieldWorks is mostly WinForms, but ParserUI contains a small WPF/XAML surface.

Installer dependency and packaging cleanup

  • Keep WiX DTF package versions centralized under FLExInstaller/Directory.Packages.props while keeping them scoped to installer projects.
  • Remove explicit WiX package versions from the WiX 6 custom actions project.
  • Adjust legacy installer harvesting so ScrChecks.dll / ScrChecks.pdb are treated consistently with files supplied from DistFiles\Editorial Checks.
  • Rationale: installer package versions belong with installer-specific package policy, not scattered through individual projects or the root package map.

Platform and diagnostics clarity

  • Make build.ps1 fail fast on non-Windows hosts and clarify in docs that Linux/macOS are useful for editing, search, docs, specs, and agent review, but not FieldWorks build/test/installer runs.
  • Rename the preferred trace build switch to -EnableTracing, while keeping -TraceCrashes and the legacy --TraceCrashes fallback for compatibility.
  • Simplify Src/AppForTests.config trace listener type binding so the test config is less tied to a specific assembly version string.
  • Rationale: FieldWorks is a Windows/x64 build/test target. The scripts and docs now say that plainly, without breaking existing local trace commands.

Agent helper and whitespace tooling cleanup

  • Make Verify-FwDependencies.ps1 handle singleton pipeline results as arrays so summary counts stay reliable.
  • Make Build/Agent/fix-whitespace.ps1 use explicit UTF-8 encodings, preserve existing BOM state for ordinary text files, and force BOM-less output only for .cmd / .bat entrypoint scripts.
  • Make scripts/Agent/Git-Search.ps1 prefer the current repo/worktree when inferring its root.
  • Rationale: these are small reliability fixes for the repo's agent-facing helper scripts, and the whitespace tool should not create noisy encoding-only churn.

Deterministic TonePars comparison

  • Normalize absolute Windows path prefixes in ToneParsInvokerTests before comparing generated command content.
  • Rationale: the test should verify generated command semantics, not the developer machine's absolute temp or repo path.

Scope notes

  • No Src/xWorks changes are included.
  • No AI review workflow or generic code-review-skill changes are included; that work belongs in Refine FieldWorks AI review workflows #905.
  • This PR is intentionally non-render cleanup. Render-speedup and xWorks command-routing work are separate.

Validation

  • CI: Commit messages passed after the review-fix commit.
  • CI: Whitespace check reported No problems found after the review-fix commit. Its fixer step tried to normalize unrelated files because origin/main advanced; that validation-time churn was discarded.
  • Focused checks passed after the review-fix commit: build.ps1 parses, Build/Agent/fix-whitespace.ps1 parses, FwBuildHelpers.psm1 imports, -TraceCrashes is registered as an alias for -EnableTracing, scripts/toolshims/environ.cmd has no UTF-8 BOM, and the timestamp helper smoke test passed.
  • Earlier during this cleanup branch, shell: Build passed before the final PR recreation.
  • Earlier during this cleanup branch, shell: Test passed before the final PR recreation: 4150 total, 4090 passed, 60 skipped.
  • Product build/test were not rerun after the review-fix commit.

Reviewer focus

  • Native artifact freshness logic in Build/Agent/FwBuildHelpers.psm1, build.ps1, and Build/scripts/Invoke-CppTest.ps1.
  • SDK-style defaults and WPF temp project cleanup in Directory.Build.props / Directory.Build.targets.
  • Installer package scoping in FLExInstaller/Directory.Packages.props and the WiX custom actions project.
  • Trace switch compatibility in build.ps1.
  • BOM handling in Build/Agent/fix-whitespace.ps1 and scripts/toolshims/environ.cmd.

This change is Reviewable

Keep build/test helper cleanup out of the render commit.

Keep agent, installer, and xWorks cleanup separate.

Normalize TonePars generated-file comparisons for Windows paths.

chore: drop legacy CollectTargets changes

chore: narrow non-render cleanup scope

chore: normalize non-render cleanup whitespace
Copilot AI review requested due to automatic review settings May 21, 2026 19:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Improves FieldWorks build/test/installer reliability and developer/CI ergonomics by hardening scripts, normalizing diagnostics toggles, and cleaning up stale artifacts (native and WPF) that commonly break subsequent builds after interruptions or branch switches.

Changes:

  • Adds native artifact freshness checks and a fail-fast non-Windows guard in build/test scripts.
  • Improves SDK/WPF build hygiene via solution metadata defaults and stale *_wpftmp* exclusion/cleanup.
  • Centralizes WiX DTF package versions under installer-scoped CPM and updates docs/tooling guidance accordingly.

Reviewed changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
scripts/toolshims/environ.cmd Updates deprecated shim messaging (now Windows-only guidance).
scripts/Agent/Git-Search.ps1 Improves repo-root inference and provides clearer failure when not in a repo.
build.ps1 Renames tracing switch, adds non-Windows fail-fast, and refreshes stale native artifacts for TestViews builds.
Test.runsettings Normalizes formatting/indentation.
Src/Utilities/pcpatrflex/DisambiguateInFLExDB/DisambiguateInFLExDBTests/ToneParsInvokerTests.cs Normalizes Windows absolute paths in test comparisons.
Src/AppForTests.config Simplifies trace listener binding to avoid version-specific assembly qualification.
SDK_MIGRATION.md Updates docs to reflect -EnableTracing rename.
ReadMe.md Clarifies Linux/macOS limitations (edit/review only; no build/test/installer).
FLExInstaller/wix6/Shared/CustomActions/CustomActions/CustomActions.csproj Removes explicit WiX DTF versions to rely on installer-scoped CPM.
FLExInstaller/Directory.Packages.props Enables CPM within installer subtree and centralizes WiX DTF versions.
Docs/CONTRIBUTING.md Updates platform guidance and notes non-Windows scripts intentionally fail fast.
Directory.Build.targets Adds target to delete stale WPF temp project files before markup compile pass 2.
Directory.Build.props Sets SolutionDir/SolutionName defaults and excludes *_wpftmp* from SDK globbing.
Build/scripts/Invoke-CppTest.ps1 Uses shared staleness check to refresh native prerequisites for TestViews.
Build/Src/NativeBuild/NativeBuild.csproj Formatting-only change to a PackageReference element.
Build/Installer.legacy.targets Treats ScrChecks artifacts consistently in legacy installer harvesting.
Build/Agent/fix-whitespace.ps1 Simplifies whitespace fixer by removing custom BOM preservation logic.
Build/Agent/Verify-FwDependencies.ps1 Ensures summary counts are reliable by forcing pipeline results into arrays.
Build/Agent/README.md Documents Run-AllRenders.ps1.
Build/Agent/FwBuildHelpers.psm1 Adds shared timestamp helpers + Views native artifact staleness detection.
AGENTS.md Updates agent playbook and adds external dependency note for LibLcm.
.vscode/settings.json Adjusts auto-approved tasks list and clarifies Windows-only tasks requiring approval.
.github/workflows/patch-installer-cd.yml Whitespace/formatting cleanup in workflow.
.github/instructions/dotnet-framework.instructions.md Minor whitespace cleanup.

Comment thread scripts/toolshims/environ.cmd Outdated
Comment thread build.ps1
Comment thread Build/Agent/FwBuildHelpers.psm1 Outdated
Comment thread Build/Agent/FwBuildHelpers.psm1 Outdated
Comment thread Build/Agent/fix-whitespace.ps1 Outdated
Comment thread Directory.Build.targets Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 21, 2026

NUnit Tests

    1 files  ±0      1 suites  ±0   11m 7s ⏱️ +34s
4 204 tests  - 1  4 133 ✅  - 1  71 💤 ±0  0 ❌ ±0 
4 213 runs   - 1  4 142 ✅  - 1  71 💤 ±0  0 ❌ ±0 

Results for commit ae21869. ± Comparison against base commit 5ce891b.

This pull request removes 2 and adds 1 tests. Note that renamed tests count towards both.
SIL.FieldWorks.Language.ManagedVwWindowTests ‑ NotSettingWindowTest
SIL.FieldWorks.Language.ManagedVwWindowTests ‑ SimpleWindowTest
SIL.FieldWorks.Common.RootSites.RootSiteTests.RealDataTestsBaseCleanupTests ‑ RunSetupFailureCleanup_ReleasesMutexEvenWhenDisposeFails

♻️ This comment has been updated with latest results.

@jasonleenaylor
Copy link
Copy Markdown
Contributor

Build/Installer.legacy.targets line 286 at r2 (raw file):

			<!-- this will be taken from DistFiles\Editorial Checks -->
			<MergeModules Include="$(OutputDirForConfig)\ScrChecks.pdb" />
			<!-- this will be taken from DistFiles\Editorial Checks -->

I don't know where this came from. Maybe I should but it has me confused.

Copy link
Copy Markdown
Contributor

@jasonleenaylor jasonleenaylor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jasonleenaylor reviewed 24 files and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on johnml1135).


Src/Utilities/pcpatrflex/DisambiguateInFLExDB/DisambiguateInFLExDBTests/ToneParsInvokerTests.cs line 190 at r2 (raw file):

			normalized = NormalizeViaIndex(normalized, "TestData", "TestData");
			normalized = NormalizeViaIndex(normalized, tp, tp);
			return Regex.Replace(normalized, @"[A-Za-z]:\\(?:[^\\\r\n""]+\\)*", "");

Add a comment here for humans who can't easily parse regex so we understand the purpose of the replace in the future.

@johnml1135
Copy link
Copy Markdown
Contributor Author

@jasonleenaylor Pushed in ae21869. For the ScrChecks.* lines: those entries are only there to keep the output-root copies out of the broad $(OutputDirForConfig)*** harvest, so the installer still takes the canonical copies from DistFiles\Editorial Checks. I reworded the adjacent comments in Build/Installer.legacy.targets to make that intent explicit. For ToneParsInvokerTests, I added an inline comment above the regex explaining that it strips machine-specific absolute Windows path prefixes before comparison so the test stays stable across temp and repo roots.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants