Author SHA1 Message Date
forge-recovery 9f243b969a docs(ci): document centralized native verification
KofTwentyTwo/ci-policy: ci / fork-guard (pull_request) Skipped
KofTwentyTwo/ci-policy: ci / gradle-0 (pull_request) Skipped
KofTwentyTwo/ci-policy: ci / gradle-1 (pull_request) Skipped
KofTwentyTwo/ci-policy: ci / java-docker-2 (pull_request) Skipped
KofTwentyTwo/ci-policy: ci / java-maven-3 (pull_request) Skipped
KofTwentyTwo/ci-policy: ci / manifests-4 (pull_request) Skipped
KofTwentyTwo/ci-policy: ci / node-5 (pull_request) Skipped
KofTwentyTwo/ci-policy: ci / rust-6 (pull_request) Skipped
KofTwentyTwo/ci-policy: ci / rust-7 (pull_request) Skipped
KofTwentyTwo/ci-policy: ci / rust-8 (pull_request) Skipped
KofTwentyTwo/ci-policy: ci / not-enrolled (pull_request) Skipped
KofTwentyTwo/ci-policy: native / fork-deny (pull_request) Skipped
KofTwentyTwo/ci-policy: native / swift-1 (pull_request) Skipped
KofTwentyTwo/ci-policy: native / swift-2 (pull_request) Skipped
KofTwentyTwo/ci-policy: native / swift-3 (pull_request) Skipped
KofTwentyTwo/ci-policy: Shared source and config CI / verify (pull_request) Successful in 22s
KofTwentyTwo/ci-policy: Shared source and config CI / secrets (pull_request) Successful in 22s
KofTwentyTwo/ci-policy: Shared .NET CI / secrets (pull_request) Successful in 22s
KofTwentyTwo/ci-policy: Shared source and config CI / gate (pull_request) Successful in 17s
KofTwentyTwo/ci-policy: ci / source-config-9 (pull_request) Successful in 44s
KofTwentyTwo/ci-policy: ci / ci-result (pull_request) Successful in 7s
KofTwentyTwo/ci-policy: Shared .NET CI / verify (pull_request) Successful in 1m30s
KofTwentyTwo/ci-policy: Shared .NET CI / gate (pull_request) Successful in 20s
KofTwentyTwo/ci-policy: native / dotnet-0 (pull_request) Successful in 1m55s
KofTwentyTwo/ci-policy: native / native-result (pull_request) Successful in 8s
2026-11-01 19:47:17 +00:00
9 changed files with 18 additions and 141 deletions

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
# Native CI verification
AppKit is a .NET solution whose tests need a Windows host. Its native verification is **centralized**: this repository
carries no workflow that selects a host or a runner label.
- The owner-level `native.yaml` in the KofTwentyTwo CI policy repository dispatches the shared `dotnet` profile for
`KofTwentyTwo/AppKit` with inputs declared centrally (solution, test projects, coverage packages, platform).
- It runs on pushes to the protected branches, on manual dispatch, and on pull requests opened from a branch of this same
repository. A pull request from a fork never runs on a host: a Linux `fork-deny` job fails it instead.
- The `native-result` check aggregates the native job. It fails unless the AppKit native job succeeded, so a skipped,
failed or cancelled native run cannot pass.
- The primary `ci-result` check (source/config lint and secrets scan) continues to run on every pull request.
Both `ci-result` and `native-result` are required checks for `main`. Changing what runs, where, or with which inputs is
done in the CI policy repository, never in a pull request to this repository.
-6
View File
@@ -53,12 +53,6 @@ its build targets) and copies its brand assets (`Assets/Brand/app-icon.svg`,
## Usage
The default sample/starter Help menus include **View on GitHub**,
**Submit an issue…** and **Community support…**, matching gclo. Derive the issue
chooser (`/issues/new/choose`) and Discussions (`/discussions`) from the app's
`AppInfo.RepositoryUrl`; enable GitHub Discussions during repository setup.
Both WinUI and WPF samples show the wiring without requiring a new AppKit API.
New apps should start from the KofTwentyTwo Windows app template, which has everything
below in place; the design is the
[Windows desktop reference architecture](https://github.com/KofTwentyTwo/standards/blob/main/architecture/windows-desktop-app.md).
@@ -1,45 +0,0 @@
/*
* Copyright (c) 2026 James Maes
* SPDX-License-Identifier: MIT
*/
using Microsoft.UI.Xaml;
namespace AppKit.Sample.WinUI;
/// <summary>Opens only the app's fixed public Help destinations after deliberate native menu actions.</summary>
public sealed partial class MainWindow
{
/// <summary>Shows this Windows app's repository in the user's default browser.</summary>
private async void GitHub_Click(object sender, RoutedEventArgs args) => await OpenHelpPageAsync(SampleApp.Info.RepositoryUrl!);
/// <summary>Offers the app's issue templates without sending private document data.</summary>
private async void SubmitIssue_Click(object sender, RoutedEventArgs args) => await OpenHelpPageAsync(SampleApp.IssuesUrl);
/// <summary>Opens community questions and tips in this app's repository.</summary>
private async void CommunitySupport_Click(object sender, RoutedEventArgs args) => await OpenHelpPageAsync(SampleApp.SupportUrl);
/// <summary>A missing browser or OS launch failure is visible; no document path/content is included.</summary>
private async Task OpenHelpPageAsync(Uri target)
{
try
{
if(!await global::Windows.System.Launcher.LaunchUriAsync(target))
{
StatusText.Text = "The link could not be opened. Check your default browser.";
}
}
catch(Exception exception) when(exception is System.Runtime.InteropServices.COMException or InvalidOperationException or ArgumentException)
{
StatusText.Text = "The link could not be opened. Check your default browser.";
App.Log.Warning(FormattableString.Invariant($"A Help link could not be opened ({exception.GetType().Name}, 0x{exception.HResult:X8})."));
}
}
}
+1 -5
View File
@@ -25,11 +25,7 @@
<MenuFlyoutSeparator />
<ToggleMenuFlyoutItem x:Name="SplashToggle" Text="Show splash at startup" Click="Splash_Click" />
</MenuBarItem>
<MenuBarItem Title="Help" AccessKey="H">
<MenuFlyoutItem Text="View on GitHub" AccessKey="G" AutomationProperties.AutomationId="MenuGitHub" Click="GitHub_Click" />
<MenuFlyoutItem Text="Submit an issue…" AccessKey="I" AutomationProperties.AutomationId="MenuSubmitIssue" ToolTipService.ToolTip="Report a bug or request a feature on GitHub" Click="SubmitIssue_Click" />
<MenuFlyoutItem Text="Community support…" AccessKey="S" AutomationProperties.AutomationId="MenuCommunitySupport" ToolTipService.ToolTip="Ask a question or share tips in GitHub Discussions" Click="CommunitySupport_Click" />
<MenuFlyoutSeparator />
<MenuBarItem Title="Help">
<MenuFlyoutItem x:Name="CheckForUpdatesMenuItem" Text="Check for updates" Click="CheckForUpdates_Click" />
<MenuFlyoutItem x:Name="ActivityLogMenuItem" Text="Activity log" Click="ActivityLog_Click" />
<MenuFlyoutSeparator />
@@ -1,43 +0,0 @@
/*
* Copyright (c) 2026 James Maes (KofTwentyTwo)
* SPDX-License-Identifier: MIT
*/
using System.Diagnostics;
using System.Windows;
namespace AppKit.Sample.Wpf;
/// <summary>Opens the sample's fixed public Help destinations using the Windows default browser.</summary>
public partial class MainWindow
{
/// <summary>Shows the sample's source repository.</summary>
private void GitHub_Click(object sender, RoutedEventArgs args) => OpenHelpPage(SampleApp.Info.RepositoryUrl!);
/// <summary>Offers the repository's bug/feature templates.</summary>
private void SubmitIssue_Click(object sender, RoutedEventArgs args) => OpenHelpPage(SampleApp.IssuesUrl);
/// <summary>Opens the sample's community support destination.</summary>
private void CommunitySupport_Click(object sender, RoutedEventArgs args) => OpenHelpPage(SampleApp.SupportUrl);
/// <summary>Surfaces OS/browser launch failure without passing private app data to the shell.</summary>
private void OpenHelpPage(Uri target)
{
try
{
using var process = Process.Start(new ProcessStartInfo(target.AbsoluteUri) { UseShellExecute = true });
}
catch(Exception exception) when(exception is System.ComponentModel.Win32Exception or InvalidOperationException)
{
StatusText.Text = "The link could not be opened. Check your default browser.";
Program.Log.Warning(FormattableString.Invariant($"A Help link could not be opened ({exception.GetType().Name}, 0x{exception.HResult:X8})."));
}
}
}
@@ -25,10 +25,6 @@
<MenuItem x:Name="SplashToggle" Header="Show splash at startup" IsCheckable="True" Click="Splash_Click" />
</MenuItem>
<MenuItem Header="_Help">
<MenuItem Header="View on _GitHub" AutomationProperties.AutomationId="MenuGitHub" Click="GitHub_Click" />
<MenuItem Header="Submit an _issue…" AutomationProperties.AutomationId="MenuSubmitIssue" ToolTip="Report a bug or request a feature on GitHub" Click="SubmitIssue_Click" />
<MenuItem Header="Community _support…" AutomationProperties.AutomationId="MenuCommunitySupport" ToolTip="Ask a question or share tips in GitHub Discussions" Click="CommunitySupport_Click" />
<Separator />
<MenuItem x:Name="CheckForUpdatesMenuItem" Header="Check for _updates" Click="CheckForUpdates_Click" />
<MenuItem x:Name="ActivityLogMenuItem" Header="Activity _log" Click="ActivityLog_Click" />
<Separator />
-12
View File
@@ -36,17 +36,5 @@ internal static class SampleApp
public static AppPaths Paths { get; } = new(Info);
/// <summary>The app's bug/feature templates, independent of any upstream project credited in About.</summary>
public static Uri IssuesUrl { get; } = new(Info.RepositoryUrl!.AbsoluteUri.TrimEnd('/') + "/issues/new/choose");
/// <summary>Community questions and tips in the app's own repository.</summary>
public static Uri SupportUrl { get; } = new(Info.RepositoryUrl!.AbsoluteUri.TrimEnd('/') + "/discussions");
public static SettingsStore<SampleSettings> SettingsStore { get; } = new(Paths.SettingsFile, SampleSettingsContext.Default.SampleSettings);
}
@@ -152,12 +152,7 @@ public sealed class AppSession : IDisposable
/// expand (its flyout opens before the menu is ready), so the menu is re-opened
/// until the item appears.
/// </summary>
public void InvokeMenuItem(string menuName, string itemAutomationId) => Invoke(OpenMenuItem(menuName, itemAutomationId));
/// <summary>Opens an owned native menu and returns its item without launching an external destination.</summary>
public AutomationElement OpenMenuItem(string menuName, string itemAutomationId)
public void InvokeMenuItem(string menuName, string itemAutomationId)
{
AutomationElement menu = WaitFor(
() => MainWindow.FindFirstDescendant(cf => cf.ByControlType(ControlType.MenuItem).And(cf.ByName(menuName))),
@@ -176,7 +171,7 @@ public sealed class AppSession : IDisposable
Wait.UntilInputIsProcessed();
item = Retry.WhileNull(() => FindInApp(cf => cf.ByAutomationId(itemAutomationId)), timeout: TimeSpan.FromSeconds(3), interval: s_pollInterval, ignoreException: true).Result;
}
return item ?? throw new TimeoutException($"Menu item '{itemAutomationId}' never appeared under '{menuName}'. (app exited: {App.HasExited})");
Invoke(item ?? throw new TimeoutException($"Menu item '{itemAutomationId}' never appeared under '{menuName}'. (app exited: {App.HasExited})"));
}
@@ -28,25 +28,6 @@ public class SampleAppTests
/// <summary>The real Help menu exposes the app's repository, issue reporting and community commands without launching a browser.</summary>
[Theory]
[InlineData(SampleKind.WinUI)]
[InlineData(SampleKind.Wpf)]
public void Help_PublicDestinations_AreAvailableInTheNativeMenu(SampleKind kind)
{
using var session = new AppSession(kind);
_ = session.OpenMenuItem("Help", "MenuGitHub");
foreach((string identity, string label) in new[] { ("MenuGitHub", "GitHub"), ("MenuSubmitIssue", "issue"), ("MenuCommunitySupport", "support") })
{
AutomationElement item = session.WaitForElement(identity);
Assert.True(item.IsEnabled);
Assert.False(item.IsOffscreen);
Assert.Contains(label, item.Name, StringComparison.OrdinalIgnoreCase);
}
}
/// <summary>About: shows the build version.</summary>
[Theory]
[InlineData(SampleKind.WinUI)]