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 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)