Files
poli0981andClaude Opus 5.5 d0c1d411d3
Ops lint / actionlint + Python (pull_request) Successful in 7s
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 <noreply@anthropic.com>
2026-11-27 14:30:04 +07:00

8.5 KiB
Raw Permalink Blame History

MarkLens — migration guide

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.

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_<os>.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.
  • D6: branch protection on main requires the CI checks.

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

File Today Do
ci.yml analyze/test/build on a matrix, Sonar (sonar-project.properties), upstream artifact actions Move; Gitea artifact actions; remove Sonar and sonar-project.properties (D1). The Windows leg runs in host mode on the PC: the Flutter SDK goes to the runner tool cache, nothing system-wide
codeql.yml CodeQL, cron 17 3 * * 1 Delete → ops security.yml caller (no language flag fits Dart: you get gitleaks, the workflow rules and osv-scanner on pubspec.lock), cron 23 15 * * 5
dependency-review.yml GitHub dependency review Delete (D7)
release.yml builds the four artefacts of doc 11 on ubuntu-24.04 and windows-2025, draft GitHub release; only a v* tag reaches the writing job windows-2025 → windows-latest; Gitea artifact actions; artefacts + checksums to R2 with publish-r2.yml (app: marklens, <version>/…, latest.json as the feed file for D8); draft Gitea release with links. Keep the dispatch-builds-only / tag-writes split (rule 10)
watch-observation.yml manual matrix run Move; drop any macOS leg

.github/dependabot.yml → delete; add renovate.json (Renovate reads pubspec.yaml). .github/FUNDING.yml is GitHub-only.

Code, packaging, docs

  • lib/core/update/update_service.dart (D8) and its tests: test/core/update_service_test.dart (expects the host api.github.com), test/architecture/no_network_test.dart (the allowed-host list).
  • packaging/linux/dev.poli0981.marklens.metainfo.xml (3: homepage → Gitea, bugtracker → GitLab issues), packaging/windows/marklens.iss (AppURLs).
  • README.md (5), docs/03_DATA_FLOW.md, docs/10_SECURITY_PRIVACY.md, docs/11_PACKAGING_UPDATE.md, legal/PRIVACY.md (D8), CLAUDE.md. tool/fonts/build_fonts.py fetches Noto fonts from raw.githubusercontent.com: third-party, leave it.
  • SECURITY.md: GitHub advisories → e-mail. The repo documents no @poli0981.dev address in tracked text: use security@poli0981.dev. Add GitLab issue templates (runbook §3.4).

Secrets

The inventory found none besides SONAR_TOKEN (drop). Create (user level): R2 keys + R2_ACCOUNT_ID.