Consolidate Forgejo PR preflight checks #70

Merged
alexander merged 2 commits from mcp/consolidate-pr-preflight into main 2026-09-20 13:20:09 +02:00
Owner

Goal

Make BookWave's manual Forgejo PR gate more efficient on the shared capacity-1 runner without increasing global runner concurrency or weakening validation.

Evidence before the change

Current main at investigation start:

1790c1ad9ec280c3fe65a3eabb36a244b45fc49a

Recent successful PR runs showed the same four serial prerequisite jobs on the same capacity-1 runner. UI run #173 is representative:

Check Wall time
PR policy/change classification ~3s
Gradle wrapper validation ~3s
Secret scan ~5s
Committed Room-schema immutability ~3s

From the first prerequisite job starting to the fourth finishing, run #173 spent about 16.9s. Each job independently created a node:22-bookworm container and ran its own checkout.

main has no required status-check contexts configured, so the old individual job names are not a branch-protection contract.

None of the four prerequisite jobs receives signing material, repository secrets or privileged checkout credentials. There is no security or correctness benefit from putting those checks in separate clean containers.

Change

  • replace the four prerequisite jobs with one PR #<number> · Preflight job;
  • perform one full-history checkout for the four checks;
  • preserve separately named steps for:
    1. PR policy/change classification;
    2. Gradle wrapper validation;
    3. pinned/checksummed gitleaks secret scan;
    4. committed Room-schema immutability;
  • use continue-on-error on the validation steps and a final preflight verdict so one failed check does not hide other preflight diagnostics;
  • preserve classpath_changed as the preflight job output consumed by verifyDebug;
  • keep PR #<number> · verifyDebug as the separate heavyweight Android job;
  • preserve current-main/rebase validation, R-31 rerun classification, token stripping, dependency verification, Gradle cache restore and all artifact/report uploads;
  • document that BookWave optimizes inside the workflow while the shared runner remains at capacity 1.

No application code, dependencies, Gradle/AGP/Kotlin/JDK versions, Android SDK levels, signing behavior, release behavior or runner configuration changed.

Exact-head validation

Final PR head:

669e1a2d40d698211e177e1113ad552b76b9a76c

Base main:

1790c1ad9ec280c3fe65a3eabb36a244b45fc49a

Forgejo UI run #175: PASS on that exact head.

Preflight:

  • ~7.0s, down from ~16.9s on representative run #173;
  • about 9.8s / 58% faster for the prerequisite phase;
  • PR #70/head validation passed;
  • classpath detection correctly selected verification_mode=rerun because this PR changes a Forgejo workflow;
  • wrapper checksum validation passed;
  • pinned gitleaks scan passed;
  • Room schema immutability passed.

Heavy gate:

  • trusted ~1.6 GB Gradle cache restored successfully;
  • preinstalled Android SDK verification passed;
  • verifyDebug --rerun-tasks passed in 7m53s;
  • 1184 actionable tasks, 1184 executed;
  • workflow total 9m06s.

The full workflow total is intentionally close to the recent classpath-change baseline because this CI-only PR correctly forces all Gradle tasks to execute. The deterministic improvement is the preflight phase and removal of three redundant job/container/checkout boundaries.

No further obvious duplicate work was removed from verifyDebug: its checkout, trusted-cache restore, environment contract check, single Gradle gate and report/artifact uploads have distinct responsibilities. Memory/worker limits and verification coverage are unchanged.

No merge requested; repository owner will review and merge manually.

## Goal Make BookWave's manual Forgejo PR gate more efficient on the shared **capacity-1** runner without increasing global runner concurrency or weakening validation. ## Evidence before the change Current `main` at investigation start: `1790c1ad9ec280c3fe65a3eabb36a244b45fc49a` Recent successful PR runs showed the same four serial prerequisite jobs on the same capacity-1 runner. UI run #173 is representative: | Check | Wall time | | --- | ---: | | PR policy/change classification | ~3s | | Gradle wrapper validation | ~3s | | Secret scan | ~5s | | Committed Room-schema immutability | ~3s | From the first prerequisite job starting to the fourth finishing, run #173 spent about **16.9s**. Each job independently created a `node:22-bookworm` container and ran its own checkout. `main` has no required status-check contexts configured, so the old individual job names are not a branch-protection contract. None of the four prerequisite jobs receives signing material, repository secrets or privileged checkout credentials. There is no security or correctness benefit from putting those checks in separate clean containers. ## Change - replace the four prerequisite jobs with one `PR #<number> · Preflight` job; - perform one full-history checkout for the four checks; - preserve separately named steps for: 1. PR policy/change classification; 2. Gradle wrapper validation; 3. pinned/checksummed gitleaks secret scan; 4. committed Room-schema immutability; - use `continue-on-error` on the validation steps and a final preflight verdict so one failed check does not hide other preflight diagnostics; - preserve `classpath_changed` as the preflight job output consumed by `verifyDebug`; - keep `PR #<number> · verifyDebug` as the separate heavyweight Android job; - preserve current-main/rebase validation, R-31 rerun classification, token stripping, dependency verification, Gradle cache restore and all artifact/report uploads; - document that BookWave optimizes inside the workflow while the shared runner remains at capacity 1. No application code, dependencies, Gradle/AGP/Kotlin/JDK versions, Android SDK levels, signing behavior, release behavior or runner configuration changed. ## Exact-head validation Final PR head: `669e1a2d40d698211e177e1113ad552b76b9a76c` Base `main`: `1790c1ad9ec280c3fe65a3eabb36a244b45fc49a` Forgejo UI run **#175**: **PASS** on that exact head. Preflight: - **~7.0s**, down from ~16.9s on representative run #173; - about **9.8s / 58% faster** for the prerequisite phase; - PR #70/head validation passed; - classpath detection correctly selected `verification_mode=rerun` because this PR changes a Forgejo workflow; - wrapper checksum validation passed; - pinned gitleaks scan passed; - Room schema immutability passed. Heavy gate: - trusted ~1.6 GB Gradle cache restored successfully; - preinstalled Android SDK verification passed; - `verifyDebug --rerun-tasks` passed in **7m53s**; - **1184 actionable tasks, 1184 executed**; - workflow total **9m06s**. The full workflow total is intentionally close to the recent classpath-change baseline because this CI-only PR correctly forces all Gradle tasks to execute. The deterministic improvement is the preflight phase and removal of three redundant job/container/checkout boundaries. No further obvious duplicate work was removed from `verifyDebug`: its checkout, trusted-cache restore, environment contract check, single Gradle gate and report/artifact uploads have distinct responsibilities. Memory/worker limits and verification coverage are unchanged. No merge requested; repository owner will review and merge manually.
Author
Owner

PR #70 is ready for review.

Final exact-head evidence:

  • head 669e1a2d40d698211e177e1113ad552b76b9a76c against main 1790c1ad9ec280c3fe65a3eabb36a244b45fc49a;
  • UI run #175 PASS;
  • consolidated Preflight: ~7.0s vs ~16.9s on representative pre-change run #173 (~9.8s / 58% faster for that phase);
  • classifier still selected full rerun for the workflow change;
  • wrapper validation, pinned gitleaks scan and Room-schema immutability all passed;
  • verifyDebug --rerun-tasks: 7m53s, 1184/1184 tasks executed;
  • total run: 9m06s;
  • shared runner capacity remains 1; no runner/CT520/Podman/Proxmox configuration changed;
  • no app, dependency, toolchain, SDK, signing or release behavior changes.

No merge performed.

PR #70 is ready for review. Final exact-head evidence: - head `669e1a2d40d698211e177e1113ad552b76b9a76c` against main `1790c1ad9ec280c3fe65a3eabb36a244b45fc49a`; - UI run #175 PASS; - consolidated Preflight: ~7.0s vs ~16.9s on representative pre-change run #173 (~9.8s / 58% faster for that phase); - classifier still selected full rerun for the workflow change; - wrapper validation, pinned gitleaks scan and Room-schema immutability all passed; - `verifyDebug --rerun-tasks`: 7m53s, 1184/1184 tasks executed; - total run: 9m06s; - shared runner capacity remains 1; no runner/CT520/Podman/Proxmox configuration changed; - no app, dependency, toolchain, SDK, signing or release behavior changes. No merge performed.
alexander deleted branch mcp/consolidate-pr-preflight 2026-09-20 13:20:09 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
alexander/Audiobookshelf-Manager-Claude!70
No description provided.