Improve CI PR verification diagnostics and titles #83

Merged
alexander merged 15 commits from mcp/ci-pr-workflow-title into main 2026-09-22 17:54:55 +02:00
Owner

Follow-up to #82. This PR now owns the PR-verification workflow cleanup rather than creating a competing workflow PR.

Visible naming

  • Actions workflow title: CI · PR verification;
  • run-name: CI · PR #<number> — <ref>;
  • jobs use CI · PR #<number> · ....

Collect → summarize → fail-at-the-end verification

  • keeps the existing cheap security/policy preflight and aggregates all preflight failures;
  • runs exactly one heavyweight ./gradlew verifyDebug --continue invocation;
  • captures the complete Gradle log instead of stopping diagnostic collection at the first non-zero exit;
  • still checks Room schema drift, dependency resolution and expected APK output after Gradle finishes;
  • summarizes failed Gradle tasks, failed unit tests, ktlint, detekt, Android Lint and compiler/build errors;
  • uploads the full Gradle/dependency logs plus ktlint, detekt, lint, test reports and raw test XML as artifacts;
  • fails once at the final verification gate after diagnostics/artifacts have been produced.

PR feedback

  • preserves exact PR-HEAD validation;
  • verifyDebug checks the exact SHA validated by preflight;
  • BookWave / PR verification remains green on full success / red on failure;
  • failure status descriptions now identify categories such as ktlint, tests, compile, Room schema or dependencies.

Validation so far

  • Forgejo parses the workflow on this branch;
  • the workflow contains exactly one verifyDebug invocation;
  • scripts/ci/pr-diagnostics.py passes managed Python compile validation;
  • scripts/ci/pr-diagnostics.py passes managed Ruff lint validation;
  • branch-only workflow dispatch is not supported by the prox2 gateway, so one manual Forgejo Actions acceptance run against PR #83 is still required.

Do not merge automatically.

Follow-up to #82. This PR now owns the PR-verification workflow cleanup rather than creating a competing workflow PR. ## Visible naming - Actions workflow title: `CI · PR verification`; - run-name: `CI · PR #<number> — <ref>`; - jobs use `CI · PR #<number> · ...`. ## Collect → summarize → fail-at-the-end verification - keeps the existing cheap security/policy preflight and aggregates all preflight failures; - runs exactly one heavyweight `./gradlew verifyDebug --continue` invocation; - captures the complete Gradle log instead of stopping diagnostic collection at the first non-zero exit; - still checks Room schema drift, dependency resolution and expected APK output after Gradle finishes; - summarizes failed Gradle tasks, failed unit tests, ktlint, detekt, Android Lint and compiler/build errors; - uploads the full Gradle/dependency logs plus ktlint, detekt, lint, test reports and raw test XML as artifacts; - fails once at the final verification gate after diagnostics/artifacts have been produced. ## PR feedback - preserves exact PR-HEAD validation; - `verifyDebug` checks the exact SHA validated by preflight; - `BookWave / PR verification` remains green on full success / red on failure; - failure status descriptions now identify categories such as `ktlint`, `tests`, `compile`, `Room schema` or `dependencies`. ## Validation so far - Forgejo parses the workflow on this branch; - the workflow contains exactly one `verifyDebug` invocation; - `scripts/ci/pr-diagnostics.py` passes managed Python compile validation; - `scripts/ci/pr-diagnostics.py` passes managed Ruff lint validation; - branch-only workflow dispatch is not supported by the prox2 gateway, so one manual Forgejo Actions acceptance run against PR #83 is still required. Do not merge automatically.
Polish PR diagnostics script
Some checks failed
BookWave / PR verification PR head changed during verification; rerun checks
8422bb2e43
alexander changed title from Clarify CI PR workflow titles to Improve CI PR verification diagnostics and titles 2026-09-22 17:14:10 +02:00
Author
Owner

Acceptance run for the improved PR gate

Run CI · PR verification once against this PR:

  • Use workflow from: mcp/ci-pr-workflow-title
  • PR number: 83
  • Force rerun: Off

Because this PR changes .forgejo/workflows/*, classification should deliberately select the full --rerun-tasks path.

Expected behavior:

  1. Preflight runs all four cheap checks and writes a compact table before its final gate.
  2. Verification runs exactly one ./gradlew verifyDebug --continue and captures the full log.
  3. Even if verifyDebug fails, Room schema, dependency resolution, diagnostics generation and artifact uploads still run.
  4. The consolidated summary lists unit-test, ktlint, detekt, Android Lint, compile/build, schema, dependency and APK state.
  5. A ci-diagnostics artifact contains the summary plus full Gradle/dependency logs; quality-reports now also includes ktlint and raw test-result XML.
  6. The final gate fails only after diagnostics are collected.
  7. BookWave / PR verification publishes a green check on full success or a red X with a category-specific description on failure.

Static validation already completed: Forgejo workflow parsing PASS, diagnostics Python compile PASS, Ruff lint PASS.

### Acceptance run for the improved PR gate Run **CI · PR verification** once against this PR: - **Use workflow from:** `mcp/ci-pr-workflow-title` - **PR number:** `83` - **Force rerun:** Off Because this PR changes `.forgejo/workflows/*`, classification should deliberately select the full `--rerun-tasks` path. Expected behavior: 1. Preflight runs all four cheap checks and writes a compact table before its final gate. 2. Verification runs exactly one `./gradlew verifyDebug --continue` and captures the full log. 3. Even if `verifyDebug` fails, Room schema, dependency resolution, diagnostics generation and artifact uploads still run. 4. The consolidated summary lists unit-test, ktlint, detekt, Android Lint, compile/build, schema, dependency and APK state. 5. A `ci-diagnostics` artifact contains the summary plus full Gradle/dependency logs; `quality-reports` now also includes ktlint and raw test-result XML. 6. The final gate fails only after diagnostics are collected. 7. `BookWave / PR verification` publishes a green check on full success or a red X with a category-specific description on failure. Static validation already completed: Forgejo workflow parsing PASS, diagnostics Python compile PASS, Ruff lint PASS.
Use PR title or branch in CI job names
Some checks failed
pull-request.yml / Use PR title or branch in CI job names (push) Failing after 0s
pull-request.yml / Use PR title or branch in CI job names (pull_request) Failing after 0s
ab3fea87fa
Label CI diagnostics by PR title or branch
Some checks failed
pull-request.yml / Label CI diagnostics by PR title or branch (push) Failing after 0s
pull-request.yml / Label CI diagnostics by PR title or branch (pull_request) Failing after 0s
c81a0637cf
Author
Owner

Dynamic CI job naming added

The manual PR number is now optional. A lightweight identity job resolves the selected target before the real checks run.

When a PR number is supplied, Forgejo API metadata is used and the downstream jobs are named like:

  • CI · PR #83 · Improve CI PR verification diagnostics and titles · Preflight
  • CI · PR #83 · Improve CI PR verification diagnostics and titles · verification
  • CI · PR #83 · Improve CI PR verification diagnostics and titles · publish check

When PR number is omitted, the selected Use workflow from branch becomes the label instead, e.g. CI · mcp/issue-77-sleep-timer-grace · verification.

The resolver also verifies that a supplied PR number actually belongs to the selected branch before any expensive Gradle work starts.

Current HEAD: 8db00e9d3ef4f94b71273598d303da2ca20b3f98.

Validation: Forgejo workflow parse PASS; job graph exactly identity → preflight → verification → publish; exactly one verifyDebug; diagnostics Python compile PASS; Ruff lint PASS.

Note: the top-level Actions list row remains the static workflow name CI · PR verification on Forgejo 16.0.4 because this server does not render dynamic run-name. The dynamic PR title/branch is visible in the actual job names and diagnostics.

### Dynamic CI job naming added The manual PR number is now optional. A lightweight identity job resolves the selected target before the real checks run. When a PR number is supplied, Forgejo API metadata is used and the downstream jobs are named like: - `CI · PR #83 · Improve CI PR verification diagnostics and titles · Preflight` - `CI · PR #83 · Improve CI PR verification diagnostics and titles · verification` - `CI · PR #83 · Improve CI PR verification diagnostics and titles · publish check` When PR number is omitted, the selected **Use workflow from** branch becomes the label instead, e.g. `CI · mcp/issue-77-sleep-timer-grace · verification`. The resolver also verifies that a supplied PR number actually belongs to the selected branch before any expensive Gradle work starts. Current HEAD: `8db00e9d3ef4f94b71273598d303da2ca20b3f98`. Validation: Forgejo workflow parse PASS; job graph exactly `identity → preflight → verification → publish`; exactly one `verifyDebug`; diagnostics Python compile PASS; Ruff lint PASS. Note: the top-level Actions list row remains the static workflow name `CI · PR verification` on Forgejo 16.0.4 because this server does not render dynamic `run-name`. The dynamic PR title/branch is visible in the actual job names and diagnostics.
Keep successful CI summaries minimal
All checks were successful
BookWave / PR verification BookWave PR verification passed
dce704d1db
Author
Owner

CI output streamlined + artifact failure addressed

The previous #83 verification failure was not a BookWave quality failure:

  • verifyDebug: success (BUILD SUCCESSFUL);
  • unit tests: 2559 / 0 failed;
  • ktlint: 0 findings;
  • detekt: 0 findings;
  • Android Lint: 0 errors / 0 warnings / 1 hint;
  • Room schema: success;
  • dependency resolution: success;
  • debug APK: produced successfully.

The job turned red only because quality-reports attempted to upload ~997 individual report files and Forgejo's artifact endpoint returned repeated HTTP 500 responses.

Current workflow fixes that and reduces successful-run noise:

  • successful PR CI uploads no bulky diagnostic artifacts;
  • quality reports are packaged into one tar.gz and uploaded only when verifyDebug fails;
  • ci-diagnostics uploads only on a required-check failure;
  • Room schemas upload only on schema failure;
  • dependency report uploads only on dependency-resolution failure;
  • debug APK is verified locally but no longer uploaded by PR CI.

Visible dynamic job labels include both target and workflow source, e.g. CI · PR #83 · Improve CI PR verification diagnostics and titles · verification · wf:mcp/ci-pr-workflow-title; runs after merge from main will show wf:main.

Current HEAD: dce704d1db054bb8659f96d60473d4d07f539858.

Validation: Forgejo workflow parse PASS; job graph exactly identity → preflight → verification → publish; one verifyDebug invocation; diagnostics Python compile PASS; Ruff lint PASS.

A fresh manual run on the current HEAD is still required for runtime acceptance.

### CI output streamlined + artifact failure addressed The previous #83 verification failure was **not** a BookWave quality failure: - `verifyDebug`: success (`BUILD SUCCESSFUL`); - unit tests: 2559 / 0 failed; - ktlint: 0 findings; - detekt: 0 findings; - Android Lint: 0 errors / 0 warnings / 1 hint; - Room schema: success; - dependency resolution: success; - debug APK: produced successfully. The job turned red only because `quality-reports` attempted to upload ~997 individual report files and Forgejo's artifact endpoint returned repeated HTTP 500 responses. Current workflow fixes that and reduces successful-run noise: - successful PR CI uploads **no bulky diagnostic artifacts**; - quality reports are packaged into one tar.gz and uploaded only when `verifyDebug` fails; - `ci-diagnostics` uploads only on a required-check failure; - Room schemas upload only on schema failure; - dependency report uploads only on dependency-resolution failure; - debug APK is verified locally but no longer uploaded by PR CI. Visible dynamic job labels include both target and workflow source, e.g. `CI · PR #83 · Improve CI PR verification diagnostics and titles · verification · wf:mcp/ci-pr-workflow-title`; runs after merge from main will show `wf:main`. Current HEAD: `dce704d1db054bb8659f96d60473d4d07f539858`. Validation: Forgejo workflow parse PASS; job graph exactly identity → preflight → verification → publish; one verifyDebug invocation; diagnostics Python compile PASS; Ruff lint PASS. A fresh manual run on the current HEAD is still required for runtime acceptance.
alexander deleted branch mcp/ci-pr-workflow-title 2026-09-22 17:54:55 +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!83
No description provided.