chore: harden CI, releases and the app update check #122

Closed
midas wants to merge 0 commits from review/ci-hardening into dev
Owner

Part of #105, fixes #80, #81, #82 and #102. All chore:; the Forgejo-side behaviour is proven only by running it, so please look at this PR's own CI run first.

  • #81: check-patches.sh exits 0 ok / 1 patch failed (Failed: / Not applied: lines) / 2 no verdict (OOM, crash, timeout, list-patches failure); Morphe and APKEditor calls under timeout; stderr visible. app-update-check.sh opens "update check failed" on 2, validates list-versions output, fails red on errors.
  • #80: release runs the unit tests before semantic-release; concurrency (Forgejo ≥14 supports it: release group release, no cancel; ci per ref, cancel); forgejo-release.cjs checks permissions.push in verifyConditions, timeouts on all requests, GET retries, download_url from nextRelease.gitTag; recovery of a tag without release/.mpp documented in the release skill.
  • #82: no GITHUB_ACTOR/TOKEN fallback (clear error without gpr.*); jitpack removed; gradle/verification-metadata.xml (sha256; Linux aapt2 added by hand); actions pinned to SHAs; app-update-check split into a token-less check job (download, verify signers before unpacking, check-patches) and a report job with the token; composite action .forgejo/actions/gpr-credentials.
  • #102: .gitattributes * text=auto + LF for CI files (renormalize was a no-op); Renovate managerFilePatterns; shared scripts/tool-versions.env read by setup-tools.ps1/.sh and tracked by Renovate; setup-tools.sh reports GitHub 403/429 instead of "not found". smali stays in the catalog (the Morphe plugin reads it). Remaining deprecation Configuration.setVisible comes from the Morphe Gradle plugin.

Verified locally: buildAndroid + unit tests (also with a fresh Gradle home), tampered checksum fails, check-patches exit codes 0/1/2 incl. OOM/timeout simulations, report-mode dry runs, bash -n. Not verified: workflows on Forgejo, node --check of the .cjs, Renovate handling of the pinned forms.

🤖 Generated with Claude Code

Part of #105, fixes #80, #81, #82 and #102. All `chore:`; the Forgejo-side behaviour is proven only by running it, so please look at this PR's own CI run first. - #81: `check-patches.sh` exits 0 ok / 1 patch failed (`Failed:` / `Not applied:` lines) / 2 no verdict (OOM, crash, timeout, list-patches failure); Morphe and APKEditor calls under `timeout`; stderr visible. `app-update-check.sh` opens "update check failed" on 2, validates list-versions output, fails red on errors. - #80: release runs the unit tests before semantic-release; `concurrency` (Forgejo ≥14 supports it: release group `release`, no cancel; ci per ref, cancel); `forgejo-release.cjs` checks `permissions.push` in verifyConditions, timeouts on all requests, GET retries, `download_url` from `nextRelease.gitTag`; recovery of a tag without release/.mpp documented in the release skill. - #82: no GITHUB_ACTOR/TOKEN fallback (clear error without gpr.*); jitpack removed; `gradle/verification-metadata.xml` (sha256; Linux aapt2 added by hand); actions pinned to SHAs; app-update-check split into a token-less `check` job (download, verify signers before unpacking, check-patches) and a `report` job with the token; composite action `.forgejo/actions/gpr-credentials`. - #102: `.gitattributes` `* text=auto` + LF for CI files (renormalize was a no-op); Renovate `managerFilePatterns`; shared `scripts/tool-versions.env` read by setup-tools.ps1/.sh and tracked by Renovate; setup-tools.sh reports GitHub 403/429 instead of "not found". `smali` stays in the catalog (the Morphe plugin reads it). Remaining deprecation `Configuration.setVisible` comes from the Morphe Gradle plugin. Verified locally: buildAndroid + unit tests (also with a fresh Gradle home), tampered checksum fails, check-patches exit codes 0/1/2 incl. OOM/timeout simulations, report-mode dry runs, `bash -n`. Not verified: workflows on Forgejo, `node --check` of the .cjs, Renovate handling of the pinned forms. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Index content is already LF everywhere (git add --renormalize changes nothing else); the
rules now also cover *.py, *.cjs and .forgejo/**, so a contributor's autocrlf can no longer
put CR in a script the runner executes. Binary file types are listed explicitly.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
0 = every patch applied, 1 = a patch failed (Failed:/Not applied: lines), 2 = no verdict
(rejected input or broken tooling: JVM crash/OOM, timeout, list-patches failing, no report).
Morphe calls run under timeout, list-patches stderr is no longer hidden and runs before the
patch. apksigner now verifies every APK against the known signing keys before aapt2,
APKEditor or Morphe see it, and the archive extraction is flattened and size-limited.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
settings.gradle.kts fails with a clear message without gpr.user/gpr.key instead of sending
the Forgejo job token to maven.pkg.github.com, and jitpack is gone (a build with a fresh
Gradle home resolves without it). gradle/verification-metadata.xml pins sha256 for the
dependencies of buildAndroid, publish, generatePatchesList and the extension unit tests.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Actions are pinned to commit SHAs. app-update-check runs in two jobs: "check" handles the
APKPure download without any Forgejo token, "report" (fresh container) reads the result
files and opens issues/PRs; exit 2 of check-patches.sh opens "update check failed" and turns
the run red instead of claiming "patches no longer apply". list-versions output is
validated. The triplicated GitHub Packages credentials step is a local composite action.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
release.yml runs the extension unit tests before semantic-release and uses concurrency
group "release" with cancel-in-progress false (Forgejo 15 supports the key; without it a newer
push cancels the running release). forgejo-release.cjs checks permissions.push in
verifyConditions (before the tag push), puts a timeout on every request, retries GETs and
builds download_url from nextRelease.gitTag. The release skill documents recovering a tag
that has no release or .mpp.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
scripts/tool-versions.env holds the Morphe Desktop and APKEditor versions for
setup-tools.ps1 and setup-tools.sh (the workflow no longer pins them); Renovate bumps it
(managerFilePatterns instead of the deprecated fileMatch). setup-tools.sh reports a GitHub API
403/429 instead of "release not found" and times out its requests. The libs catalog comment
no longer mentions dependabot; the smali entry stays because the Morphe plugin reads it.
AGENTS.md documents the CI changes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Author
Owner

Merged into dev as 54726d1 (merged locally together with other review PRs, so Forgejo didn't mark it merged).

Merged into dev as 54726d1 (merged locally together with other review PRs, so Forgejo didn't mark it merged).
midas closed this pull request 2026-10-17 21:03:37 +02:00
All checks were successful
CI / Build (pull_request) Successful in 1m18s
Required
Details

Pull request closed

Sign in to join this conversation.
No description provided.