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

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:
Alby96andClaude Opus 5.5 authored and Alby96 committed 2026-10-23 12:45:18 +02:00
1 parent c99842cc86
commit f2b58522b9
1801 files changed
+11804 -10676

No files matched your search

+113
View File
@@ -0,0 +1,113 @@
using Chronos.App.Library;
using Chronos.App.Settings;
using Chronos.Core.Archiving;
using Chronos.Core.Localization;
using Chronos.Core.Model;
using Chronos.Core.Naming;
using Chronos.Data.Repositories;
namespace Chronos.App.Archiving;
/// <summary>What a mass rename changes: the sequence titles (Rename) or the folder layout (Move).</summary>
public enum RenameMode
{
Titles,
Folders,
}
/// <summary>One line of the rename dry run: before → after.</summary>
public sealed record RenameRow(Guid SequenceId, string From, string To);
/// <summary>
/// Mass rename and move of sequences (BRIEF §7, §12.5): the template is checked live, the engine's dry run
/// (<see cref="RenamePlan"/>) is listed line by line, and applying makes exactly those changes.
/// </summary>
public static class MassRename
{
/// <summary>The first problem of a template, localized; null when it can be used.</summary>
public static string? Validate(RenameMode mode, string? template)
{
if (string.IsNullOrWhiteSpace(template)) return Loc.L("Errors.Template.Empty", string.Empty, 1);
if (mode == RenameMode.Folders) return NamingPreview.Validate(template, isFolder: true);
var parsed = PathTemplate.Parse(template);
return parsed.Errors is [var error, ..] ? Loc.L("Errors.Template." + error.Code, error.Token ?? string.Empty, error.Position + 1) : null;
}
/// <summary>The changes of a plan as rows: titles or folders, whichever the mode changes.</summary>
public static IReadOnlyList<RenameRow> Rows(RenamePlan plan, RenameMode mode) =>
[
.. plan.Steps.Select(s => mode == RenameMode.Folders
? new RenameRow(s.SequenceId, s.FromFolder, s.ToFolder)
: new RenameRow(s.SequenceId, s.FromTitle ?? string.Empty, s.ToTitle ?? string.Empty)),
];
/// <summary>"12 of 36 sequences change"; sequences that only move with a folder they are in are listed, not counted.</summary>
public static string Summary(RenamePlan plan, int setSize) => Loc.Plural("Archive.Rename.Summary", plan.Steps.Count(s => !s.Carried), setSize);
}
/// <summary>Adding and removing tags on a set of sequences (BRIEF §12.5 Retag).</summary>
public static class Retag
{
/// <summary>"sunset, harbour; Holy grail" → normalized, distinct tags; entries that cannot be tags are left out.</summary>
public static IReadOnlyList<string> Parse(string? text)
{
var seen = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
return [.. Split(text).Where(IsValid).Select(TagRepository.Normalize).Where(seen.Add)];
}
/// <summary>The problem of a tag list as one sentence; null when every entry can be a tag.</summary>
public static string? Validate(string? text) => Split(text).All(IsValid) ? null : Loc.L("Archive.Retag.Invalid", TagRepository.MaxLength);
private static IEnumerable<string> Split(string? text) =>
string.IsNullOrWhiteSpace(text) ? [] : text.Split([',', ';'], StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
private static bool IsValid(string tag) => tag.Length is > 0 and <= TagRepository.MaxLength && !tag.Any(char.IsControl);
/// <summary>The new tag list of one sequence: removals first, then additions not already present.</summary>
public static IReadOnlyList<string> Apply(IReadOnlyList<string> current, IReadOnlyList<string> add, IReadOnlyList<string> remove)
{
var removed = new HashSet<string>(remove, StringComparer.OrdinalIgnoreCase);
var result = current.Where(t => !removed.Contains(t)).ToList();
var present = new HashSet<string>(result, StringComparer.OrdinalIgnoreCase);
result.AddRange(add.Where(present.Add));
return result;
}
/// <summary>Only the sequences whose tags change, with their new tags (the dry run).</summary>
public static IReadOnlyList<(Sequence Sequence, IReadOnlyList<string> Tags)> Changes(IEnumerable<Sequence> sequences, IReadOnlyList<string> add,
IReadOnlyList<string> remove) =>
[
.. sequences.Select(s => (Sequence: s, Tags: Apply(s.Tags, add, remove)))
.Where(c => !c.Tags.SequenceEqual(c.Sequence.Tags, StringComparer.Ordinal)),
];
}
/// <summary>
/// Narrows the mass-operation set on top of the tree selection (Archive.html "Filtered set ▾"): camera, status and tag;
/// years and single sequences are chosen in the tree.
/// </summary>
public sealed record ArchiveSetFilter(string? Camera = null, StatusFilter Status = StatusFilter.Any, string? Tag = null)
{
public bool IsEmpty => Camera is null && Status == StatusFilter.Any && Tag is null;
public bool Matches(Sequence sequence)
{
if (Camera is not null && CameraOf(sequence) != Camera) return false;
if (Tag is not null && !sequence.Tags.Contains(Tag, StringComparer.OrdinalIgnoreCase)) return false;
return LibraryFilter.MatchesStatus(sequence, Status);
}
/// <summary>"Canon EOS R5 · Not analysed · sunset"; empty without a filter.</summary>
public string Describe() => string.Join(Loc.Separator, new[]
{
Camera ?? string.Empty,
Status == StatusFilter.Any ? string.Empty : StatusLabel(Status),
Tag ?? string.Empty,
}.Where(t => t.Length > 0));
/// <summary>The camera a sequence is filed under, as the camera chart names it.</summary>
public static string CameraOf(Sequence sequence) =>
PathTemplate.CameraName(sequence.CameraMake, sequence.CameraModel) is { Length: > 0 } name ? name : Loc.L("Archive.Chart.UnknownCamera");
public static string StatusLabel(StatusFilter status) => Loc.L(status == StatusFilter.Any ? "Library.Filter.AnyStatus" : "Library.Filter.Status." + status);
}