Interview: 50 PRs roz, bug main tak kaise rokoge? AI auto-check pipeline
Ek senior har PR review kare toh 50 PRs roz par wo bottleneck ban jaata hai aur time typo dhoondhne mein jaata hai. Auto-check pipeline mein machines pehle check karti hain: (1) laptop par hooks lint, format aur secret scan karte hain, (2) har PR par CI lint aur tests chalata hai, (3) AI reviewer (Claude Code GitHub Action, CodeRabbit, Copilot, GitLab Duo) diff padhkar line par comment karta hai, (4) CI fail ho toh AI logs padhkar fix PR kholta hai, (5) gitleaks, CodeQL aur Dependabot ya Renovate security aur dependencies dekhte hain, (6) branch rule: required checks green aur kam se kam ek human approval, tabhi merge. Insaan sirf logic aur design review karta hai.
Links
Aaj ye karo
- Hooks: npm install --save-dev lefthook (ya pip install pre-commit, phir pre-commit install). lefthook.yml mein eslint --fix aur prettier --write {staged_files} with stage_fixed: true. gitleaks hook lagao taaki API keys commit na hon.
- CI: .github/workflows/ci.yml, workflow ka naam CI rakho, har pull_request par npm ci, lint aur test. GitLab mein rule $CI_PIPELINE_SOURCE == "merge_request_event", Bitbucket mein pipelines: pull-requests: '**'.
- AI review (GitHub): Claude Code mein /install-github-app chalao. Ya anthropics/claude-code-action@v1 ka Code Review workflow lagao (code-review plugin, --comment flag). Team ke rules CLAUDE.md mein likho.
- AI review (GitLab/Bitbucket): Claude Code GitLab CI job (beta), ya kisi bhi CI mein claude -p headless, ya CodeRabbit app jo GitHub, GitLab aur Bitbucket teeno par chalta hai.
- Auto-fix: claude-code-action ka ci-failure-auto-fix example, CI workflow fail hone par logs padhkar claude-auto-fix-ci branch par fix PR kholta hai. PR comment mein @claude fix ... bhi likh sakte ho. Fix bhi CI aur human approval se guzarta hai, auto-merge kabhi nahi.
- Security: gitleaks/gitleaks-action@v3, CodeQL default setup (Settings > Advanced Security), .github/dependabot.yml mein weekly grouped minor aur patch updates, ya Renovate.
- Gate: Settings > Rules > Rulesets: PR zaroori, 1 approval, required status checks, branch up to date. .github/CODEOWNERS se sahi reviewer khud assign hota hai. GitLab: Pipelines must succeed. Bitbucket: merge checks.
- Rollout: har hafte ek layer. Week 1 hooks + CI, week 2 AI review + rules file, week 3 auto-fix + security, week 4 gate lock.
npm install --save-dev lefthookpip install pre-commit && pre-commit installclaude then /install-github-appuses: anthropics/claude-code-action@v1uses: gitleaks/gitleaks-action@v3claude -p "Review this diff for bugs" --output-format jsonSources
Claude Code docs, claude-code-action repo, Lefthook, pre-commit, gitleaks, GitHub, GitLab aur Bitbucket docs; 8 Nov 2026 ko check kiya.
howitworks