Skip to content

Commit d0a6f0f

Browse files
authored
Merge pull request #12 from WildMeOrg/docs/ci-review-loop-realign
docs: realign CI review loop to actual fork integrations
2 parents b4517f7 + 5819fc1 commit d0a6f0f

1 file changed

Lines changed: 56 additions & 17 deletions

File tree

CLAUDE.md

Lines changed: 56 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,65 @@ When asked to push code, follow this full workflow:
2323
0. ensure that you are on a branch that is specific to this change i.e feat/new-feature or fix/bug-fix or docs/update-readme or chore/update-dependencies, or test/new-test, etc
2424
1. Push the branch to the remote (`git push -u origin <branch>`)
2525
2. Create a PR using `gh pr create`. Ensure that you are adhering to the PR template. **Do NOT include "Generated with Claude Code" or any AI attribution in PR descriptions.**
26-
3. Wait for Gemini to review the PR (poll with `gh pr checks` and `gh api repos/{owner}/{repo}/pulls/{number}/reviews` until a review appears)
27-
4. Once a review exists, pull down the review comments: `gh api repos/{owner}/{repo}/pulls/{number}/comments` and `gh api repos/{owner}/{repo}/pulls/{number}/reviews`
28-
5. Address every review comment — fix the code, re-run the quality gates (tests, lint, tsc). Resolve the comment appropriately and post that on the PR directly.
29-
6. Push the fixes
30-
7. Report what was changed in response to the review
26+
3. Wait for GitHub Actions CI to start. Poll with `gh pr checks {number}` (or `gh pr checks` from the PR's branch) until all four jobs (`typecheck`, `test`, `lint`, `android-build`) report a status. If any fail, fix and re-push before reading reviewer comments.
27+
4. Once CI is green, wait for Gemini to post (`gh api repos/{owner}/{repo}/pulls/{number}/comments` + `.../reviews`).
28+
5. Address every Gemini review comment — fix the code, or reply on the thread explaining why it's fine. Resolve the conversation either way.
29+
6. Push the fixes; pre-commit gates re-run. Comment `/gemini review` to re-trigger Gemini.
30+
7. Loop until CI is green and Gemini has nothing blocking.
31+
8. Report what was changed in response to the review.
3132

3233
## CI Review Loop
3334

34-
The repo has three automated reviewers on every PR. After pushing, loop until all are green:
35+
After pushing, loop until everything below is green or addressed.
3536

36-
| Reviewer | What it checks | How to address |
37-
|---|---|---|
38-
| **Gemini Bot** | Code quality, style, logic issues | Read comments via `gh api`, fix code or reply explaining why it's fine, then comment `/gemini review` to trigger a fresh pass |
39-
| **Codecov** | Test coverage thresholds | Add missing tests, ensure new code is covered. Check the Codecov report for uncovered lines |
40-
| **SonarCloud** | Security hotspots, code smells, duplications, bugs | Fix flagged issues — especially security hotspots and duplications. Resolve quality gate failures before merging |
37+
### GitHub Actions CI (merge-blocking)
38+
39+
The `CI` workflow runs four jobs on every push and PR targeting `main` or `wildlife-reid`:
40+
41+
| Job | What it checks |
42+
|---|---|
43+
| `typecheck` | `tsc --noEmit` |
44+
| `test` | Jest unit + integration tests with coverage |
45+
| `lint` | ESLint + `gradlew :app:lintDebug` + SwiftLint |
46+
| `android-build` | Full debug Gradle build |
47+
48+
If any job fails, fix locally and push. Per-job mirror commands:
49+
50+
| CI job | Local equivalent |
51+
|---|---|
52+
| `typecheck` | `npx tsc --noEmit` |
53+
| `test` | `npx jest --coverage --forceExit` (just the JS suite — `npm test` also chains Android + iOS, which is slower and platform-locked) |
54+
| `lint` | `npm run lint` (ESLint + Android lint + SwiftLint) |
55+
| `android-build` | `cd android && ./gradlew :app:assembleDebug` (heavy; usually fine to let CI catch it) |
56+
57+
### Gemini Code Assist (advisory)
58+
59+
Auto-reviews every PR on open and on `/gemini review`. Posts a summary comment plus line-level review comments tagged by severity.
4160

4261
**Workflow:**
43-
1. Push code → wait for all three reviewers to report
44-
2. Pull down Gemini comments, Codecov report, and SonarCloud findings
45-
3. Fix issues: code changes for Gemini/SonarCloud, add tests for Codecov
46-
4. Re-run local quality gates (`npm run lint && npm test && npx tsc --noEmit`)
47-
5. Push fixes, comment `/gemini review` on the PR to re-trigger Gemini
48-
6. Repeat until all three reviewers pass with no blocking issues
62+
1. Push → wait for the Gemini summary + comments to land (~1-2 min after PR open or `/gemini review`).
63+
2. Pull down comments: `gh api repos/{owner}/{repo}/pulls/{number}/comments` and `.../reviews`.
64+
3. Address every comment — fix the code, or reply on the comment thread explaining why it's a non-issue. Resolve the conversation.
65+
4. Re-run pre-commit gates locally, push fixes.
66+
5. Comment `/gemini review` on the PR to trigger a fresh pass.
67+
6. Repeat until Gemini's findings are addressed.
68+
69+
Gemini findings are advisory — they don't block merge themselves, but unaddressed legitimate findings should block merge in human review.
70+
71+
### Codex 5.5 (on-demand second opinion)
72+
73+
Use for scoped deep reviews when warranted (foundational PRs, risky refactors, pre-merge sanity passes). Not part of the routine PR loop.
74+
75+
```bash
76+
codex exec -s read-only --skip-git-repo-check "<scoped review prompt>"
77+
```
78+
79+
File substantive findings to `kb/wildlife-reid-mobile/outputs/reports/`.
80+
81+
### Human review (final gate)
82+
83+
Final approval required before merging into `wildlife-reid` or `main`.
84+
85+
### Not currently installed
86+
87+
Codecov and SonarCloud are referenced in some upstream docs but are **not** wired up on this fork. If reinstated later, document them here. CodeQL (free, one-click at `Settings → Code security`) is a reasonable alternative if SAST is desired.

0 commit comments

Comments
 (0)