refactor!: rename Titano to Chronos and move CI and releases to Gitea (#6)
CI / Build and test (push) Successful in 8m14s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 7s
Release / Build, test and publish (push) Successful in 13m19s
CI / PostgreSQL 16 integration (push) Successful in 4m49s
CI / PostgreSQL 17 integration (push) Successful in 5m28s
CI / Docker image (push) Successful in 53s
Release / Server image (push) Failing after 10s
CI / Build and test (push) Successful in 8m14s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 7s
Release / Build, test and publish (push) Successful in 13m19s
CI / PostgreSQL 16 integration (push) Successful in 4m49s
CI / PostgreSQL 17 integration (push) Successful in 5m28s
CI / Docker image (push) Successful in 53s
Release / Server image (push) Failing after 10s
The owner renamed the product and moved the repository to the self-hosted Gitea (https://gitea.encke-hake.ts.net/BalboSoft/Chronos) for more control, and asked for Actions and a first automatic release with the server package and the Windows exe (docs/requests/2026-10-23-chronos-gitea.md). - Chronos everywhere: a byte-exact rename of contents and paths, then a per-language review of the forms the old name's ending had dictated. - Gitea instead of GitHub: the update check, licence, issue and support links read ChronosReleasesUrl; the update check takes the highest stable version, offers a pre-release build its final release and reports a repository it cannot see as a failed check. EULA, security policy and Gitea issue forms live at the repository root. - Gitea Actions for the Linux act_runner (.gitea/workflows): CI, release, nightly image and performance gates in the .NET SDK container with git checkout and the system SQLite. The release cross-compiles the Windows programs, checks their icon, version and DPI manifest, packs installers and zips, publishes the Gitea release and pushes the server image (REGISTRY_TOKEN). Windows-only tests run in an opt-in job on a Windows runner (WINDOWS_RUNNER). - New Chronos.Tools commands: zip, gitea-release, postgres-ci (replaces the docker-exec script, which Gitea's service containers do not allow; the throw-away server runs without durability) and pe-check. - Timed tests take their budget from TestTiming (CHRONOS_TEST_TIME_FACTOR, 3 on the shared runner; the weekly performance gates keep theirs). BREAKING CHANGE: programs, settings, data folders, file types, environment variables and the Docker image use the new name; nothing is migrated from Titano, which never had a release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
This commit was merged in pull request #6.
This commit is contained in:
1 parent
c99842cc86
commit
f2b58522b9
1801 files changed
+11804
-10676
No files matched your search
@@ -0,0 +1,111 @@
|
||||
using System.Globalization;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Uploader.Uploads;
|
||||
|
||||
namespace Chronos.Uploader.Text;
|
||||
|
||||
/// <summary>What the queue is doing, for the end of the queue line.</summary>
|
||||
public enum QueueActivity
|
||||
{
|
||||
Idle,
|
||||
Running,
|
||||
Paused,
|
||||
WaitingForServer,
|
||||
Done,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Culture-aware texts of the uploader: sizes, rates, durations and the queue/progress lines
|
||||
/// ("4,812 files · 96.2 GB · 38 MB/s · 41 min left"). Every method takes the culture so results are deterministic.
|
||||
/// </summary>
|
||||
public static class UploaderText
|
||||
{
|
||||
/// <summary>Localized "{0} KB" formats from bytes to petabytes (BRIEF §16: sizes follow the language, "96,2 Go").</summary>
|
||||
private static readonly string[] SizeFormats = ["Common.Size.B", "Common.Size.KB", "Common.Size.MB", "Common.Size.GB", "Common.Size.TB", "Common.Size.PB"];
|
||||
|
||||
/// <summary>Localized string for <paramref name="key"/> in <paramref name="culture"/>, formatted with <paramref name="args"/>.</summary>
|
||||
public static string L(string key, CultureInfo culture, params object?[] args)
|
||||
{
|
||||
var format = Loc.Get(key, culture) ?? "⟦" + key + "⟧";
|
||||
return args.Length == 0 ? format : string.Format(culture, format, args);
|
||||
}
|
||||
|
||||
/// <summary>Plural-aware lookup of <c>key.one/few/many/other</c>; <c>{0}</c> receives the count.</summary>
|
||||
public static string Plural(string key, long count, CultureInfo culture)
|
||||
{
|
||||
var category = PluralRules.Suffix(PluralRules.Select(culture, count));
|
||||
var format = Loc.Get(key + "." + category, culture) ?? Loc.Get(key + ".other", culture) ?? "⟦" + key + "⟧";
|
||||
return string.Format(culture, format, count);
|
||||
}
|
||||
|
||||
/// <summary>1,536 → "1.5 KB" (decimal units, as Explorer shows for drives).</summary>
|
||||
public static string Bytes(long bytes, CultureInfo culture)
|
||||
{
|
||||
var (value, unit) = Scale(bytes);
|
||||
var format = unit == 0 || value >= 100 ? "0" : "0.#";
|
||||
return L(SizeFormats[unit], culture, value.ToString(format, culture));
|
||||
}
|
||||
|
||||
/// <summary>38,400,000 B/s → "38 MB/s"; one decimal below 10 units.</summary>
|
||||
public static string Rate(double bytesPerSecond, CultureInfo culture)
|
||||
{
|
||||
var (value, unit) = Scale(Math.Max(0, bytesPerSecond));
|
||||
var format = unit == 0 || value >= 10 ? "0" : "0.#";
|
||||
return L("Uploader.Unit.PerSecond", culture, L(SizeFormats[unit], culture, value.ToString(format, culture)));
|
||||
}
|
||||
|
||||
/// <summary>Compact duration: "2 h 05 m", "41 min", "40 s".</summary>
|
||||
public static string Duration(TimeSpan t, CultureInfo culture)
|
||||
{
|
||||
if (t.TotalHours >= 24) return L("Common.Duration.Days", culture, (int)t.TotalDays, t.Hours);
|
||||
if (t.TotalMinutes >= 59.5) return L("Common.Duration.Hours", culture, (int)Math.Round(t.TotalMinutes) / 60, ((int)Math.Round(t.TotalMinutes) % 60).ToString("00", culture));
|
||||
if (t.TotalSeconds >= 59.5) return L("Common.Duration.Minutes", culture, (int)Math.Round(t.TotalMinutes));
|
||||
return L("Common.Duration.Seconds", culture, (int)Math.Round(t.TotalSeconds));
|
||||
}
|
||||
|
||||
/// <summary>"4,812 files · 96.2 GB · 38 MB/s · 41 min left", or the files and size followed by the activity.</summary>
|
||||
public static string QueueLine(QueueSummary summary, QueueActivity activity, double bytesPerSecond, TimeSpan? left, CultureInfo culture)
|
||||
{
|
||||
if (summary.Files == 0) return L("Uploader.Queue.Empty", culture);
|
||||
var parts = new List<string> { Plural("Uploader.Queue.Files", summary.Files, culture), Bytes(summary.Bytes, culture) };
|
||||
switch (activity)
|
||||
{
|
||||
case QueueActivity.Running:
|
||||
if (bytesPerSecond > 0) parts.Add(Rate(bytesPerSecond, culture));
|
||||
if (left is { } l) parts.Add(L("Uploader.Queue.Left", culture, Duration(l, culture)));
|
||||
break;
|
||||
case QueueActivity.Paused:
|
||||
parts.Add(L("Uploader.Queue.Paused", culture));
|
||||
break;
|
||||
case QueueActivity.WaitingForServer:
|
||||
parts.Add(L("Uploader.Queue.Waiting", culture));
|
||||
break;
|
||||
case QueueActivity.Done:
|
||||
parts.Add(L("Uploader.Queue.Done", culture));
|
||||
break;
|
||||
}
|
||||
return string.Join(Loc.SeparatorOf(culture), parts);
|
||||
}
|
||||
|
||||
/// <summary>"2,214 of 4,812 sent · 2,201 verified by the server · 0 retries" (failures have their own link, <see cref="Failed"/>).</summary>
|
||||
public static string ProgressLine(QueueSummary summary, CultureInfo culture) => string.Join(Loc.SeparatorOf(culture),
|
||||
L("Uploader.Progress.Sent", culture, summary.Sent, summary.Files),
|
||||
L("Uploader.Progress.Verified", culture, summary.Verified),
|
||||
Plural("Uploader.Progress.Retries", summary.Retries, culture));
|
||||
|
||||
/// <summary>"3 failed"; null when nothing failed.</summary>
|
||||
public static string? Failed(QueueSummary summary, CultureInfo culture) =>
|
||||
summary.Failed > 0 ? L("Uploader.Progress.Failed", culture, summary.Failed) : null;
|
||||
|
||||
private static (double Value, int Unit) Scale(double bytes)
|
||||
{
|
||||
var value = bytes;
|
||||
var unit = 0;
|
||||
while (value >= 999.95 && unit < SizeFormats.Length - 1)
|
||||
{
|
||||
value /= 1000;
|
||||
unit++;
|
||||
}
|
||||
return (value, unit);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user