ira-review 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.github.md +287 -52
- package/README.md +46 -43
- package/README.npm.md +46 -43
- package/dist/bitbucket-E3MONFK5.js +8 -0
- package/dist/chunk-LOM46ZUL.js +250 -0
- package/dist/chunk-P7ZBC4ST.js +195 -0
- package/dist/chunk-WGON3I4J.js +98 -0
- package/dist/cli.js +636 -450
- package/dist/github-7UAV3HAA.js +8 -0
- package/dist/index.cjs +559 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +94 -29
- package/dist/index.d.ts +94 -29
- package/dist/index.js +557 -22
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/README.github.md
CHANGED
|
@@ -1,72 +1,199 @@
|
|
|
1
|
-
# IRA
|
|
1
|
+
# IRA - AI-Powered Code Reviews for Pull Requests
|
|
2
2
|
|
|
3
|
-
IRA (Intelligent Review Assistant) reviews your pull requests using AI. It posts inline comments with explanations, impact assessments, and suggested fixes
|
|
3
|
+
IRA (Intelligent Review Assistant) reviews your pull requests using AI. It posts inline comments with explanations, impact assessments, and suggested fixes directly on your PR.
|
|
4
4
|
|
|
5
|
-
**Works with any language.** Supports GitHub and Bitbucket
|
|
5
|
+
**Works with any language.** Supports GitHub and Bitbucket Cloud.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## What can IRA do?
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
- **Review your code** using AI and post inline comments with explanation, impact, and fix
|
|
10
|
+
- **Score PR risk** from 0 to 100 and auto-label your PRs on GitHub
|
|
11
|
+
- **Track requirement completion** against JIRA acceptance criteria with percentage and per-criterion status
|
|
12
|
+
- **Generate test cases** from JIRA tickets in 8 frameworks (Jest, Vitest, Mocha, Playwright, Cypress, Gherkin, Pytest, JUnit)
|
|
13
|
+
- **Enrich SonarQube issues** with AI-powered explanations when Sonar is connected
|
|
14
|
+
- **Notify your team** via Slack or Microsoft Teams after each review
|
|
11
15
|
|
|
12
|
-
## Try it
|
|
16
|
+
## Try it in 30 seconds
|
|
13
17
|
|
|
14
18
|
```bash
|
|
15
|
-
export IRA_AI_API_KEY=your-key-here
|
|
16
|
-
|
|
17
19
|
npx ira-review review \
|
|
18
20
|
--pr 42 \
|
|
19
21
|
--scm-provider github \
|
|
20
|
-
--github-token ghp_xxxxx \
|
|
22
|
+
--github-token 'ghp_xxxxx' \
|
|
21
23
|
--github-repo owner/repo \
|
|
24
|
+
--ai-api-key 'sk-xxxxx' \
|
|
22
25
|
--dry-run
|
|
23
26
|
```
|
|
24
27
|
|
|
25
|
-
Drop `--dry-run` to post
|
|
28
|
+
This prints the review in your terminal. Drop `--dry-run` to post it on the PR.
|
|
26
29
|
|
|
27
30
|
## Install
|
|
28
31
|
|
|
29
32
|
```bash
|
|
30
|
-
npx ira-review review --
|
|
31
|
-
npm install -g ira-review
|
|
32
|
-
npm install --save-dev ira-review
|
|
33
|
+
npx ira-review review --help # no install needed
|
|
34
|
+
npm install -g ira-review # or install globally
|
|
35
|
+
npm install --save-dev ira-review # or add to your project
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## How to use IRA
|
|
39
|
+
|
|
40
|
+
Pick the combination that fits your workflow. Each example builds on the previous one.
|
|
41
|
+
|
|
42
|
+
### 1. AI-only review
|
|
43
|
+
|
|
44
|
+
The simplest setup. IRA reads your PR diff and finds bugs, security issues, and performance problems.
|
|
45
|
+
|
|
46
|
+
**GitHub:**
|
|
47
|
+
```bash
|
|
48
|
+
npx ira-review review \
|
|
49
|
+
--pr 42 \
|
|
50
|
+
--scm-provider github \
|
|
51
|
+
--github-token 'ghp_xxxxx' \
|
|
52
|
+
--github-repo owner/repo \
|
|
53
|
+
--ai-api-key 'sk-xxxxx'
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Bitbucket Cloud:**
|
|
57
|
+
```bash
|
|
58
|
+
npx ira-review review \
|
|
59
|
+
--pr 42 \
|
|
60
|
+
--bitbucket-token 'bb_xxxxx' \
|
|
61
|
+
--repo my-workspace/my-repo \
|
|
62
|
+
--ai-api-key 'sk-xxxxx'
|
|
33
63
|
```
|
|
34
64
|
|
|
35
|
-
|
|
65
|
+
### 2. Review with JIRA (requirement tracking + AC validation)
|
|
36
66
|
|
|
37
|
-
|
|
67
|
+
Connect a JIRA ticket and IRA will tell you how much of the acceptance criteria is actually implemented, with per-criterion pass/fail and edge case warnings.
|
|
38
68
|
|
|
39
69
|
```bash
|
|
40
70
|
npx ira-review review \
|
|
41
71
|
--pr 42 \
|
|
42
72
|
--scm-provider github \
|
|
43
|
-
--github-token ghp_xxxxx \
|
|
44
|
-
--github-repo owner/repo
|
|
73
|
+
--github-token 'ghp_xxxxx' \
|
|
74
|
+
--github-repo owner/repo \
|
|
75
|
+
--ai-api-key 'sk-xxxxx' \
|
|
76
|
+
--jira-url https://yourcompany.atlassian.net \
|
|
77
|
+
--jira-email you@company.com \
|
|
78
|
+
--jira-token 'jira_xxxxx' \
|
|
79
|
+
--jira-ticket AUTH-234
|
|
45
80
|
```
|
|
46
81
|
|
|
47
|
-
|
|
82
|
+
Example output posted on your PR:
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
📊 Requirements: AUTH-234 - 67% Complete (4/6 AC met)
|
|
86
|
+
|
|
87
|
+
✅ OAuth2 login flow implemented with Google provider
|
|
88
|
+
✅ JWT tokens generated on successful authentication
|
|
89
|
+
✅ Refresh token rotation with 7-day expiry
|
|
90
|
+
❌ Input validation on login endpoint - no email format check
|
|
91
|
+
✅ Logout endpoint clears session and revokes token
|
|
92
|
+
❌ Rate limiting on login attempts - not implemented
|
|
93
|
+
|
|
94
|
+
⚠️ Edge Cases Not Covered:
|
|
95
|
+
- What happens when Google OAuth is unreachable?
|
|
96
|
+
- Token refresh during concurrent requests?
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### 3. Review with JIRA + test generation
|
|
100
|
+
|
|
101
|
+
Add `--generate-tests` to any review command and IRA will generate test scaffolding alongside the code review.
|
|
48
102
|
|
|
49
103
|
```bash
|
|
50
104
|
npx ira-review review \
|
|
51
105
|
--pr 42 \
|
|
106
|
+
--scm-provider github \
|
|
107
|
+
--github-token 'ghp_xxxxx' \
|
|
108
|
+
--github-repo owner/repo \
|
|
109
|
+
--ai-api-key 'sk-xxxxx' \
|
|
110
|
+
--jira-url https://yourcompany.atlassian.net \
|
|
111
|
+
--jira-email you@company.com \
|
|
112
|
+
--jira-token 'jira_xxxxx' \
|
|
113
|
+
--jira-ticket AUTH-234 \
|
|
114
|
+
--generate-tests \
|
|
115
|
+
--test-framework vitest
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### 4. Standalone test generation (no review)
|
|
119
|
+
|
|
120
|
+
Don't need a review? Generate test cases directly from a JIRA ticket.
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
npx ira-review generate-tests \
|
|
124
|
+
--jira-ticket AUTH-234 \
|
|
125
|
+
--jira-url https://yourcompany.atlassian.net \
|
|
126
|
+
--jira-email you@company.com \
|
|
127
|
+
--jira-token 'jira_xxxxx' \
|
|
128
|
+
--ai-api-key 'sk-xxxxx' \
|
|
129
|
+
--test-framework playwright
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Add `--pr 42 --scm-provider github --github-repo owner/repo` to include code context from a PR for higher precision.
|
|
133
|
+
|
|
134
|
+
Add `--output tests/auth.test.ts` to save the generated tests to a file.
|
|
135
|
+
|
|
136
|
+
### 5. Sonar + AI review
|
|
137
|
+
|
|
138
|
+
Already using SonarQube? IRA pulls your Sonar issues and enriches each one with AI explanations and suggested fixes.
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
npx ira-review review \
|
|
142
|
+
--pr 42 \
|
|
143
|
+
--scm-provider github \
|
|
144
|
+
--github-token 'ghp_xxxxx' \
|
|
145
|
+
--github-repo owner/repo \
|
|
146
|
+
--ai-api-key 'sk-xxxxx' \
|
|
52
147
|
--sonar-url https://sonarcloud.io \
|
|
53
|
-
--sonar-token sqa_xxxxx \
|
|
54
|
-
--project-key my-org_my-project
|
|
55
|
-
--bitbucket-token bb_xxxxx \
|
|
56
|
-
--repo my-workspace/my-repo
|
|
148
|
+
--sonar-token 'sqa_xxxxx' \
|
|
149
|
+
--project-key my-org_my-project
|
|
57
150
|
```
|
|
58
151
|
|
|
59
|
-
|
|
152
|
+
You can combine this with JIRA, test generation, and notifications too.
|
|
153
|
+
|
|
154
|
+
## Quick reference
|
|
155
|
+
|
|
156
|
+
| What you want | What to add | Example |
|
|
157
|
+
|---|---|---|
|
|
158
|
+
| AI-only review | `--pr`, SCM token, `--ai-api-key` | `npx ira-review review --pr 42 --scm-provider github --github-token ghp_xxx --github-repo owner/repo --ai-api-key sk-xxx` |
|
|
159
|
+
| + SonarQube | `--sonar-url`, `--sonar-token`, `--project-key` | `... --sonar-url https://sonarcloud.io --sonar-token sqa_xxx --project-key my-org_my-project` |
|
|
160
|
+
| + JIRA validation | `--jira-url`, `--jira-email`, `--jira-token`, `--jira-ticket` | `... --jira-url https://acme.atlassian.net --jira-email dev@acme.com --jira-token xxx --jira-ticket AUTH-234` |
|
|
161
|
+
| + Test generation | `--generate-tests`, `--test-framework` | `... --generate-tests --test-framework vitest` |
|
|
162
|
+
| + Slack notifications | `--slack-webhook` | `... --slack-webhook https://hooks.slack.com/services/xxx` |
|
|
163
|
+
| + Teams notifications | `--teams-webhook` | `... --teams-webhook https://outlook.office.com/webhook/xxx` |
|
|
164
|
+
| Notify only high risk | `--notify-min-risk` | `... --slack-webhook https://hooks.slack.com/xxx --notify-min-risk high` (only HIGH and CRITICAL trigger a notification) |
|
|
165
|
+
| Notify on AC failure | `--notify-on-ac-fail` | `... --slack-webhook https://hooks.slack.com/xxx --notify-on-ac-fail` (notify when JIRA acceptance criteria fail, regardless of risk) |
|
|
166
|
+
| Risk labels | Automatic on GitHub | Labels like `ira:critical`, `ira:high`, `ira:medium`, `ira:low` are applied automatically |
|
|
167
|
+
| Preview in terminal | `--dry-run` | `... --dry-run` (prints output, doesn't post on PR) |
|
|
168
|
+
| Use Anthropic | `--ai-provider anthropic` | `... --ai-provider anthropic --ai-api-key sk-ant-xxx` |
|
|
169
|
+
| Use Ollama (free) | `--ai-provider ollama` | `... --ai-provider ollama` (no API key needed) |
|
|
170
|
+
| Save on AI costs | `--ai-model` + `--ai-model-critical` | `... --ai-model gpt-4o-mini --ai-model-critical gpt-4o` |
|
|
171
|
+
| Generate tests only | `generate-tests` command | `npx ira-review generate-tests --jira-ticket AUTH-234 --test-framework jest --ai-api-key sk-xxx` |
|
|
172
|
+
| Save tests to file | `--output` | `... generate-tests --jira-ticket AUTH-234 --test-framework vitest --output tests/auth.test.ts` |
|
|
173
|
+
|
|
174
|
+
## Supported test frameworks
|
|
175
|
+
|
|
176
|
+
| Framework | Language | Style |
|
|
177
|
+
|---|---|---|
|
|
178
|
+
| `jest` | JavaScript/TypeScript | `describe` / `it` / `expect` |
|
|
179
|
+
| `vitest` | JavaScript/TypeScript | `describe` / `it` / `expect` |
|
|
180
|
+
| `mocha` | JavaScript/TypeScript | `describe` / `it` + Chai |
|
|
181
|
+
| `playwright` | TypeScript | `test` / `page` / E2E |
|
|
182
|
+
| `cypress` | JavaScript | `cy.visit` / `cy.get` / E2E |
|
|
183
|
+
| `gherkin` | Any (BDD) | `Given` / `When` / `Then` |
|
|
184
|
+
| `pytest` | Python | `def test_` / `assert` |
|
|
185
|
+
| `junit` | Java/Kotlin | `@Test` / `assertEquals` |
|
|
186
|
+
|
|
187
|
+
## AI providers
|
|
60
188
|
|
|
61
189
|
| Provider | Flag | Notes |
|
|
62
190
|
|---|---|---|
|
|
63
|
-
| **OpenAI** (default) | `--ai-provider openai` |
|
|
191
|
+
| **OpenAI** (default) | `--ai-provider openai` | Pass key with `--ai-api-key` or set `IRA_AI_API_KEY` |
|
|
64
192
|
| **Azure OpenAI** | `--ai-provider azure-openai` | Also needs `--ai-base-url` and `--ai-deployment` |
|
|
65
|
-
| **Anthropic** | `--ai-provider anthropic` |
|
|
66
|
-
| **
|
|
67
|
-
| **Ollama** (local) | `--ai-provider ollama` | No API key needed |
|
|
193
|
+
| **Anthropic** | `--ai-provider anthropic` | Pass key with `--ai-api-key` or set `IRA_AI_API_KEY` |
|
|
194
|
+
| **Ollama** (local) | `--ai-provider ollama` | Runs locally, no API key needed |
|
|
68
195
|
|
|
69
|
-
> **Tip:** Use `--ai-model-critical gpt-4o`
|
|
196
|
+
> **Tip:** Use `--ai-model gpt-4o-mini` for most issues and `--ai-model-critical gpt-4o` for blockers. This keeps costs low without sacrificing quality on critical findings.
|
|
70
197
|
|
|
71
198
|
## CI/CD setup
|
|
72
199
|
|
|
@@ -85,16 +212,26 @@ jobs:
|
|
|
85
212
|
- uses: actions/setup-node@v4
|
|
86
213
|
with:
|
|
87
214
|
node-version: 20
|
|
88
|
-
- run:
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
215
|
+
- run: |
|
|
216
|
+
npx ira-review review \
|
|
217
|
+
--pr ${{ github.event.pull_request.number }} \
|
|
218
|
+
--scm-provider github \
|
|
219
|
+
--github-token ${{ secrets.GITHUB_TOKEN }} \
|
|
220
|
+
--github-repo ${{ github.repository }} \
|
|
221
|
+
--no-config-file
|
|
94
222
|
env:
|
|
95
223
|
IRA_AI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
96
224
|
```
|
|
97
225
|
|
|
226
|
+
Want JIRA validation in CI? Add these flags to the run command:
|
|
227
|
+
|
|
228
|
+
```
|
|
229
|
+
--jira-url ${{ vars.JIRA_URL }} \
|
|
230
|
+
--jira-email ${{ vars.JIRA_EMAIL }} \
|
|
231
|
+
--jira-token ${{ secrets.JIRA_TOKEN }} \
|
|
232
|
+
--jira-ticket AUTH-234
|
|
233
|
+
```
|
|
234
|
+
|
|
98
235
|
### Bitbucket Pipelines
|
|
99
236
|
|
|
100
237
|
```yaml
|
|
@@ -113,16 +250,121 @@ pipelines:
|
|
|
113
250
|
IRA_BITBUCKET_TOKEN: $BB_TOKEN
|
|
114
251
|
```
|
|
115
252
|
|
|
116
|
-
>
|
|
253
|
+
> Use `--no-config-file` in CI pipelines that run on untrusted PRs (forks, external contributors).
|
|
254
|
+
|
|
255
|
+
## Smart notifications
|
|
117
256
|
|
|
118
|
-
|
|
257
|
+
By default, IRA sends a Slack or Teams notification after every review. You can control exactly when notifications fire so your team only hears about what matters.
|
|
119
258
|
|
|
120
|
-
|
|
259
|
+
### How it works
|
|
260
|
+
|
|
261
|
+
| Setup | What happens | Best for |
|
|
262
|
+
|---|---|---|
|
|
263
|
+
| No flags set | Every review triggers a notification | Small teams that want full visibility |
|
|
264
|
+
| `--notify-min-risk high` | Only HIGH (40+) and CRITICAL (60+) PRs trigger notifications. LOW and MEDIUM stay silent | Reducing noise, focusing on risky PRs |
|
|
265
|
+
| `--notify-min-risk high --notify-on-ac-fail` | Notifies on HIGH/CRITICAL risk **or** when JIRA acceptance criteria fail, even on low risk PRs | **Recommended for tech leads.** Catches both risky code and incomplete requirements |
|
|
266
|
+
| `--notify-on-ac-fail` alone | Every review still triggers a notification (no risk filter), but AC failures are guaranteed to notify | Teams that want full visibility but never want to miss an AC failure |
|
|
267
|
+
|
|
268
|
+
### Example: only ping on high risk PRs
|
|
269
|
+
|
|
270
|
+
```bash
|
|
271
|
+
npx ira-review review \
|
|
272
|
+
--pr 42 \
|
|
273
|
+
--scm-provider github \
|
|
274
|
+
--github-token 'ghp_xxxxx' \
|
|
275
|
+
--github-repo owner/repo \
|
|
276
|
+
--ai-api-key 'sk-xxxxx' \
|
|
277
|
+
--slack-webhook 'https://hooks.slack.com/services/xxx' \
|
|
278
|
+
--notify-min-risk high
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
Your `#code-reviews` channel only gets pinged for HIGH and CRITICAL PRs. Everything else reviews silently.
|
|
282
|
+
|
|
283
|
+
### Example: catch risky PRs and incomplete requirements
|
|
284
|
+
|
|
285
|
+
```bash
|
|
286
|
+
--notify-min-risk high --notify-on-ac-fail
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
Tech leads get notified for two things: risky PRs and PRs that don't fully implement the JIRA requirements. Low risk, well-implemented PRs stay quiet.
|
|
290
|
+
|
|
291
|
+
### What triggers a notification?
|
|
292
|
+
|
|
293
|
+
Here's exactly when your Slack or Teams channel gets a message:
|
|
294
|
+
|
|
295
|
+
| PR risk | AC status | No flags | `--notify-min-risk high` | `+ --notify-on-ac-fail` |
|
|
296
|
+
|---|---|---|---|---|
|
|
297
|
+
| LOW (5) | AC passes | ✅ Notified | Silent | Silent |
|
|
298
|
+
| LOW (12) | AC fails | ✅ Notified | Silent | ✅ Notified |
|
|
299
|
+
| MEDIUM (25) | AC passes | ✅ Notified | Silent | Silent |
|
|
300
|
+
| HIGH (45) | AC passes | ✅ Notified | ✅ Notified | ✅ Notified |
|
|
301
|
+
| CRITICAL (72) | AC fails | ✅ Notified | ✅ Notified | ✅ Notified |
|
|
302
|
+
|
|
303
|
+
### Configuration
|
|
304
|
+
|
|
305
|
+
All three ways to set this up:
|
|
306
|
+
|
|
307
|
+
```bash
|
|
308
|
+
# CLI flags
|
|
309
|
+
--notify-min-risk high --notify-on-ac-fail
|
|
310
|
+
|
|
311
|
+
# Environment variables (works in CI)
|
|
312
|
+
IRA_NOTIFY_MIN_RISK=high
|
|
313
|
+
IRA_NOTIFY_ON_AC_FAIL=true
|
|
314
|
+
|
|
315
|
+
# Config file (.irarc.json)
|
|
316
|
+
{ "notifyMinRisk": "high", "notifyOnAcFail": true }
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
## PR risk visibility
|
|
320
|
+
|
|
321
|
+
IRA makes risk visible directly in your PR list so tech leads can prioritize without opening each PR.
|
|
322
|
+
|
|
323
|
+
### GitHub: risk labels
|
|
324
|
+
|
|
325
|
+
IRA applies color-coded labels to your PRs after each review:
|
|
326
|
+
|
|
327
|
+
| Label | Score | Color |
|
|
121
328
|
|---|---|---|
|
|
122
|
-
|
|
|
123
|
-
|
|
|
124
|
-
|
|
|
125
|
-
|
|
|
329
|
+
| `ira:critical` | 60 to 100 | 🔴 Red |
|
|
330
|
+
| `ira:high` | 40 to 59 | 🟠 Orange |
|
|
331
|
+
| `ira:medium` | 20 to 39 | 🟡 Yellow |
|
|
332
|
+
| `ira:low` | 0 to 19 | 🟢 Green |
|
|
333
|
+
|
|
334
|
+
Labels update automatically when risk changes. Filter your PR list with `label:ira:critical label:ira:high` to prioritize reviews.
|
|
335
|
+
|
|
336
|
+
### Bitbucket: build status
|
|
337
|
+
|
|
338
|
+
Bitbucket doesn't support PR labels, so IRA posts a **build status** on the PR commit instead. This shows as a status icon (✅ ❌ 🟡) in the PR list.
|
|
339
|
+
|
|
340
|
+
| Risk level | Build status | Icon in PR list |
|
|
341
|
+
|---|---|---|
|
|
342
|
+
| CRITICAL | FAILED | 🔴 Red X |
|
|
343
|
+
| HIGH | FAILED | 🔴 Red X |
|
|
344
|
+
| MEDIUM | INPROGRESS | 🟡 Yellow dot |
|
|
345
|
+
| LOW | SUCCESSFUL | 🟢 Green check |
|
|
346
|
+
|
|
347
|
+
Hover over the icon to see the full risk score. You can also configure Bitbucket branch permissions to **block merging** when the IRA Risk status is FAILED, preventing high-risk PRs from being merged without review.
|
|
348
|
+
|
|
349
|
+
## What IRA posts on your PR
|
|
350
|
+
|
|
351
|
+
**Inline comments** on the exact lines:
|
|
352
|
+
|
|
353
|
+
```
|
|
354
|
+
🔍 IRA Review - ai/security (CRITICAL)
|
|
355
|
+
|
|
356
|
+
> User input used directly in SQL query without sanitization.
|
|
357
|
+
|
|
358
|
+
Explanation: The username parameter is concatenated into a SQL string,
|
|
359
|
+
creating a SQL injection vector.
|
|
360
|
+
|
|
361
|
+
Impact: Attacker could execute arbitrary SQL and gain database control.
|
|
362
|
+
|
|
363
|
+
Suggested Fix: Use parameterized queries:
|
|
364
|
+
db.query('SELECT * FROM users WHERE name = $1', [username])
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
**Summary comment** with risk score, issue breakdown, requirement completion (if JIRA is connected), and complexity hotspots (if Sonar is connected).
|
|
126
368
|
|
|
127
369
|
## Config file
|
|
128
370
|
|
|
@@ -139,17 +381,12 @@ Create `.irarc.json` in your project root to set defaults:
|
|
|
139
381
|
|
|
140
382
|
CLI flags override env vars, which override the config file. Tokens and keys are blocked from config files for security.
|
|
141
383
|
|
|
142
|
-
## What IRA posts
|
|
143
|
-
|
|
144
|
-
- **Inline comments** on the exact lines with explanation, impact, and suggested fix.
|
|
145
|
-
- **Summary comment** with a risk score (0–100), issue breakdown, and complexity hotspots.
|
|
146
|
-
|
|
147
384
|
## Security
|
|
148
385
|
|
|
149
|
-
- Runs in your CI
|
|
386
|
+
- Runs in your CI. Tokens never leave your infrastructure
|
|
150
387
|
- No telemetry, analytics, or tracking
|
|
151
388
|
- Config files block sensitive fields automatically
|
|
152
|
-
- Open source
|
|
389
|
+
- Open source. Every line is auditable
|
|
153
390
|
|
|
154
391
|
## Requirements
|
|
155
392
|
|
|
@@ -159,8 +396,6 @@ CLI flags override env vars, which override the config file. Tokens and keys are
|
|
|
159
396
|
|
|
160
397
|
## License
|
|
161
398
|
|
|
162
|
-
[AGPL-3.0](LICENSE)
|
|
163
|
-
|
|
164
|
-
---
|
|
399
|
+
[AGPL-3.0](LICENSE). For commercial licensing, contact [patilmayur5572@gmail.com](mailto:patilmayur5572@gmail.com).
|
|
165
400
|
|
|
166
401
|
📖 **Full CLI reference:** Run `npx ira-review review --help`
|
package/README.md
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
# IRA
|
|
1
|
+
# IRA - AI-Powered Code Reviews for Pull Requests
|
|
2
2
|
|
|
3
3
|
IRA reviews your pull requests using AI and posts inline comments with explanations, impact assessments, and suggested fixes.
|
|
4
4
|
|
|
5
|
-
**Works with any language.** Supports GitHub and Bitbucket.
|
|
5
|
+
**Works with any language.** Supports GitHub and Bitbucket Cloud.
|
|
6
6
|
|
|
7
7
|
## Try it now
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
export IRA_AI_API_KEY=your-key-here
|
|
11
|
-
|
|
12
10
|
npx ira-review review \
|
|
13
11
|
--pr 42 \
|
|
14
12
|
--scm-provider github \
|
|
15
|
-
--github-token ghp_xxxxx \
|
|
13
|
+
--github-token 'ghp_xxxxx' \
|
|
16
14
|
--github-repo owner/repo \
|
|
15
|
+
--ai-api-key 'sk-xxxxx' \
|
|
17
16
|
--dry-run
|
|
18
17
|
```
|
|
19
18
|
|
|
@@ -22,36 +21,41 @@ Drop `--dry-run` to post comments on the PR.
|
|
|
22
21
|
## Install
|
|
23
22
|
|
|
24
23
|
```bash
|
|
25
|
-
npx ira-review review --
|
|
26
|
-
npm install -g ira-review
|
|
27
|
-
npm install --save-dev ira-review
|
|
24
|
+
npx ira-review review --help # no install needed
|
|
25
|
+
npm install -g ira-review # or install globally
|
|
26
|
+
npm install --save-dev ira-review # or add to your project
|
|
28
27
|
```
|
|
29
28
|
|
|
30
|
-
##
|
|
31
|
-
|
|
32
|
-
1. **AI-only** — finds bugs, security issues, and performance problems in your PR diff.
|
|
33
|
-
2. **Sonar + AI** — pulls SonarQube issues and enriches them with AI explanations and fixes.
|
|
34
|
-
|
|
35
|
-
## AI providers
|
|
36
|
-
|
|
37
|
-
| Provider | Flag |
|
|
38
|
-
|---|---|
|
|
39
|
-
| **OpenAI** (default) | `--ai-provider openai` |
|
|
40
|
-
| **Azure OpenAI** | `--ai-provider azure-openai` |
|
|
41
|
-
| **Anthropic** | `--ai-provider anthropic` |
|
|
42
|
-
| **Google Gemini** | `--ai-provider gemini` |
|
|
43
|
-
| **Ollama** (local, no key) | `--ai-provider ollama` |
|
|
44
|
-
|
|
45
|
-
## Key features
|
|
29
|
+
## What can IRA do?
|
|
46
30
|
|
|
47
31
|
- **Inline PR comments** with explanation, impact, and suggested fix
|
|
48
|
-
- **Risk scoring** (0
|
|
49
|
-
- **
|
|
50
|
-
- **
|
|
51
|
-
- **
|
|
52
|
-
- **
|
|
53
|
-
|
|
54
|
-
|
|
32
|
+
- **Risk scoring** (0 to 100) based on blockers, security, complexity, and more
|
|
33
|
+
- **Risk labels** on GitHub PRs (`ira:critical` / `ira:high` / `ira:medium` / `ira:low`)
|
|
34
|
+
- **Requirement tracking** shows % completion of JIRA acceptance criteria per PR
|
|
35
|
+
- **Test case generation** from JIRA AC in 8 frameworks: Jest, Vitest, Mocha, Playwright, Cypress, Gherkin, Pytest, JUnit
|
|
36
|
+
- **Framework detection** tailors suggestions for React, Angular, Vue, NestJS
|
|
37
|
+
- **Comment deduplication** so re-runs skip already-commented issues
|
|
38
|
+
- **Smart notifications** via Slack and Teams with risk threshold filtering (`--notify-min-risk high --notify-on-ac-fail`)
|
|
39
|
+
- **CI-ready** works with GitHub Actions, Bitbucket Pipelines, or any CI
|
|
40
|
+
|
|
41
|
+
## Quick reference
|
|
42
|
+
|
|
43
|
+
| What you want | What to add | Example |
|
|
44
|
+
|---|---|---|
|
|
45
|
+
| AI-only review | `--pr`, SCM token, `--ai-api-key` | `npx ira-review review --pr 42 --scm-provider github --github-token ghp_xxx --github-repo owner/repo --ai-api-key sk-xxx` |
|
|
46
|
+
| + SonarQube | `--sonar-url`, `--sonar-token`, `--project-key` | `... --sonar-url https://sonarcloud.io --sonar-token sqa_xxx --project-key my-org_my-project` |
|
|
47
|
+
| + JIRA validation | `--jira-url`, `--jira-email`, `--jira-token`, `--jira-ticket` | `... --jira-url https://acme.atlassian.net --jira-email dev@acme.com --jira-token xxx --jira-ticket AUTH-234` |
|
|
48
|
+
| + Test generation | `--generate-tests`, `--test-framework` | `... --generate-tests --test-framework vitest` |
|
|
49
|
+
| + Notifications | `--slack-webhook` or `--teams-webhook` | `... --slack-webhook https://hooks.slack.com/services/xxx` |
|
|
50
|
+
| Notify only high risk | `--notify-min-risk` | `... --notify-min-risk high` (only HIGH and CRITICAL trigger a notification) |
|
|
51
|
+
| Notify on AC failure | `--notify-on-ac-fail` | `... --notify-on-ac-fail` (notify when JIRA AC fails, regardless of risk) |
|
|
52
|
+
| Risk labels | Automatic on GitHub | `ira:critical`, `ira:high`, `ira:medium`, `ira:low` applied automatically |
|
|
53
|
+
| Preview only | `--dry-run` | `... --dry-run` (prints to terminal, doesn't post on PR) |
|
|
54
|
+
| Use Anthropic | `--ai-provider anthropic` | `... --ai-provider anthropic --ai-api-key sk-ant-xxx` |
|
|
55
|
+
| Use Ollama (free) | `--ai-provider ollama` | `... --ai-provider ollama` (no API key needed) |
|
|
56
|
+
| Generate tests only | `generate-tests` command | `npx ira-review generate-tests --jira-ticket AUTH-234 --test-framework jest --ai-api-key sk-xxx` |
|
|
57
|
+
|
|
58
|
+
## GitHub Actions setup
|
|
55
59
|
|
|
56
60
|
```yaml
|
|
57
61
|
name: AI Code Review
|
|
@@ -66,12 +70,13 @@ jobs:
|
|
|
66
70
|
- uses: actions/setup-node@v4
|
|
67
71
|
with:
|
|
68
72
|
node-version: 20
|
|
69
|
-
- run:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
- run: |
|
|
74
|
+
npx ira-review review \
|
|
75
|
+
--pr ${{ github.event.pull_request.number }} \
|
|
76
|
+
--scm-provider github \
|
|
77
|
+
--github-token ${{ secrets.GITHUB_TOKEN }} \
|
|
78
|
+
--github-repo ${{ github.repository }} \
|
|
79
|
+
--no-config-file
|
|
75
80
|
env:
|
|
76
81
|
IRA_AI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
77
82
|
```
|
|
@@ -93,9 +98,9 @@ CLI flags > env vars > config file. Tokens and keys are blocked from config file
|
|
|
93
98
|
|
|
94
99
|
## Security
|
|
95
100
|
|
|
96
|
-
- Runs in your CI
|
|
101
|
+
- Runs in your CI. Tokens never leave your infrastructure
|
|
97
102
|
- No telemetry, analytics, or tracking
|
|
98
|
-
- Open source
|
|
103
|
+
- Open source. Every line is auditable
|
|
99
104
|
|
|
100
105
|
## Requirements
|
|
101
106
|
|
|
@@ -104,8 +109,6 @@ CLI flags > env vars > config file. Tokens and keys are blocked from config file
|
|
|
104
109
|
|
|
105
110
|
## License
|
|
106
111
|
|
|
107
|
-
[AGPL-3.0](LICENSE)
|
|
108
|
-
|
|
109
|
-
---
|
|
112
|
+
[AGPL-3.0](LICENSE). For commercial licensing, contact [patilmayur5572@gmail.com](mailto:patilmayur5572@gmail.com).
|
|
110
113
|
|
|
111
|
-
📖 **Full docs
|
|
114
|
+
📖 **Full docs and examples:** [github.com/patilmayur5572/ira-review](https://github.com/patilmayur5572/ira-review)
|