mirror of
https://github.com/NanmiCoder/claude-code-haha.git
synced 2026-10-10 11:53:10 +08:00
chore(git-hooks): make pre-push checks non-blocking
Replace the local pre-push quality gate with a reminder-only hook, keep manual quality commands documented, and update the contract test to prevent reintroducing a blocking push gate. Tested: bash .git/hooks/pre-push </dev/null Tested: bun test scripts/git-hooks/install.test.ts scripts/pr/quality-contract.test.ts Tested: bun run check:policy Tested: bun run check:docs Tested: git diff --check Confidence: high Scope-risk: narrow
This commit is contained in:
@@ -89,39 +89,35 @@ Every feature, bugfix, and behavior change must ship with verifiable evidence. T
|
||||
- Do not lower `coverage-baseline.json` or `coverage-thresholds.json` just to pass the gate; real baseline/threshold changes require `allow-coverage-baseline-change` and a reason. Legacy low-coverage areas are debt; new PRs must leave touched areas better than they found them.
|
||||
- The PR description must record changed files, tests added, coverage report path, E2E/live report path or blocker, and remaining risk.
|
||||
|
||||
## Local Pre-Push Gate
|
||||
## Local Pre-Push Reminder
|
||||
|
||||
Git hooks are local, so each clone needs to install the hook once:
|
||||
push no longer runs a local quality gate. Run checks manually when needed:
|
||||
|
||||
```bash
|
||||
bun run quality:push
|
||||
```
|
||||
|
||||
`bun run quality:push` reuses the PR gate impact, policy, and path-aware checks, but skips the expensive coverage lane by default; full coverage remains in `bun run verify`, `bun run quality:pr`, and CI.
|
||||
|
||||
You can still install the local pre-push hook, but it only prints a non-blocking reminder and never blocks `git push`:
|
||||
|
||||
```bash
|
||||
bun run hooks:install
|
||||
```
|
||||
|
||||
After installation, every `git push` runs the fast local gate internally (`bun run quality:push`). It reuses the PR gate impact, policy, and path-aware checks, but skips the expensive coverage lane by default; full coverage remains in `bun run verify`, `bun run quality:pr`, and CI. If unit tests, docs/native/adapter checks, or any other selected fast path-aware lane fails, the local hook blocks the push.
|
||||
|
||||
Maintainers or contributors with model quota can also add real provider smoke and desktop agent-browser smoke to the pre-push hook:
|
||||
Maintainers or contributors with model quota can run real provider smoke and desktop agent-browser smoke manually:
|
||||
|
||||
```bash
|
||||
bun run quality:providers
|
||||
bun run hooks:install -- --live-provider-model minimax:main:minimax-main
|
||||
bun run quality:smoke -- --provider-model minimax:main:minimax-main
|
||||
```
|
||||
|
||||
To run the full live baseline before every push, use:
|
||||
To run the full live baseline, use:
|
||||
|
||||
```bash
|
||||
bun run hooks:install -- --live-provider-model minimax:main:minimax-main --live-mode baseline
|
||||
bun run quality:gate --mode baseline --allow-live --provider-model minimax:main:minimax-main
|
||||
```
|
||||
|
||||
These options are stored in local `.git/config` as `quality.prePush*` keys, so provider selectors and secrets are not committed. `smoke` mode covers real provider connectivity plus the desktop UI chat smoke; `baseline` mode also runs every real Coding Agent baseline case.
|
||||
|
||||
Maintainer-level overrides must also be explicit local config before the hook passes them to `quality:push`:
|
||||
|
||||
```bash
|
||||
bun run hooks:install -- --allow-cli-core-change --allow-coverage-baseline-change
|
||||
```
|
||||
|
||||
This only affects the current clone and is not committed; PR CI still requires the matching labels.
|
||||
|
||||
## PR CI Merge Gate
|
||||
|
||||
`.github/workflows/pr-quality.yml` runs for PR `opened`, `synchronize`, `reopened`, `ready_for_review`, `labeled`, and `unlabeled` events. It starts with `change-policy`, which maps changed files to the desktop, server, adapter, native, docs, and coverage lanes. The final `pr-quality-gate` job aggregates every selected job: failed selected jobs fail `pr-quality-gate`, while unselected jobs may be skipped.
|
||||
|
||||
Reference in New Issue
Block a user