From 32c41e9433a5c785d528010b221c515258969202 Mon Sep 17 00:00:00 2001 From: poli0981 Date: Thu, 26 Nov 2026 12:16:17 +0700 Subject: [PATCH 1/2] fix(security): .NET restore on the Docker runner without ICU The dotnet job on ubuntu-latest (the default dotnet-runs-on) crashed before restoring anything: docker.gitea.com/runner-images ship no ICU, and .NET fails fast without it. Seen on HashTool's own Linux jobs on 2026-11-26; HashTool now calls this job with windows-latest, so it was not hit here, but every caller on ubuntu-latest would be. A restore needs no cultures, so it runs with invariant globalization. Takes effect for a caller once it pins the next ops tag. Co-Authored-By: Claude Opus 5.5 --- .gitea/workflows/security.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitea/workflows/security.yml b/.gitea/workflows/security.yml index b7004f4..34b7b2b 100644 --- a/.gitea/workflows/security.yml +++ b/.gitea/workflows/security.yml @@ -320,6 +320,9 @@ jobs: shell: bash env: SOLUTION: ${{ inputs.dotnet-solution }} + # docker.gitea.com/runner-images ship no ICU, and .NET stops at start-up without it ("Couldn't find a + # valid ICU package", seen 2026-11-26 on HashTool). A restore needs no cultures. + DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: '1' run: | set -uo pipefail # shellcheck disable=SC2086 -- 2.54.1 From 1a3f5d92e0d4a7fd63dc1bca8704110caeb21789 Mon Sep 17 00:00:00 2001 From: poli0981 Date: Thu, 26 Nov 2026 12:50:33 +0700 Subject: [PATCH 2/2] docs(migration): HashTool is done, and what it found HashTool merged as Gitea #2 and released 1.3.1 to R2 (win + linux through vpk upload s3, the CLI, SBOMs and SHA256SUMS through rclone under hashtool/1.3.1/, Gitea release and announcement from CI). Its guide records what the move found: the runner's Ubuntu images have no ICU, Avalonia 12.2's U+0001 type names crash the Cobertura writer, host-mode PowerShell cannot load Microsoft.PowerShell.Archive, Qodana's newer linter rates MD5 critical, Qodana Cloud accepts no Gitea VCS URL (the project points at the GitLab mirror), and the branch protection it got. The runbook's known behaviours gain the .NET notes; the tracker, the status table and the cron registry are updated (13:43 Mon and 13:53 Thu live, 15:19 Tue freed). Co-Authored-By: Claude Opus 5.5 --- docs/GITEA-MIGRATION.md | 3 ++- docs/migration/README.md | 7 +++---- docs/migration/hashtool.md | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 5 deletions(-) diff --git a/docs/GITEA-MIGRATION.md b/docs/GITEA-MIGRATION.md index 8e35b01..ef0997e 100644 --- a/docs/GITEA-MIGRATION.md +++ b/docs/GITEA-MIGRATION.md @@ -428,6 +428,7 @@ Qodana CLI scan for any stack; replaces `JetBrains/qodana-action`. - Events caused by the job token start no workflow: Gitea skips the Actions user, as GitHub skips `GITHUB_TOKEN` (scheduled workflows are still refreshed). A release or PR made by CI triggers nothing. `workflow_dispatch` through the API starts a run whoever calls it; the job token needs `actions: write` (source). - **A dispatched run writes no commit status** (measured 2026-11-24 on 28.4.0, poli0981-dev): statuses come from push and pull_request runs only. A bot PR that waits for a dispatched CI run (D5) never meets a required check, and merging is refused with 405 "Not all required status checks successful". Record the result yourself from a later job of the same run: `POST /repos/{owner}/{repo}/statuses/{sha}` `{state, context, target_url}` with the job token (`contents: write`), using a context the protection pattern matches (`CI / build (workflow_dispatch)` for `CI / build (*)`). - Steps and processes (measured 2026-11-24): a process a step starts in the background (`cmd &`) is gone when the next step starts, so start a server and run what needs it in the same step. In the job container `localhost` can resolve to ::1 for a server and to 127.0.0.1 for a client (Node's fetch): bind and call `127.0.0.1` explicitly. An action whose tarball holds paths that differ only in case cannot be unpacked (the runner's action cache sits on the Windows disk), e.g. `treosh/lighthouse-ci-action`; run its CLI with `npx` instead. +- .NET on the runners (measured 2026-11-26, HashTool): the Docker images (`docker.gitea.com/runner-images`) have **no ICU**, and .NET stops at start-up without it. Jobs that need cultures (tests, an app's smoke test) `apt-get install libicu-dev` (the container runs as root); jobs that only restore, build or run tools set `DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1`. On the host-mode Windows runner, `shell: bash` may resolve to `System32\bash.exe` (WSL), there is no `python3`, and PowerShell cannot load `Microsoft.PowerShell.Archive` (`Compress-Archive` fails; use `[IO.Compression.ZipFile]`): write Windows steps in `pwsh`. - The job token reads any public repo of the instance; another private repo only with the owner's cross-repo Actions setting (source). - Run links `/{owner}/{repo}/actions/runs/{id}` take the run ID; old run-number links redirect (source). - Issue templates: Gitea reads `.gitea/ISSUE_TEMPLATE`, `.github/ISSUE_TEMPLATE` and `.github/issue_template` (source). GitLab only reads `.gitlab/issue_templates/*.md` and `.gitlab/merge_request_templates/*.md`. @@ -475,7 +476,7 @@ None (2026-11-23). A new question goes into [`migration/README.md`](migration/RE | softharbor | web | ☑ merged 2026-11-24 (Gitea #1, #2, #3) | ☑ | ☑ | ☑ | ☑ v1.5.0 deployed by the CI `deploy` job, Gitea release published by hand | ☑ | `17 13 * * *`, `59 13 * * *`, `43 14 * * 1`, `37 15 * * 2` | | poli0981-dev | web | ☑ merged 2026-11-24 (Gitea #1, #3) | ☑ | ☑ | ☑ | ☑ v2.4.0 deployed by the CI `deploy` job | ☑ | `13 14 * * 3` (security) | | tilepier | web | ☐ | ☐ | ☐ | ☐ | n/a | ☐ | proposed | -| HashTool | dotnet | ☐ | ☐ | ☐ | ☐ | ☐ | ☐ | proposed | +| HashTool | dotnet | ☑ merged 2026-11-26 (Gitea #2) | ☑ | ☑ | ☑ | ☑ 1.3.1 on R2 (`vpk upload s3` win + linux, rclone for `/`), Gitea release by CI | ☑ | `43 13 * * 1` (security), `53 13 * * 4` (qodana) | | youtube-generator | web + tauri | ☑ merged 2026-11-26 (Gitea #2, #3, #4) | ☑ | ☑ | ☑ | ☑ v1.7.0 on R2, site deployed by the CI `deploy` job | ☑ | `37 13 * * 3` (security), `53 15 * * 1` (rust) | | youtube-auto-post | python | ☐ | ☐ | ☐ | ☐ | n/a | ☐ | proposed | | jsonPrism | web + tauri | ☐ | ☐ | ☐ | ☐ | ☐ | ☐ | proposed | diff --git a/docs/migration/README.md b/docs/migration/README.md index 0a32092..6ae3ebb 100644 --- a/docs/migration/README.md +++ b/docs/migration/README.md @@ -36,7 +36,7 @@ For a repo without a guide, the same prompt works with only the runbook: §3.1 s | `poli0981-dev` | web (Astro, Workers) + admin | **Done.** Merged 2026-11-24 (Gitea #1, #3); v2.4.0 deployed by the CI `deploy` job, admin publishing through Gitea | [poli0981-dev.md](poli0981-dev.md) | | `content` (`E:\content`) | content submodule of `poli0981-dev` | **Done** with it (2026-11-24) | [poli0981-dev.md](poli0981-dev.md#the-content-submodule-poli0981content-econtent) | | `tilepier` | web (SvelteKit, Workers) | not started | [tilepier.md](tilepier.md) | -| `HashTool` (`E:\hash`) | Avalonia/.NET 10 + NativeAOT CLI, Velopack win/osx/linux | not started | [hashtool.md](hashtool.md) | +| `HashTool` (`E:\hash`) | Avalonia/.NET 10 + NativeAOT CLI, Velopack win/linux (osx dropped) | **Done.** Merged 2026-11-26 (Gitea #2); 1.3.1 released to R2 | [hashtool.md](hashtool.md) | | `youtube-generator` (`E:\youtube`) | web (Workers) + Tauri + Android | **Done.** Merged 2026-11-26 (Gitea #2, #3, #4); v1.7.0 released to R2, the site deployed by the CI `deploy` job | [youtube-generator.md](youtube-generator.md) | | `youtube-auto-post` | Python bot on a schedule | not started | [youtube-auto-post.md](youtube-auto-post.md) | | `jsonPrism` | web + API (Workers) + Tauri + Android | not started | [jsonprism.md](jsonprism.md) | @@ -65,10 +65,10 @@ Every scheduled workflow gets its own slot inside 13:00–16:00 UTC (runbook §3 | 13:27 | daily | free-games-itchio-list · update (ingest) | live | | 13:31 | daily | renovate-config · renovate | live | | 13:37 | Wed | youtube-generator · security (workflow lint + ops caller in one workflow; its 13:41 Tue slot was not needed) | live | -| 13:43 | Mon | HashTool · security (ops caller) | proposed | +| 13:43 | Mon | HashTool · security (local checks, workflow lint and the ops caller in one workflow; its 15:19 Tue slot was not needed) | live | | 13:47 | daily | pipdock · ci-integration (nightly) | proposed | | 13:49 | daily | free-games-itchio-list · refresh | live | -| 13:53 | Thu | HashTool · qodana | proposed | +| 13:53 | Thu | HashTool · qodana | live | | 13:59 | daily | softharbor · vt-recheck | live | | 14:07 | Sun | .github · weekly-digest | live | | 14:11 | Fri | CommandForge · security (workflow lint + ops caller in one workflow) | live | @@ -91,7 +91,6 @@ Every scheduled workflow gets its own slot inside 13:00–16:00 UTC (runbook §3 | 15:07 | Thu | tilepier · security | proposed | | 15:11 | Sat | captureimg · security | proposed | | 15:13 | Mon | ticktune · qodana | live | -| 15:19 | Tue | HashTool · security (local: licences, actionlint, zizmor) | proposed | | 15:23 | Fri | MarkLens · security | proposed | | 15:29 | Wed | ticktune · security | live | | 15:33 | Sun | QuoteAtlas · security | proposed | diff --git a/docs/migration/hashtool.md b/docs/migration/hashtool.md index 431dee8..377a8df 100644 --- a/docs/migration/hashtool.md +++ b/docs/migration/hashtool.md @@ -2,6 +2,42 @@ > 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](README.md). +**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 this repo, effective from the next ops tag); HashTool calls it with + `dotnet-runs-on: windows-latest`. +- **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//` (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) -- 2.54.1