mirror of
https://github.com/hanzoai/insights.git
synced 2026-11-03 00:52:32 +00:00
The rename runs on the way in and nothing checked it afterwards, so paths and content drifted apart in three places, and each one broke something quietly. The script language had three names at once. Files on disk carried `.iql`/`.iqle`, the source matchers said `.script`, and the bytecode matchers said `.hoge`, so the test harness globbed zero files and the STL compiler regenerated an empty table. It is `script` now, in one place: `.script` source, `.scriptc` bytecode, `bin/script` to run one and `bin/scriptc` to compile one. 190 TypeScript specifiers named files that had been renamed away, which is the whole CDP consumer graph -- the event worker, not the web boot. `--check` only ever read Python imports; it reads both module systems now, and repoints both. `-hog-` became `-mascot-` in paths while content said `script`, so the code review product's skill directories stopped matching the prefix that discovers them and it ran with no perspectives at all. PATH_REGEX is CONTENT_REGEX -- the same list, not a copy -- so a rule can no longer land in one and miss the other, and the four disagreeing `hog` path rules collapse into the one word rule content already had. `HOGLI_*` becomes `INSIGHTSCLI_*` at every reader and writer, with no alias: an env var read under two names is two names. The seven casings of `hogql` and five of `hogvm` collapse into one rule per prefix casing, which leaves the suffix alone because `QL` is SQL's and `VM` is a virtual machine's. `--check` now refuses every retired spelling, in content and in paths, and draws the line the rules draw: `insights_hogfunction` is a Postgres table so it is left alone, and a migration filename is its identity in `django_migrations` so it is frozen rather than failed. Third-party names we cannot rename are reported as pending, never exempted.
3.9 KiB
3.9 KiB
name, description
| name | description |
|---|---|
| running-ci-preflight | Catch the deterministic CI failures reachable from your diff before pushing, with `insightscli ci:preflight`. Use when the pre-push hook blocks a push, before reporting a task done, or after editing Python, serializers, migrations, workflows, or dependency manifests — to avoid burning a CI matrix on a failure you could catch locally (formatting, lint, broken lockfiles, OpenAPI drift, migration conflict, stale branch). Trigger terms: ci:preflight, preflight, pre-push checks, pre-push hook failed, "will this break CI". |
Running ci:preflight
insightscli ci:preflight scopes a curated set of checks to the files your branch touched — each mapped to a
CI failure class that has taken master down — plus an always-on branch-freshness check. It is the
pre-push counterpart to insightscli ci:insights (what is already broken on master).
The pre-push hook runs ci:preflight --strict automatically and blocks the push on failed checks.
Never bypass it with --no-verify — fix what it reports instead.
The loop (when the hook blocks, or before reporting done)
insightscli ci:preflight --fix
- Run with
--fix— it formats, lints, and auto-fixes what is safe. - Read each line:
✓ pass,✗ fail,→ advisory(do it yourself),· skipped(capability absent). - Resolve every
✗ fail— these are what--fixcould not (real lint error, broken lockfile, migration conflict). These block the push. - Act on every
→ advisory— e.g.openapiadvisory → runinsightscli build:openapiand commit the drift;stalenessadvisory →git merge origin/master. Advisories never block, but ignoring them ships the failure to CI. Resolve them before pushing, including drift you didn't introduce — you own the branch state you push. - Re-run until clean, then push.
Notes
- Strict = failures only.
--strict(what the hook runs) exits non-zero only on✗ fail— advisories are unverifiable-locally classes, so they warn without blocking. A clean exit means "nothing left to fix", not "CI will pass" — CI stays the authoritative gate. Non-blocking is a mechanism limit, not permission to skip. type-checkis a nudge, not a run. Only a repo-wide mypy run matches CI (mypy follows imports, so a changed-file subset misses reverse-dependency breakage), and that costs minutes cold — too much to tax every push with. So preflight names the command instead of running it: judge whether your change is type-risky and run it yourself. CI blocks on the same command, so a type error you skip here comes back as a full re-run.- Staleness is risk-based. It fires when merging master now would actually break something — textual merge conflicts (computed via
git merge-tree, working tree untouched), migrations added on both sides, generated-file inputs changed on both sides, or CI workflows changed on master — plus a behind/age backstop, aggressive by default (5 commits / 2 days; env-tunable viaINSIGHTSCLI_PREFLIGHT_STALE_COMMITS/INSIGHTSCLI_PREFLIGHT_STALE_DAYS) so we over-warn to start and tune down from telemetry. Merge master in when it fires. Advisory only, never auto-merged. · skipped (needs stack/node)is expected on a bare checkout or sandbox. Start the stack withinsightscli startto run those, or let CI cover them. No hooks in your environment (nonode_modules)? Run the loop yourself before pushing.- Flags.
--against <ref>diffs against an explicit base;--jsonemits a machine-readable summary. - Kill switch.
INSIGHTSCLI_PREFLIGHT_DISABLED=1makes the command (and the hook) a no-op with exit 0. It is a rollout/emergency lever — respect it; never unset it to force a run.
Why it matters
Drafts already run a trimmed CI subset; the expensive waste is a ready PR that fails the full matrix on something deterministic, gets fixed, and re-runs the whole matrix. Catching that locally is the cheapest CI saving available.