From d0c1d411d3e9d80734016dc574df2f2290995fdb Mon Sep 17 00:00:00 2001 From: poli0981 Date: Fri, 27 Nov 2026 13:56:21 +0700 Subject: [PATCH] docs(migration): MarkLens is done, and what it found The first Flutter repo: Gitea #2 and #3 fast-forwarded, v1.1.0 released to R2 with the latest.json update feed (D8), branch protection on main, maintenance mode. What the move found, for the next repos: - No Flutter setup action fits host mode (subosito's bash steps can hit WSL): a pinned, checksummed SDK install into the runner tool cache. - docker run -v $PWD inside a Docker job mounts a host path, so the Linux floor is the ubuntu-22.04 label again. - Renovate proposes ubuntu v26 for Dockerfile bases and newer runs-on labels; a repo that pins an Ubuntu label on purpose needs a rule (candidate for the preset). - gitleaks reads a Sonar project key as an API key; apt in the runner's Docker network can lose a DNS lookup; the artifact service can time out on CreateArtifact (re-run failed jobs). The tracker row, the status row and the 15:23 Fri cron slot are live; the runbook notes pub.dev in the release-age rule. Co-Authored-By: Claude Opus 5.5 --- docs/GITEA-MIGRATION.md | 4 +-- docs/migration/README.md | 4 +-- docs/migration/marklens.md | 55 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 4 deletions(-) diff --git a/docs/GITEA-MIGRATION.md b/docs/GITEA-MIGRATION.md index 6244aa7..02cc11b 100644 --- a/docs/GITEA-MIGRATION.md +++ b/docs/GITEA-MIGRATION.md @@ -317,7 +317,7 @@ Runner workflow `.gitea/workflows/renovate.yml` in the same repo: runs self-host **github.com without a token** (nothing GitHub-specific, §3.6). With no github.com token, Renovate skips every `github-tags` / `github-releases` dependency as `github-token-required`, every action pin included. The fix has two parts, and needs both: `RENOVATE_GITHUB_TOKEN_WARN=false` lets those dependencies reach the lookup, and the preset's package rule sends it to `git-tags` (`git ls-remote`, with annotated tags resolved to their commit). The switch alone fails, because `github-tags` asks GitHub's GraphQL API, which refuses unauthenticated calls (403). Measured 2026-11-23 on ticktune's 7 workflows under `.gitea/workflows`: 38 of 38 action pins resolved, no call to `api.github.com`. Still not covered: a `github-releases` dependency fails, visibly on the Dependency Dashboard, and PRs get no release notes from GitHub. Actions pinned to a branch (`@ # main`) go through `github-digest`, which needs the API too; the second rule reads the branch head over git (`git-refs`). -**Vulnerabilities.** OSV alerts open their own PRs, labelled `dependencies` + `security`, without the 3-day release age that holds every other npm, NuGet, crates.io and PyPI update; the Dependency Dashboard lists the open advisories. +**Vulnerabilities.** OSV alerts open their own PRs, labelled `dependencies` + `security`, without the 3-day release age that holds every other npm, NuGet, crates.io, PyPI and pub.dev update (pub.dev joined on 2026-11-27, renovate-config #7, for MarkLens: the block above is the file as first shipped); the Dependency Dashboard lists the open advisories. **Which repos.** Gitea autodiscovery lists the repos the bot owns or collaborates on, and Renovate keeps the ones it can push to. So add `renovate-bot` as a **Write** collaborator on each repo (`poli0981` is a user, not an org: there are no teams). Create the labels `dependencies` and `security` in each repo: Renovate drops a missing label silently. `maintainer/gitea-repo-setup.ps1` (ops repo) does both steps for every repo; run it with `-DryRun` first. Onboarding stays on. A repo the bot can see without a `renovate.json` gets a "Configure Renovate" PR that proposes `local>poli0981/renovate-config`, because Renovate finds the preset by this repo's name. @@ -480,7 +480,7 @@ None (2026-11-23). A new question goes into [`migration/README.md`](migration/RE | 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 | ☑ merged 2026-11-27 (Gitea #2) | ☑ (two Discord webhooks missing, see its guide) | ☑ | ☑ | ☑ v2.3.0 on R2, site deployed by the CI `deploy` job | ☑ | `19 13 * * 5` (security) | -| MarkLens | flutter | ☐ | ☐ | ☐ | ☐ | ☐ | ☐ | proposed | +| MarkLens | flutter | ☑ merged 2026-11-27 (Gitea #2, #3) | ☑ | ☑ | ☑ | ☑ v1.1.0 on R2 with the `latest.json` feed, Gitea release by CI | ☑ | `23 15 * * 5` (security) | | captureimg | dotnet | ☐ | ☐ | ☐ | ☐ | ☐ | ☐ | proposed | | QuoteAtlas | web + tauri | not on Gitea yet | ☐ | ☐ | ☐ | ☐ | ☐ | proposed | | AppLedger | dotnet | not on Gitea yet | ☐ | ☐ | ☐ | ☐ | ☐ | proposed | diff --git a/docs/migration/README.md b/docs/migration/README.md index 2d04e1e..0ba774b 100644 --- a/docs/migration/README.md +++ b/docs/migration/README.md @@ -40,7 +40,7 @@ For a repo without a guide, the same prompt works with only the runbook: §3.1 s | `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 | **Done.** Merged 2026-11-27 (Gitea #2); v2.3.0 released to R2, the site deployed by the CI `deploy` job | [jsonprism.md](jsonprism.md) | -| `MarkLens` (`E:\marklens`) | Flutter desktop (Windows, Linux) | not started | [marklens.md](marklens.md) | +| `MarkLens` (`E:\marklens`) | Flutter desktop (Windows, Linux) | **Done.** Merged 2026-11-27 (Gitea #2, #3); v1.1.0 released to R2 with the `latest.json` update feed, the first Flutter repo; maintenance mode | [marklens.md](marklens.md) | | `captureimg` (`E:\capture\captureimg`) | .NET/WPF, Velopack | not started | [captureimg.md](captureimg.md) | | `QuoteAtlas` (`E:\qoute`) | web + Tauri + Android | **not on Gitea yet** (origin is still GitHub) | [quoteatlas.md](quoteatlas.md) | | `AppLedger` (`E:\appledger`) | .NET/WPF, Velopack, never released | **not on Gitea yet** (origin is still GitHub) | [appledger.md](appledger.md) | @@ -91,7 +91,7 @@ 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:23 | Fri | MarkLens · security | proposed | +| 15:23 | Fri | MarkLens · security (workflow lint + ops caller in one workflow) | live | | 15:29 | Wed | ticktune · security | live | | 15:33 | Sun | QuoteAtlas · security | proposed | | 15:37 | Tue | softharbor · security | live | diff --git a/docs/migration/marklens.md b/docs/migration/marklens.md index 8558af8..7304f63 100644 --- a/docs/migration/marklens.md +++ b/docs/migration/marklens.md @@ -2,6 +2,61 @@ > Written 2026-11-23 against `main` @ `2d33b1c` (local clone `E:\marklens`, Gitea `poli0981/MarkLens`). Profile: Flutter desktop app (Windows installer via Inno Setup, Linux package), with an in-app update check. Docs 11 and 14 describe packaging and CI. Shared decisions: [README](README.md). +**Done 2026-11-27**, the first Flutter repo. The migration merged as Gitea #2 (9 commits) and #3 stacked on it (the +remote-badge fix, Flutter 3.50.1, maintenance mode and the release commit), both by fast-forward in the UI (every +commit stays signed); tagged and released as **v1.1.0**: the four artefacts and `SHA256SUMS` under +`releases.poli0981.dev/marklens/1.1.0/`, the update feed `marklens/latest.json` uploaded last, a Gitea release with the +notes and links, published (not a draft). Renovate's onboarding PR #1 was closed: #2 adds `renovate.json`. #4 ticked +the release checklist. What the move found: + +- **Flutter has no setup action that fits host mode.** `subosito/flutter-action`'s steps are `shell: bash`, which on + the host-mode Windows runner can resolve to WSL's `bash.exe`. `tool/ci/install-flutter.{sh,ps1}` download the + pinned archive from `storage.googleapis.com`, check a SHA-256 pinned in `tool/ci/flutter.env` (copied from Google's + `releases_.json`, not fetched beside the archive), and unpack it into `$RUNNER_TOOL_CACHE` (else + `%LOCALAPPDATA%\gitea-runner\toolcache`): once per version, never system-wide on the PC. A release passes + `--fresh`/`-Fresh` (job temp dir, no shared cache). The PC has `LongPathsEnabled=1`, which the SDK needs (its + deepest relative path is ~186 characters). Flutter runs as root in the Docker jobs with only a warning. +- **The Linux floor is a runner label again.** The GitHub release built the `.deb` and AppImage with `docker run -v + "$PWD:/src"` inside the job; from inside the runner's own container that mounts a host path, not the checkout. + `runs-on: ubuntu-22.04` *is* the build machine here (the runner's image), so the job installs + `tool/linux/Dockerfile`'s packages there and a repo test holds the label and the Dockerfile's `FROM` together. The + goldens, made in an `ubuntu:24.04` container, match byte for byte on the runner's `ubuntu-24.04` image. +- **Renovate would have moved the floor.** The onboarding PR listed "update dependency ubuntu to v26" (the + Dockerfiles' base images), and the `github-runners` datasource proposes newer `runs-on` labels. MarkLens's + `renovate.json` disables both for Ubuntu: 22.04 is its glibc floor, 24.04 its goldens' image. **Any repo that pins + an Ubuntu label on purpose (youtube-generator's `ubuntu-22.04` floor) wants the same rule**; a candidate for the + preset. Also local: `constraints.flutter` (the SDK Renovate's lockfile updates install), and holds on + `desktop_drop` < 0.9 (a `cross_file` wall) and `window_manager` < 0.6 (a nativeapi rewrite, held by decision). + **pub joined the preset's 3-day release-age rule** (renovate-config #7): pub.dev reports `published`. +- **The update feed (D8).** `tool/release/release_files.py` writes `latest.json` — `{app, version, tag, published, + page, files[{name, url, sha256, size}], sha256sums}` — and the release notes from CHANGELOG. The app reads + `version` and `page`, and opens `page` only on `git.poli0981.dev` / `releases.poli0981.dev` (the GitHub version + opened any `html_url`). The Gitea release is published, not a draft: the banner links to it, and a draft is a 404 + for everyone else. So the tag is the release decision, and the person's checks moved before it (doc 15). + `latest.json` answers with `cf-cache-status: DYNAMIC`. +- **First CI run, two reds, neither in the code.** gitleaks (full history) flagged `sonar.projectKey=…` in the + deleted `sonar-project.properties` as `generic-api-key`; `.gitleaksignore` records that fingerprint, as softharbor's + does. The golden job died in `apt-get` on one failed DNS lookup of `archive.ubuntu.com` from the runner's Docker + network; every `apt-get` now runs with `-o Acquire::Retries=5`. osv-scanner reads `pubspec.lock` (green). +- **The tag run lost its Windows artifact** to `Failed to CreateArtifact … Request timeout` (all 5 attempts) after a + good build; nothing had been published, and "Re-run failed jobs" finished the chain with the Linux artifact kept. +- **Timings on the single runner**: a PR round ~25 min once it starts (`CI` + `Security`); the release rehearsal's + build jobs 6 min (Windows, host) and 4.7 min (Linux), assemble 30 s. A PR stacked on another was the cheaper + path: the lower PR's runs were cancelled and the upper one's CI covered both before both fast-forwarded. +- **Enabling Actions on 28.4.0** is Settings → Actions → General → "Enable Repository Actions" (not in the Advanced + settings list; `/settings/actions` 404s until it is on). +- **Branch protection on `main`** (D6): no push, no force push, administrators included; required checks + `CI / ci-ok (*)`, `Security / workflow-lint (*)`, `Reusable / Security / Secrets (gitleaks) (*)`, + `Reusable / Security / Dependencies (osv-scanner) (*)`. Default merge style: fast-forward only. +- **Installs of 1.0.0–1.0.2** ask `api.github.com/repos/poli0981/MarkLens/releases/latest`, now 404, silently by + design: README, SECURITY.md, the CHANGELOG and the release notes tell them to install 1.1.0 once by hand. +- **WinGet is paused**: winget-pkgs PRs come from a GitHub fork, and the pending 1.0.1 submission (#439835) points at + dead GitHub downloads. `tool/winget/` is unchanged. +- **Contacts**: CLAUDE.md said to leave `{{CONTACT_EMAIL}}` for the maintainer; this guide decided + `security@`/`code@poli0981.dev`, and the runbook wins for migration topics. Reported in #2; CLAUDE.md updated. +- **Not done**: no Discord announcement (MarkLens has no Discord webhooks; three secrets and one + `announce-release.yml` caller would add it); the listings (SoftHarbor, poli0981.dev) still link GitHub. + ## Decided (2026-11-23) - **D8 — the update check:** a `latest.json` (version + download URLs) at `releases.poli0981.dev/marklens/latest.json`, uploaded last by each release (a `*.json` name, so the cache is bypassed); `update_service.dart` reads it. Not the Gitea API: the app stays off the forge, like every other app. `legal/PRIVACY.md` names the new host: it is a privacy statement, not just a doc. -- 2.54.1