Skip to content

ci(gate): staged push/PR gate + stable CHR smoke + agent-friendly reporting (blueprint PR-1) - #55

Merged
mobileskyfi merged 2 commits into
mainfrom
ci/gate-chr-smoke-reporting
Jun 17, 2026
Merged

ci(gate): staged push/PR gate + stable CHR smoke + agent-friendly reporting (blueprint PR-1)#55
mobileskyfi merged 2 commits into
mainfrom
ci/gate-chr-smoke-reporting

Conversation

@mobileskyfi

@mobileskyfi mobileskyfi commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Blueprint PR 1 of 6 — CI/release rework (plan: velvet-yawning-melody). Reconciles the workflows with the existing tier/versioning doctrine, modeled on quickchr's ci.yml.

What this PR does

Reworks ci.yaml into a staged gate so the cheapest signal fails first:

checks (lint) ┐
unit+coverage ┴→ chr-smoke (stable, x86 KVM) → cross-platform-unit
build (parallel)
  • New single-boot smoke test/integration/chr-smoke.test.ts (+ test:integration:smoke): boots one stable CHR and proves REST retrieve, native-api retrieve, and a read-only :put execute round-trip — no router mutation, safe to re-run. Keeps the gate at ~1 VM, not 16.
  • Agent-friendly reporting (github-actions-rich-data doctrine): coverage table + failing-test list → job summary; coverage-report artifact (14d); coverage floor is a non-blocking annotation (trend, not gate), overridable via dispatch min-funcs/min-lines. set -eo pipefail everywhere so tee can't mask a bun failure.
  • CHR image cache (~/.local/share/quickchr/cache) to cut stable boot time.
  • Drops the redundant PR-only fixture-integration job — the devices fixture already runs under the unit job's bun test (CHR suites self-skip without CENTRS_RUN_FAST_INTEGRATION).
  • cross-platform-unit: macOS gates; Windows is informational (continue-on-error) until centrs is verified Windows-clean — a deliberate, flagged deviation from the blueprint's "macos+windows gate".

Verification

  • Local: lint + lint:ci + test (720 pass / 27 skip) + build green.
  • CI (this PR): the gate boots a real stable CHR and runs the new smoke — that run is the end-to-end proof.

Follows in the blueprint

PR-2 QA definitive matrix + event-aware concurrency (removes the CI/QA push-PR duplication), PR-3 CodeQL split, PR-4 release/publish, PR-5 verify-extended + .coderabbit.yaml, PR-6 docs/closure.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests

    • Added integration smoke test validating core functionality paths.
    • Restructured continuous integration workflow with modular job structure and enhanced coverage reporting with configurable thresholds.
  • Chores

    • Updated development documentation for CI processes.

…orting (blueprint PR-1)

Reworks ci.yaml into a staged gate (checks ‖ unit+coverage → chr-smoke →
cross-platform-unit; build) per the approved CI/release blueprint, modeled on
quickchr's ci.yml.

- New single-boot smoke test/integration/chr-smoke.test.ts (+ test:integration:smoke):
  boots ONE stable CHR and proves REST retrieve, native-api retrieve, and a
  read-only `:put` execute round-trip — no router mutation, gate-safe.
- Coverage + failing tests surface to the job summary with retained artifacts;
  coverage floor is a non-blocking annotation (trend, not gate).
- CHR image cache (~/.local/share/quickchr/cache) cuts stable boot time.
- Drops the redundant PR-only fixture-integration job (the devices fixture runs
  under the unit job's `bun test`).
- cross-platform-unit (macOS gates; Windows informational via continue-on-error
  until centrs is verified Windows-clean).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 17, 2026 03:11
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@mobileskyfi, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 52 minutes and 2 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 6c2fd050-675c-4f51-9c9f-93910849ee9e

📥 Commits

Reviewing files that changed from the base of the PR and between a3dab95 and 9111c7f.

📒 Files selected for processing (1)
  • test/integration/chr-smoke.test.ts
📝 Walkthrough

Walkthrough

The CI workflow is split from a monolithic ci job into separate checks, unit, build, chr-smoke, and cross-platform-unit jobs. The unit job adds coverage capture, GitHub summary reporting, artifact upload, and non-blocking threshold warnings. A new CHR smoke integration test (test/integration/chr-smoke.test.ts) is added along with a matching test:integration:smoke script.

Changes

CI Pipeline Restructure and CHR Smoke Test

Layer / File(s) Summary
Workflow triggers and coverage env vars
.github/workflows/ci.yaml
Adds workflow_dispatch inputs min-funcs/min-lines mapped to COVERAGE_MIN_FUNCS/COVERAGE_MIN_LINES env vars; introduces checks as the new entry-point job replacing the old ci job.
Unit job with coverage reporting and thresholds
.github/workflows/ci.yaml
Adds the unit job running bun run test:ci under set -eo pipefail, captures output to /tmp/coverage-report.txt, posts failing test excerpts and a truncated coverage table to the job summary, uploads the report as an artifact, and emits non-blocking ::warning annotations when "All files" coverage falls below configured thresholds.
CHR smoke test and package.json script
package.json, test/integration/chr-smoke.test.ts
Registers test:integration:smoke script and adds a single-boot smoke test that validates REST and native-api retrieve paths plus a read-only execute call, records integration evidence, and always cleans up in a finally block.
Remaining pipeline jobs and glossary
.github/workflows/ci.yaml, GLOSSARY.txt
Rewires build to depend on checks, retains chr-smoke and cross-platform-unit stages, removes the prior fixture-integration job, and adds cspell entries for CI shell vocabulary (endgroup, funcs, gsub, img, pipefail).

Sequence Diagram(s)

sequenceDiagram
  participant dev as Developer / GHA Trigger
  participant checks as checks job
  participant unit as unit job
  participant build as build job
  participant chrsmoke as chr-smoke job

  dev->>checks: push / workflow_dispatch
  checks-->>unit: (parallel)
  checks-->>build: needs: checks
  unit->>unit: bun run test:ci → /tmp/coverage-report.txt
  unit->>unit: append summary + upload artifact
  unit->>unit: emit ::warning if below COVERAGE_MIN_FUNCS/LINES
  checks-->>chrsmoke: needs: checks
  chrsmoke->>chrsmoke: CENTRS_RUN_FAST_INTEGRATION=1 bun test chr-smoke.test.ts
  chrsmoke->>chrsmoke: REST/native-api retrieve + execute assertions
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • tikoci/centrs#41: Modifies the same .github/workflows/ci.yaml file, including workflow_dispatch inputs and CHR integration-related job structure.

Poem

🐇 Hop hop, the pipeline splits in two,
Each job now has its own lane to run through.
The smoke test boots a CHR with care,
Checks REST and native paths with flair.
Coverage warnings wave a gentle paw—
No blocking gates, just notes to gnaw! 🌿

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description is comprehensive and covers the main changes, but does not follow the required template structure with sections for Links, Change type, and Notes. Complete the PR description by adding the required template sections: Links (spec/work item), Change type checkboxes, and Notes (validation run, assumptions).
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main structural change—a staged CI gate with stable CHR smoke testing and improved reporting—and relates directly to the primary changes in the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/gate-chr-smoke-reporting

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the CI push/PR gate into a staged workflow and adds a single-boot RouterOS CHR smoke test to validate core protocol paths (REST + native API) with agent-friendly reporting.

Changes:

  • Adds test/integration/chr-smoke.test.ts and a test:integration:smoke script to run a stable-channel single-boot CHR smoke suite.
  • Reworks .github/workflows/ci.yaml into separate staged jobs (checks → unit+coverage → CHR smoke → cross-platform unit), plus coverage parsing/artifacts and job-summary reporting.
  • Extends GLOSSARY.txt with CI shell/coverage parsing vocabulary used in workflow scripts.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
test/integration/chr-smoke.test.ts New single-boot CHR smoke integration test exercising REST retrieve, native-api retrieve, and read-only execute.
package.json Adds test:integration:smoke script to run the CHR smoke test with the integration flag enabled.
GLOSSARY.txt Adds CI/workflow shell vocabulary tokens used in workflow scripts.
.github/workflows/ci.yaml Implements staged CI jobs, CHR smoke tier, cache/artifacts, and job-summary reporting for failures/coverage.

Comment thread .github/workflows/ci.yaml
Comment on lines +66 to +68
unit:
name: Unit tests & coverage
runs-on: ubuntu-latest

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci.yaml:
- Line 71: The GitHub Actions in this workflow file use mutable version tags
like `@v6` instead of immutable commit SHAs, which weakens supply-chain security.
Replace all mutable `uses:` entries (at lines 54, 71, 111, 142, 159, 175, 216,
and 238) that reference actions with the `@v`* pattern by replacing the version
tag with the full immutable commit SHA for that specific version. For each
action like actions/checkout@v6, look up the commit SHA corresponding to that
version and replace `@v6` with the full commit hash (format:
@<40-character-hex-hash>). Apply this pinning pattern consistently to all
changed uses entries in the file.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f02b5764-055f-4acf-b51e-0e55383c9fd0

📥 Commits

Reviewing files that changed from the base of the PR and between 439b922 and a3dab95.

📒 Files selected for processing (4)
  • .github/workflows/ci.yaml
  • GLOSSARY.txt
  • package.json
  • test/integration/chr-smoke.test.ts

Comment thread .github/workflows/ci.yaml
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify all workflow action references in this file are SHA-pinned.
rg -nP '^\s*uses:\s*[^@[:space:]]+@(?![0-9a-f]{40}\b)[^[:space:]]+' .github/workflows/ci.yaml

Repository: tikoci/centrs

Length of output: 370


Pin all GitHub Actions to immutable commit SHAs.

Lines 54, 71, 111, 142, 159, 175, 216, and 238 use mutable tags (@v*), which weakens workflow supply-chain integrity.

Suggested fix pattern
-        uses: actions/checkout@v6
+        uses: actions/checkout@<40-char-commit-sha> # v6

-        uses: actions/upload-artifact@v4
+        uses: actions/upload-artifact@<40-char-commit-sha> # v4

-        uses: actions/cache@v4
+        uses: actions/cache@<40-char-commit-sha> # v4

Apply the same pinning pattern to every changed uses: entry in this file.

🧰 Tools
🪛 zizmor (1.25.2)

[warning] 70-71: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)


[error] 71-71: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yaml at line 71, The GitHub Actions in this workflow
file use mutable version tags like `@v6` instead of immutable commit SHAs, which
weakens supply-chain security. Replace all mutable `uses:` entries (at lines 54,
71, 111, 142, 159, 175, 216, and 238) that reference actions with the `@v`*
pattern by replacing the version tag with the full immutable commit SHA for that
specific version. For each action like actions/checkout@v6, look up the commit
SHA corresponding to that version and replace `@v6` with the full commit hash
(format: @<40-character-hex-hash>). Apply this pinning pattern consistently to
all changed uses entries in the file.

Source: Linters/SAST tools

The CHR smoke's execute step went through runCli, whose non-TTY stdin handling
emitted a stderr line and failed the `expect(stderr).toHaveLength(0)` gate on the
runner. Switch to the programmatic executeEnvelope (as execute.test.ts does for
the same `:put [/system/identity/get name]` command) so the gate proves the
validate→run path without the CLI's interactive-stdin layer. Retrieve steps keep
using runCli for CLI-entrypoint coverage.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mobileskyfi

Copy link
Copy Markdown
Contributor Author

Bot review dispositions (declining both, with reason):

  • CodeRabbit — "SHA-pin all actions/*": declined. This repo's established convention is mutable tags for first-party actions/* (checkout/cache/upload-artifact) and SHA-pinning only third-party actions (e.g. oven-sh/setup-bun, which is SHA-pinned here). Consistent with prior PRs in this repo.
  • Copilot — "make unit need checks": declined. lint ‖ unit running in parallel is intentional (both are ~1–2 min) and matches the quickchr reference ci.yml; the staging gate is chr-smoke/cross-platform-unit which already needs: [checks, unit]. The header DAG comment reflects this.

CodeRabbit was rate-limited (org prepaid credits) — .coderabbit.yaml (non-draft, no per-commit incremental) lands next as PR-1b to conserve credits for the rest of the blueprint.

@mobileskyfi
mobileskyfi merged commit c9c4cf3 into main Jun 17, 2026
12 of 13 checks passed
@mobileskyfi
mobileskyfi deleted the ci/gate-chr-smoke-reporting branch June 17, 2026 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants