Files
.github/docs/migration/hashtool.md
poli0981andClaude Opus 5.5 497fb914a1
Ops lint / actionlint + Python (pull_request) Successful in 6s
docs: ops v2026.11.5 is out, HashTool and CommandForge pin it
The runbook's tagging note named v2026.11.1 as the tag before the notifier
fix; it now names the latest tag, v2026.11.5 (signed, b93b371): the release
notifier knows the Velopack apps released from Gitea and the security scan
restores .NET without ICU. The HashTool and CommandForge guides record their
pin bumps (HashTool #3, CommandForge #4); HashTool's NuGetAudit job runs on
ubuntu-latest again, which checked the ICU fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 13:46:32 +07:00

9.4 KiB

HashTool — migration guide

Written 2026-11-23 against main @ 8af82be (local clone E:\hash, Gitea poli0981/HashTool). Profile: Avalonia 12 / .NET 10 app (CheckHash) + NativeAOT CLI (hashtool), Velopack on Windows, macOS and Linux (runbook §5.1). Maintenance mode since 1.3.0. Shared decisions: README.

Done 2026-11-26. The migration merged as Gitea #2 (fast-forward to c26a857, 17 commits, with the release commit and the fixes the first runs asked for), and 1.3.1 was released to releases.poli0981.dev/hashtool/ by the dispatched Release workflow. Renovate's onboarding PR #1 was closed (#2 adds renovate.json). What the move found:

  • The runner's Ubuntu images have no ICU. Every .NET process died at start-up ("Couldn't find a valid ICU package"). Jobs that run the tests or the app install libicu-dev; jobs that only restore, build or run tools set DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1. The ops security.yml NuGetAudit job had the same problem on its default ubuntu-latest; fixed in ops v2026.11.5, which HashTool pins since #3 (its NuGetAudit job runs on the default ubuntu-latest again).
  • Avalonia 12.2's XAML compiler names generated types and methods with U+0001. Microsoft.CodeCoverage's Cobertura writer cannot put that into XML: all tests passed, then the test host crashed (exit -532462766). A plain dotnet test does not show it; CI's --coverage does. eng/coverage.config limits coverage to HashTool.Core, the only module the gate measures.
  • Host-mode PowerShell cannot load Microsoft.PowerShell.Archive, so Compress-Archive fails; [IO.Compression.ZipFile]::CreateFromDirectory works. CheckHash.exe is a GUI-subsystem program: PowerShell waits for it only through Start-Process -Wait. shell: bash is avoided on the host (System32\bash.exe is WSL) and so is python3 (only python exists).
  • Qodana through the ops reusable (CLI, newer qodana-dotnet) rates HashAlgorithmName.MD5 critical (CsharpUsingCryptographyHashAlgorithmNameMD5) and failed the gate; HashTool offers MD5 as a checksum, so the inspection is ignored for HashFunction.cs. Qodana Cloud only accepts VCS URLs on github.com, gitlab.com and bitbucket.org: the HASH project points at the GitLab mirror (https://gitlab.com/poli0981/HashTool.git), not Gitea.
  • Release path. Releases stay dispatch-based (version, publish; tags without v), so the ops publish-r2.yml (tag refs only) does not apply: the publish job uploads hashtool/<version>/ (CLI archives, CycloneDX SBOMs, SHA256SUMS) with rclone pinned and checked like publish-r2.yml, then vpk upload s3 publishes linux from Docker and win from the host. The Gitea release job creates the tag (target_commitish). vpk 1.2.161 names the Linux build HashTool.AppImage and also writes RELEASES-linux. The upgrade gate is off (HT2: the 1.1.3 portables were GitHub assets and are not on R2); tests/Compat/LegacyClient stays for a possible bridge release.
  • A transient DNS failure on the PC (builds.dotnet.microsoft.com not found during setup-dotnet) failed one job; a re-run passed. A full PR round (CI, Security, Qodana, Release dry run) took ~30 min on the single runner.
  • Branch protection on main (D6): no push, no force push, administrators included; required checks CI / ci-ok (*), Security / vulnerable-packages (*), Security / licenses (*), Security / workflow-lint (*), Reusable / Security / Secrets (gitleaks) (*), Reusable / Security / Dependencies (osv-scanner) (*), Reusable / Security / .NET (NuGetAudit) (*).
  • The notifier notify-release-pipeline.yml reports a dispatched run with the branch (main) as its tag: Gitea's workflow_run payload carries no dispatch inputs.

The repo's CLAUDE.md and docs/RELEASING.md bind the session: Velopack invariants (pack id HashTool, channels win/osx/osx-x64/linux, exe CheckHash, tags without v), workflow rules (SHA pins, persist-credentials: false, per-job permissions, no ${{ }} inside run:), ci-ok as the single required check, and never run a built Setup.exe/.pkg on the maintainer's machine. On Gitea, windows-latest is the maintainer's machine (host mode), so that last rule now applies to CI too.

Decided (2026-11-23)

  • HT1 — macOS (D9): CI and releases for Windows + Linux only. README and RELEASING.md say macOS builds stopped; macOS installs keep the GitHub feed they have, which cannot be redirected (runbook §7 item 5).
  • HT2 — the upgrade gate's 1.1.3: the gate fetches the 1.1.3 portable zips from R2 (hashtool/1.1.3/HashTool-<channel>-Portable.zip). Before the first release, put them there if you still have them; if you do not, the gate is switched off with a note in RELEASING.md.
  • HT3 — data dir on the host runner: every job that starts the app on windows-latest (ci smoke test, upgrade gate) sets HASHTOOL_DATA_DIR to a folder under the job's temp dir in env:, or it reads and writes your real %LOCALAPPDATA%\HashTool. The upgrade gate only runs the portable build, in the job's temp dir.

Workflows (.github/workflows → .gitea/workflows)

File Today Do
ci.yml build/test on Windows, macOS, Linux; coverage gate; smoke test; format; translations; ci-ok; upstream upload-artifact Move; drop the macOS matrix entries (HT1); Gitea artifact action; HASHTOOL_DATA_DIR for the Windows smoke test (HT3). ci-ok stays the one check for branch protection (D6)
codeql.yml CodeQL actions + csharp + python, cron 17 3 * * 3 Delete → security.yml caller of the ops repo: dotnet: true, python: true (eng/*.py), cron 43 13 * * 1. Update CLAUDE.md's workflow list
dependency-review.yml GitHub dependency review Delete (D7). Licences stay covered by the local security.yml (nuget-license + eng/allowed-licenses.json)
dependency-submission.yml submits the NuGet graph to GitHub's dependency graph Delete (D7): nothing on Gitea reads it; NuGetAudit sees transitive packages
security.yml (local) vulnerable packages, licences, gitleaks-action, actionlint, zizmor; cron 23 4 * * 1 Keep: licences, actionlint and zizmor are this repo's own gates. Point actionlint and zizmor at .gitea/workflows; run zizmor with online-audits: false and advanced-security: false (README, shared rules). Drop the gitleaks-action job: the ops caller above runs gitleaks on the full history. Cron → 19 15 * * 2
qodana.yml qodana-action, qodana-dotnet native, checks permission, cron 37 4 * * 4 Caller of reusable-qodana.yml with dotnet-global-json-file: global.json (linter and mode from qodana.yaml), cron 53 13 * * 4. The annotations and the PR comment go; the report stays an artifact
release.yml dispatch-only (version, publish) + dry run on PRs touching release files; every channel, CLI for every RID; upgrade gate from 1.1.3; attestations; draft → latest GitHub release with all assets See Release path below
announce-release.yml, notify-ci-failure.yml, notify-release-pipeline.yml ops callers at c3e118a (old .github/workflows path) poli0981/.github/.gitea/workflows/<x>.yml@<ops-sha> + ops_ref. Tags have no v; the release notifier still fires because release.yml runs on workflow_dispatch
scorecard.yml OpenSSF Scorecard Delete (D7)
sonarcloud.yml SonarCloud Delete (D1). Remove dotnet-sonarscanner from .config/dotnet-tools.json (keep dotnet-coverage only if ci.yml still uses it) and the SonarCloud section of CLAUDE.md

.github/dependabot.yml → delete; add renovate.json (it reads .config/dotnet-tools.json; vpk and the Velopack package still move together: group them in a packageRules entry if Renovate splits them). .github/CODEOWNERS → .gitea/CODEOWNERS. .github/FUNDING.yml is GitHub-only.

Release path

  • Channels win and linux (HT1) with vpk download s3 → vpk pack → vpk upload s3, VPK_PREFIX=hashtool/, keys as env only (runbook §5.1). Keep eng/assert-release.py and the invariants.
  • CLI archives + SHA256SUMS to R2 under hashtool/<version>/ (publish-r2.yml, or rclone in the same job).
  • src/HashTool.App/Services/UpdateService.cs: GithubSource → HTTP source https://releases.poli0981.dev/hashtool. tests/Compat/LegacyClient keeps GithubSource: it is 1.1.x.
  • Gitea release (notes + links, no binaries) with gitea-release-action; the job announces it itself (a release made by the job token starts no workflow).
  • Attestations go (D7). Release credentials stay in the workflow_dispatch publish path only (rule 10); the PR dry run gets none.

README.md (10), CONTRIBUTING.md (4), .github/ISSUE_TEMPLATE/ (config.yml 3, accessibility.yml, hash_algorithm.yml, translation.yml), ACCESSIBILITY.md (3), Directory.Build.props, SECURITY.md (GitHub advisories → e-mail; the repo documents only accessibility@, so use security@poli0981.dev), the About screen AboutViewModel.cs (2) with DialogTests.cs / MainWindowViewModelTests.cs, docs/RELEASING.md, CLAUDE.md ("Maintainer: poli0981 (GitHub)", workflow list). Any new UI string goes through eng/loc.py set into all 67 resx files.

Secrets

Keep DISCORD_RELEASES_WEBHOOK, DISCORD_REPO_WEBHOOK, DISCORD_CI_WEBHOOK, DISCORD_RELEASE_PIPELINE_WEBHOOK, QODANA_TOKEN. Create (user level): R2 keys + R2_ACCOUNT_ID. Drop SONAR_TOKEN.