The GitHub account is gone, and with it the update feed and every link the app opened. Velopack now reads https://releases.poli0981.dev/commandforge (an HTTP source, ProductLinks.UpdateFeed); 404 / 403 / 429 / 5xx / offline are still told apart, and their messages name "the update server" instead of GitHub (Cloudflare's edge answers 403 when it refuses and 429 when it limits). ProductLinks: the source, user guide, accessibility statement and the four legal texts on Gitea (the Legal pages read them from ProductLinks instead of four hard-coded GitHub URLs); issues on the GitLab mirror, since Gitea's registration is closed. Report a bug opens a new GitLab issue with the title and the answered Bug template (.gitlab/issue_templates/Bug.md) as its description; a test keeps the app's sections and checklist equal to the template's. Strings in all five languages: "Source code" (was "GitHub"), "Read the full text online", "Open issue on GitLab", and the privacy and auto-check texts name releases.poli0981.dev. Keys Settings_GitHub and LegalGateReadOnGitHub become Settings_SourceCode and LegalGateReadFullText. A new test fails if any source file links to github.com/poli0981 again. The terms version stays 1.1: the update check sends the same request, only to another host. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
66 lines
2.7 KiB
C#
66 lines
2.7 KiB
C#
using CommandForge.Application;
|
|
|
|
namespace CommandForge.Tests;
|
|
|
|
/// <summary>
|
|
/// The project left GitHub (the account is gone): the source is on Gitea, issues on the GitLab
|
|
/// mirror, the update feed on Cloudflare R2. Nothing the app opens or contacts may point back.
|
|
/// </summary>
|
|
public sealed class ProductLinksTests
|
|
{
|
|
private static readonly string Root = FindRepositoryRoot();
|
|
|
|
[Fact]
|
|
public void TheUpdateFeedIsTheR2FolderOverHttps()
|
|
=> Assert.Equal("https://releases.poli0981.dev/commandforge", ProductLinks.UpdateFeed);
|
|
|
|
[Theory]
|
|
[InlineData(ProductLinks.Repository)]
|
|
[InlineData(ProductLinks.Releases)]
|
|
[InlineData(ProductLinks.UserGuide)]
|
|
[InlineData(ProductLinks.AccessibilityStatement)]
|
|
[InlineData(ProductLinks.Eula)]
|
|
[InlineData(ProductLinks.LicenseFile)]
|
|
[InlineData(ProductLinks.Disclaimer)]
|
|
[InlineData(ProductLinks.Privacy)]
|
|
public void SourceLinksPointAtGitea(string link)
|
|
=> Assert.StartsWith("https://git.poli0981.dev/poli0981/CommandForge", link, StringComparison.Ordinal);
|
|
|
|
[Fact]
|
|
public void IssuesGoToTheGitLabMirror()
|
|
=> Assert.StartsWith("https://gitlab.com/poli0981/CommandForge/-/issues", ProductLinks.NewIssue, StringComparison.Ordinal);
|
|
|
|
[Fact]
|
|
public void NoSourceFileLinksToTheOldGitHubRepository()
|
|
{
|
|
var offenders = new[] { "src", "helper" }
|
|
.SelectMany(folder => Directory.EnumerateFiles(Path.Combine(Root, folder), "*", SearchOption.AllDirectories))
|
|
.Where(path => !IsBuildOutput(path) && Path.GetExtension(path) is ".cs" or ".xaml" or ".resx" or ".json" or ".csproj" or ".manifest")
|
|
.Where(path => File.ReadAllText(path).Contains("github.com/poli0981", StringComparison.OrdinalIgnoreCase))
|
|
.Select(path => Path.GetRelativePath(Root, path))
|
|
.ToList();
|
|
|
|
Assert.True(offenders.Count == 0, "Still linking to GitHub: " + string.Join(", ", offenders));
|
|
}
|
|
|
|
private static bool IsBuildOutput(string path)
|
|
{
|
|
var separator = Path.DirectorySeparatorChar;
|
|
return path.Contains($"{separator}bin{separator}", StringComparison.OrdinalIgnoreCase)
|
|
|| path.Contains($"{separator}obj{separator}", StringComparison.OrdinalIgnoreCase);
|
|
}
|
|
|
|
private static string FindRepositoryRoot()
|
|
{
|
|
for (var directory = new DirectoryInfo(AppContext.BaseDirectory); directory is not null; directory = directory.Parent)
|
|
{
|
|
if (File.Exists(Path.Combine(directory.FullName, "CommandForge.slnx")))
|
|
{
|
|
return directory.FullName;
|
|
}
|
|
}
|
|
|
|
throw new InvalidOperationException("Could not find the repository root (CommandForge.slnx) above " + AppContext.BaseDirectory);
|
|
}
|
|
}
|