Repository navigation
Migrate to Avalonia 12 and add application regression coverage - #2918
Open
miloszkukla wants to merge 18 commits into
Open
miloszkukla wants to merge 18 commits into
miloszkukla wants to merge 18 commits into
Conversation
Align Avalonia packages and pin the published SourceGit AvaloniaEdit 12.x fork while retaining its editor fixes. Update custom window chrome and overlay layers, keyboard selection, popup ownership, bindings, rendering, placeholders, and diagnostics for Avalonia 12. Add twelve headless integration cases and a three-platform CI workflow. Document the migration sources, verified Debug/Release builds and managed publish, and the environment limitation on NativeAOT validation.
Expand the existing NUnit suite from 12 to 503 cases covering models and parsers, generated patches, disposable Git workflows, view-model state, headless controls, and local AI configuration/tool handling. Isolate configuration and Git environment state, preserve the original migration tests, and document existing editor coverage, validation commands, remaining boundaries, and a pre-existing diff3 result-preview defect.
Adapt the distinct recovered xUnit scenarios to the existing NUnit headless suite: clipboard paste, typed repository drag-over, multiselection keys, Space-to-save, theme/font loading, confirmation captions, diff rendering, and split scrolling. Require the reusable three-platform test workflow before both CI and release packaging, avoid duplicate test triggers, and expand Native AOT dependency diagnostics. Validation: 519 tests passed with no failures or skips; all 503 baseline cases retained. Nonincremental Release solution and test builds passed without warnings or errors. Record the fresh Native AOT task-host blocker and bounded DataGrid warning analysis.
Rename RecoveredInputTests.cs and its fixture to InputInteractionTests, and update the validation document link. The existing seven test cases are unchanged and pass under the renamed fixture.
Preserve all 519 application test cases and add exclusive Unit, Integration, and Headless categories. Use Avalonia's xUnit adapter and .NET 10 native MTP. Collect SourceGit coverage with Coverlet, including compiled XAML through readable helper names in test builds. Publish coverage summaries and artifacts in the existing three-platform test workflow, retaining packaging gates. Update current test instructions and mark earlier snapshots as history. Validation: clean Release rebuild, 519/519 direct MTP tests with coverage, matching discovery and method case counts, and verified CI summary output. SDK-coordinated execution remains blocked by this host's named-pipe policy.
Replace Coverlet with Microsoft.Testing.Extensions.CodeCoverage 18.12.0. Keep the full SourceGit assembly in scope, including auto-properties, authored closures, and compiled XAML, with explicit inclusion/exclusion settings. Update the reusable test workflow and report filename while retaining packaging gates. Document the new collector and distinguish historical Coverlet metrics from the pending Microsoft baseline. Release build passed with zero warnings/errors and all 519 direct MTP tests passed. SDK/MTP coverage and standalone dotnet-coverage collection were blocked by this host's named-pipe policy before producing a report.
Normalize Git directory results before filesystem path assertions. Use forward-slash URLs in the remote metadata fixture so Git's URL deletion regex matches the configured Windows path. Validated the Release build and all 19 affected test cases on Linux, plus an isolated Git reproduction of the Windows-form URL deletion.
Preserve parent index modes when unstaging amendments and export usable untracked, empty, and binary patches while retaining real error handling. Strengthen layout and repository-move assertions, add refusal-path and independent-setting cases, and cover selected completion, graph connectors, staged stash restoration, and omitted diff lines. Update suite documentation. Validation: non-incremental Release build with zero warnings/errors; 539 application tests passed, zero failed or skipped; XML/TRX reports parsed.
Merge develop at db7c558, matching sourcegit-org/sourcegit, while retaining the migration's parent-mode restoration fix with NUL-delimited Git parsing. Replace obsolete Change.Set tests with five real Git path-parsing cases, including renamed/copied paths and special characters. Add eleven pinned branch cases covering incomplete snapshots, failed refreshes and stale-pin pruning. Update test documentation and the root README's native MTP command. Validation: non-incremental Release solution and test builds with zero warnings and errors; 139 focused and 551 full-suite tests passed, with zero failures or skips. XML/TRX reports, category counts, discovery and four PNG attachments verified. Direct MTP execution used because SDK test IPC is blocked by host named-pipe permissions. Microsoft coverage collection and NativeAOT publishing remain unverified.
There was a problem hiding this comment.
🔵 Needs a closer look
The Avalonia major upgrade changes native window chrome and removes Windows workarounds, while Linux/headless checks and managed publishing leave Windows/macOS desktop behavior and Native AOT execution unvalidated.
No open issues 🎉
What changed in this PR
Migrates SourceGit to Avalonia 12 while retaining .NET 10, Fluent styling, and Native AOT publishing. Adds application regression coverage and makes cross-platform tests a prerequisite for packaging.
Changes:
- Align Avalonia dependencies and adapt windowing, bindings, rendering, popup ownership, and input handling.
- Add isolated unit, Git integration, and headless UI tests, plus coverage reporting and test documentation.
- Preserve parent file modes during amend restoration and improve binary and untracked-file patch export.
| File | Description |
|---|---|
| tests/SourceGit.Tests/ViewModels/WorkflowTests.cs | Tests validation, commit composition, action filtering, and popup workflows. |
| tests/SourceGit.Tests/ViewModels/RepositoryOrganizationTests.cs | Tests repository grouping, filtering, and workspace organization. |
| tests/SourceGit.Tests/ViewModels/RepositoryBranchStateTests.cs | Tests pin preservation and pruning during branch refreshes. |
| tests/SourceGit.Tests/ViewModels/MergeConflictEditorTests.cs | Tests conflict parsing, resolution, and save safeguards. |
| tests/SourceGit.Tests/testconfig.json | Defines production-code coverage scope. |
| tests/SourceGit.Tests/TestAppBuilder.cs | Configures isolated application and headless test lifetimes. |
| tests/SourceGit.Tests/SourceGit.Tests.csproj | Adds the xUnit/Microsoft.Testing.Platform test project. |
| tests/SourceGit.Tests/Models/TextInlineChangeTests.cs | Tests inline diff ranges and Unicode handling. |
| tests/SourceGit.Tests/Models/TemplateEngineTests.cs | Tests template expansion, escaping, and malformed input. |
| tests/SourceGit.Tests/Models/StatisticsTests.cs | Tests statistics aggregation, labels, and date boundaries. |
| tests/SourceGit.Tests/Models/SafeDirectoriesTests.cs | Tests ownership diagnostics and safe-directory path parsing. |
| tests/SourceGit.Tests/Models/RemoteTests.cs | Tests remote validation and generated web links. |
| tests/SourceGit.Tests/Models/RefNameTests.cs | Tests branch and tag naming rules. |
| tests/SourceGit.Tests/Models/LfsObjectTests.cs | Tests Git LFS pointer parsing. |
| tests/SourceGit.Tests/Models/IssueTrackerTests.cs | Tests issue links, offsets, and overlapping ranges. |
| tests/SourceGit.Tests/Models/InteractiveRebaseTests.cs | Tests rebase todo and commit-message files. |
| tests/SourceGit.Tests/Models/GitMetadataTests.cs | Tests commit metadata, identities, and reference sorting. |
| tests/SourceGit.Tests/Models/DiffOptionTests.cs | Tests diff arguments across repository states. |
| tests/SourceGit.Tests/Models/CommitGraphTests.cs | Tests graph geometry and highlighting. |
| tests/SourceGit.Tests/Models/BinaryFileTests.cs | Tests buffered reads and owned-file disposal. |
| tests/SourceGit.Tests/Infrastructure/TestDirectory.cs | Provides bounded temporary-file creation and cleanup. |
| tests/SourceGit.Tests/Infrastructure/TestCultureAttribute.cs | Scopes formatting culture to individual tests. |
| tests/SourceGit.Tests/Infrastructure/GitTestEnvironment.cs | Isolates Git configuration, identity, and transports. |
| tests/SourceGit.Tests/Infrastructure/GitRepository.cs | Provides disposable repositories and bounded Git execution. |
| tests/SourceGit.Tests/Git/GitWorkingTreeTests.cs | Tests staging, discarding, moving, and removing files. |
| tests/SourceGit.Tests/Git/GitTestCommands.cs | Adds command configuration and path-normalization helpers. |
| tests/SourceGit.Tests/Git/GitStashTests.cs | Tests stash creation, restoration, and lifecycle operations. |
| tests/SourceGit.Tests/Git/GitPathParsingTests.cs | Tests unusual filenames through directly written Git objects. |
| tests/SourceGit.Tests/Git/GitCommandTests.cs | Tests command results, repository queries, and configuration. |
| tests/SourceGit.Tests/Converters/ConverterTests.cs | Tests formatting, conversion, and escaping behavior. |
| tests/SourceGit.Tests/Controls/NavigationControlTests.cs | Tests go-to-line input and diff navigation. |
| tests/SourceGit.Tests/Controls/InputInteractionTests.cs | Tests clipboard, drag payloads, and keyboard actions. |
| tests/SourceGit.Tests/Controls/CommitMessageControlTests.cs | Tests commit-message completion and save/cancel interactions. |
| tests/SourceGit.Tests/Controls/ChangeCollectionControlTests.cs | Tests selection preservation and change-tree navigation. |
| tests/SourceGit.Tests/AI/ServiceTests.cs | Tests model selection and service serialization. |
| tests/SourceGit.Tests/AI/ExtraHeadersPolicyTests.cs | Tests synchronous and asynchronous header policies. |
| tests/SourceGit.Tests/AI/ChatToolsTests.cs | Tests tool validation and selected staged-diff retrieval. |
| tests/SourceGit.Tests/AI/ApiKeyTests.cs | Tests isolated API-key lookup and persistence. |
| tests/README.md | Documents test execution, coverage, isolation, and CI. |
| src/Views/WorkingCopy.axaml | Migrates the change-filter placeholder property. |
| src/Views/Welcome.axaml | Migrates the repository-search placeholder property. |
| src/Views/TextDiffView.axaml.cs | Uses typed compiled scroll-offset bindings. |
| src/Views/SubmoduleRevisionCompare.axaml | Migrates the comparison-search placeholder property. |
| src/Views/StashChanges.axaml | Migrates the stash-message placeholder property. |
| src/Views/SSHKeyHelper.axaml | Migrates key-generator placeholder properties. |
| src/Views/SetSubmoduleBranch.axaml | Migrates the branch-input placeholder property. |
| src/Views/RevisionFiles.axaml | Migrates the file-search placeholder property. |
| src/Views/RevisionCompare.axaml | Migrates the revision-search placeholder property. |
| src/Views/RepositoryToolbar.axaml.cs | Moves menu text rendering to TextOptions. |
| src/Views/RepositoryConfigure.axaml | Migrates repository-setting placeholder properties. |
| src/Views/Repository.axaml | Migrates the branch-filter placeholder property. |
| src/Views/RenameBranch.axaml | Migrates the rename-input placeholder property. |
| src/Views/Preferences.axaml | Migrates preference-field placeholder properties. |
| src/Views/MoveSubmodule.axaml | Migrates the destination placeholder property. |
| src/Views/MergeConflictEditor.axaml.cs | Uses typed compiled scroll and selection bindings. |
| src/Views/ListBoxEx.cs | Prevents Enter/Space from changing selection before actions run. |
| src/Views/InitGitFlow.axaml | Migrates the optional tag-prefix placeholder property. |
| src/Views/GotoLineBar.axaml.cs | Updates placeholder and focus-event APIs. |
| src/Views/GitFlowStart.axaml | Migrates the branch-name placeholder property. |
| src/Views/ExecuteCustomAction.axaml | Migrates custom-action input placeholder properties. |
| src/Views/EditRemote.axaml | Migrates remote-setting placeholder properties. |
| src/Views/DateTimePresenter.cs | Uses typed compiled preference bindings. |
| src/Views/CreateTag.axaml | Migrates tag-name and message placeholder properties. |
| src/Views/CreateBranch.axaml | Migrates the branch-name placeholder property. |
| src/Views/ConventionalCommitMessageBuilder.axaml | Migrates optional commit-field placeholder properties. |
| src/Views/ControlExtensions.cs | Imports the updated clipboard extension namespace. |
| src/Views/Compare.axaml | Migrates the comparison-filter placeholder property. |
| src/Views/CommitSubjectPresenter.cs | Separates text and geometric rendering options. |
| src/Views/CommitMessageToolBox.axaml.cs | Updates the lost-focus event signature. |
| src/Views/CommitMessageToolBox.axaml | Migrates the commit-message placeholder property. |
| src/Views/CommitChanges.axaml | Migrates the change-search placeholder property. |
| src/Views/Clone.axaml | Migrates clone-field placeholder properties. |
| src/Views/ChromelessWindow.cs | Replaces the Windows frame workaround with border-state updates. |
| src/Views/CheckoutRemoteBranchAsWorktree.axaml | Migrates worktree and branch placeholder properties. |
| src/Views/CheckoutAsWorktree.axaml | Migrates the worktree-path placeholder property. |
| src/Views/ChangeSubmoduleUrl.axaml | Migrates the URL placeholder property. |
| src/Views/BranchTree.axaml.cs | Resolves popup ownership through logical ancestry and placement. |
| src/Views/BinaryFileViewer.axaml | Migrates the address-input placeholder property. |
| src/Views/Avatar.cs | Updates preference bindings and PNG encoding APIs. |
| src/Views/Archive.axaml | Migrates the archive-path placeholder property. |
| src/Views/Apply.axaml | Migrates the patch-file placeholder property. |
| src/Views/AIAssistant.axaml.cs | Imports the updated input API namespace. |
| src/Views/AddWorktree.axaml | Migrates worktree creation placeholder properties. |
| src/Views/AddSubmodule.axaml | Migrates submodule creation placeholder properties. |
| src/Views/AddRemote.axaml | Migrates remote creation placeholder properties. |
| src/SourceGit.csproj | Updates Avalonia, DataGrid, and diagnostics dependencies. |
| src/Resources/Styles.axaml | Updates window decorations, template parts, and search placeholders. |
| src/Native/Windows.cs | Adopts border-only decorations and removes legacy frame adjustments. |
| src/Native/MacOS.cs | Uses the replacement window-decoration API. |
| src/Native/Linux.cs | Preserves native/custom frame choices through the new API. |
| src/Models/DiffOption.cs | Exposes whether a diff uses --no-index. |
| src/Commands/UpdateIndexInfo.cs | Restores amend entries using their parent file modes. |
| src/Commands/SaveChangesAsPatch.cs | Adds binary patches and handles no-index difference exit codes. |
| src/Commands/QueryStagedChangesWithAmend.cs | Captures parent-entry modes alongside parent object hashes. |
| src/App.axaml.cs | Updates diagnostics startup and removes obsolete validator mutation. |
| README.md | Adds migration context and application test instructions. |
| global.json | Selects Microsoft.Testing.Platform as the test runner. |
| docs/avalonia-12-recovery-validation.md | Records recovered coverage and historical validation evidence. |
| docs/avalonia-12-migration.md | Documents migration decisions, dependencies, and validation scope. |
| Directory.Build.targets | Aligns application/editor Avalonia versions and updates SourceLink. |
| .gitmodules | Sets the editor submodule’s tracking branch to patch-on-12.x. |
| .gitignore | Excludes generated test results. |
| .github/workflows/test.yml | Runs cross-platform tests with coverage and artifact uploads. |
| .github/workflows/release.yml | Requires the test matrix before release packaging. |
| .github/workflows/ci.yml | Requires the test matrix before CI packaging. |
| .github/workflows/build.yml | Enables individual trimming diagnostics during publishing. |
Review effort: Balanced
Author
|
The latest CI validation evidence was added to the PR description after Copilot's review. Please see its Validation section for the current test, coverage, Native AOT publishing, and packaging results. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upgrade SourceGit from Avalonia 11.3.22 to 12.2.0 and preserve its desktop window, popup, keyboard, clipboard, and diff-editor behavior. The application keeps its .NET 10 target, Fluent theme, and Native AOT publishing configuration.
Changes
patch-on-12.x; keep the app and editor dependency versions aligned.Tests and CI
Validation
CI run 46789194614 on 2026-12-02 tested
e4e6d576: all 16 jobs passed. Build and test jobs used .NET SDK 10.0.404.All 551 application cases passed on each OS with Microsoft coverage enabled, with zero failures or skips:
win-x64,win-arm64,osx-x64,osx-arm64,linux-x64, andlinux-arm64.IL3050diagnostics, documented with the source-level runtime-path analysis.See the coverage measurements and publish/packaging evidence for integer coverage counts, target-specific jobs, and artifact links. The workflow does not launch the native GUI executables.
Upstream
developatdb7c55832fc4fb4d1a07f803ccaa55fc21a36eb1is merged into this branch, including regression coverage for NUL-delimited Git paths and pinned-branch refresh behavior.Native AOT warning history
DataGrid AOT warnings predate this migration: successful upstream publishes at
197646fdanddb7c5583already reported aggregateIL3053warnings forAvalonia.Controls.DataGrid. This workflow usesTrimmerSingleWarn=falseto expose individual diagnostics; the historical logs do not establish which exact warnings, or how many, were present.MakeGenericTypecall sites are unchanged:ReflectionHelper.csis identical between DataGrid 11.3.13 and 12.1.2.GenerateColumnalready created aBindingbefore migration. Avalonia 12 changedBindinginto aReflectionBindingcompatibility wrapper and addedRequiresDynamicCode(compare 11.3.22 with 12.2.0), exposing the currentGenerateColumn → Binding(String)IL3050diagnostic.