ira-review 0.4.0 → 0.6.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/NOTICE +37 -0
- package/README.github.md +47 -407
- package/README.md +34 -154
- package/README.npm.md +34 -154
- package/dist/cli.js +8 -1
- package/dist/index.cjs.map +1 -1
- package/package.json +6 -2
- package/scripts/postinstall.js +30 -0
package/NOTICE
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
IRA — Intelligent Review Assistant
|
|
2
|
+
Copyright (c) 2024-present Mayur Patil (patilmayur5572@gmail.com)
|
|
3
|
+
|
|
4
|
+
This software is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).
|
|
5
|
+
|
|
6
|
+
=== AGPL-3.0 OBLIGATIONS ===
|
|
7
|
+
|
|
8
|
+
By using, modifying, or distributing this software, you agree to the following:
|
|
9
|
+
|
|
10
|
+
1. SOURCE CODE DISCLOSURE
|
|
11
|
+
If you modify this software or use it as part of a network service,
|
|
12
|
+
you MUST make the complete source code of your modified version available
|
|
13
|
+
to all users under the AGPL-3.0 license.
|
|
14
|
+
|
|
15
|
+
2. LICENSE PRESERVATION
|
|
16
|
+
You must retain all copyright notices, this NOTICE file, and the full
|
|
17
|
+
AGPL-3.0 license text in any copies or derivative works.
|
|
18
|
+
|
|
19
|
+
3. NETWORK USE IS DISTRIBUTION
|
|
20
|
+
Under AGPL-3.0, providing this software as a network service (e.g., SaaS,
|
|
21
|
+
CI/CD pipeline service) counts as distribution. You must offer the source
|
|
22
|
+
code to all users who interact with the service.
|
|
23
|
+
|
|
24
|
+
4. NO PROPRIETARY USE WITHOUT COMMERCIAL LICENSE
|
|
25
|
+
Using this software in proprietary/closed-source projects without releasing
|
|
26
|
+
your source code under AGPL-3.0 requires a commercial license.
|
|
27
|
+
|
|
28
|
+
=== COMMERCIAL LICENSING ===
|
|
29
|
+
|
|
30
|
+
For commercial licensing (use IRA in proprietary projects without AGPL obligations),
|
|
31
|
+
contact: patilmayur5572@gmail.com
|
|
32
|
+
|
|
33
|
+
=== THIRD-PARTY NOTICES ===
|
|
34
|
+
|
|
35
|
+
This project uses the following open-source dependencies:
|
|
36
|
+
- commander (MIT) — https://github.com/tj/commander.js
|
|
37
|
+
- openai (Apache-2.0) — https://github.com/openai/openai-node
|
package/README.github.md
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
#
|
|
1
|
+
# IRA — AI-Powered Code Reviews for Pull Requests
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
|
|
5
|
+
**Works with any language.** Supports GitHub and Bitbucket (Cloud & Server).
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- **Sonar + AI** - pulls SonarQube issues and enriches them with AI-powered explanations and fixes
|
|
7
|
+
## Two review modes
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
1. **AI-only** — IRA reads your PR diff and finds bugs, security issues, and performance problems.
|
|
10
|
+
2. **Sonar + AI** — IRA pulls your SonarQube issues and enriches each one with AI explanations and fixes.
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Try it now
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
|
-
|
|
16
|
-
export IRA_AI_API_KEY=sk-xxxxx
|
|
15
|
+
export IRA_AI_API_KEY=your-key-here
|
|
17
16
|
|
|
18
17
|
npx ira-review review \
|
|
19
18
|
--pr 42 \
|
|
@@ -23,23 +22,19 @@ npx ira-review review \
|
|
|
23
22
|
--dry-run
|
|
24
23
|
```
|
|
25
24
|
|
|
26
|
-
Drop `--dry-run` to post comments
|
|
25
|
+
Drop `--dry-run` to post comments on the PR.
|
|
27
26
|
|
|
28
27
|
## Install
|
|
29
28
|
|
|
30
29
|
```bash
|
|
31
|
-
npx ira-review review --pr 42 --dry-run
|
|
32
|
-
npm install
|
|
33
|
-
npm install -
|
|
30
|
+
npx ira-review review --pr 42 --dry-run # no install needed
|
|
31
|
+
npm install -g ira-review # or install globally
|
|
32
|
+
npm install --save-dev ira-review # or add to your project
|
|
34
33
|
```
|
|
35
34
|
|
|
36
|
-
---
|
|
37
|
-
|
|
38
35
|
## Quick start
|
|
39
36
|
|
|
40
|
-
### AI-only review (
|
|
41
|
-
|
|
42
|
-
IRA fetches your PR diff and runs a full AI code review - finding bugs, security issues, and performance problems.
|
|
37
|
+
### AI-only review (GitHub)
|
|
43
38
|
|
|
44
39
|
```bash
|
|
45
40
|
npx ira-review review \
|
|
@@ -49,9 +44,7 @@ npx ira-review review \
|
|
|
49
44
|
--github-repo owner/repo
|
|
50
45
|
```
|
|
51
46
|
|
|
52
|
-
### Sonar + AI review
|
|
53
|
-
|
|
54
|
-
Add your SonarQube config to get issue-level analysis with AI explanations:
|
|
47
|
+
### Sonar + AI review (Bitbucket)
|
|
55
48
|
|
|
56
49
|
```bash
|
|
57
50
|
npx ira-review review \
|
|
@@ -63,60 +56,17 @@ npx ira-review review \
|
|
|
63
56
|
--repo my-workspace/my-repo
|
|
64
57
|
```
|
|
65
58
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
IRA supports four AI providers. Set your provider with `--ai-provider`:
|
|
69
|
-
|
|
70
|
-
<table>
|
|
71
|
-
<tr><th>Provider</th><th>Command</th></tr>
|
|
72
|
-
<tr><td><b>OpenAI</b> (default)</td><td>
|
|
73
|
-
|
|
74
|
-
```bash
|
|
75
|
-
export IRA_AI_API_KEY=sk-xxxxx
|
|
76
|
-
npx ira-review review --pr 42 --dry-run
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
</td></tr>
|
|
80
|
-
<tr><td><b>Azure OpenAI</b></td><td>
|
|
81
|
-
|
|
82
|
-
```bash
|
|
83
|
-
export IRA_AI_API_KEY=xxxxx
|
|
84
|
-
npx ira-review review --pr 42 \
|
|
85
|
-
--ai-provider azure-openai \
|
|
86
|
-
--ai-base-url https://my-instance.openai.azure.com \
|
|
87
|
-
--ai-deployment gpt-4o \
|
|
88
|
-
--ai-api-version 2024-08-01-preview \
|
|
89
|
-
--dry-run
|
|
90
|
-
```
|
|
59
|
+
## Choose your AI provider
|
|
91
60
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
--ai-model claude-sonnet-4-20250514 \
|
|
100
|
-
--dry-run
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
</td></tr>
|
|
104
|
-
<tr><td><b>Ollama</b> (local, no key)</td><td>
|
|
105
|
-
|
|
106
|
-
```bash
|
|
107
|
-
npx ira-review review --pr 42 \
|
|
108
|
-
--ai-provider ollama \
|
|
109
|
-
--ai-model codellama \
|
|
110
|
-
--ai-base-url http://localhost:11434 \
|
|
111
|
-
--dry-run
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
</td></tr>
|
|
115
|
-
</table>
|
|
116
|
-
|
|
117
|
-
> **Tip:** Use `--ai-model-critical gpt-4o` to route BLOCKER/CRITICAL issues to a stronger model while keeping costs low for everything else.
|
|
61
|
+
| Provider | Flag | Notes |
|
|
62
|
+
|---|---|---|
|
|
63
|
+
| **OpenAI** (default) | `--ai-provider openai` | Set `IRA_AI_API_KEY` |
|
|
64
|
+
| **Azure OpenAI** | `--ai-provider azure-openai` | Also needs `--ai-base-url` and `--ai-deployment` |
|
|
65
|
+
| **Anthropic** | `--ai-provider anthropic` | Set `IRA_AI_API_KEY` |
|
|
66
|
+
| **Google Gemini** | `--ai-provider gemini` | Set `IRA_AI_API_KEY` |
|
|
67
|
+
| **Ollama** (local) | `--ai-provider ollama` | No API key needed |
|
|
118
68
|
|
|
119
|
-
|
|
69
|
+
> **Tip:** Use `--ai-model-critical gpt-4o` to send high-severity issues to a stronger model while keeping costs low.
|
|
120
70
|
|
|
121
71
|
## CI/CD setup
|
|
122
72
|
|
|
@@ -135,7 +85,6 @@ jobs:
|
|
|
135
85
|
- uses: actions/setup-node@v4
|
|
136
86
|
with:
|
|
137
87
|
node-version: 20
|
|
138
|
-
|
|
139
88
|
- run: npx ira-review review
|
|
140
89
|
--pr ${{ github.event.pull_request.number }}
|
|
141
90
|
--scm-provider github
|
|
@@ -146,8 +95,6 @@ jobs:
|
|
|
146
95
|
IRA_AI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
147
96
|
```
|
|
148
97
|
|
|
149
|
-
> Add `IRA_SONAR_URL`, `IRA_SONAR_TOKEN`, and `IRA_PROJECT_KEY` env vars for Sonar + AI mode. Without them, IRA runs in AI-only mode.
|
|
150
|
-
|
|
151
98
|
### Bitbucket Pipelines
|
|
152
99
|
|
|
153
100
|
```yaml
|
|
@@ -166,361 +113,54 @@ pipelines:
|
|
|
166
113
|
IRA_BITBUCKET_TOKEN: $BB_TOKEN
|
|
167
114
|
```
|
|
168
115
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
IRA is an npm package, but your project can be anything - Java, Python, Go, Rust, C#, PHP, Ruby. If Node.js is available (and it almost always is), just add `npx ira-review review ...` as a step.
|
|
172
|
-
|
|
173
|
-
```bash
|
|
174
|
-
# No Node.js? Use Docker
|
|
175
|
-
docker run --rm node:20-slim npx ira-review review --pr $PR_ID --dry-run
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
> **Security:** Use `--no-config-file` in CI pipelines that run on untrusted PRs (forks, external contributors). This prevents a malicious `.irarc.json` in the PR from altering review behavior.
|
|
179
|
-
|
|
180
|
-
---
|
|
181
|
-
|
|
182
|
-
## What IRA posts on your PR
|
|
183
|
-
|
|
184
|
-
### Inline comments
|
|
185
|
-
|
|
186
|
-
Each issue gets an inline comment on the exact line:
|
|
187
|
-
|
|
188
|
-
```
|
|
189
|
-
🔍 IRA Review - typescript:S1854 (BLOCKER)
|
|
116
|
+
> **Note:** Use `--no-config-file` in CI pipelines that run on untrusted PRs (forks, external contributors).
|
|
190
117
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
Explanation: The variable "data" is assigned a value that is never used
|
|
194
|
-
before being reassigned on line 15. This is dead code that adds confusion.
|
|
195
|
-
|
|
196
|
-
Impact: Dead code makes the codebase harder to read and maintain. It can
|
|
197
|
-
also mask real bugs if developers assume the assignment has a purpose.
|
|
198
|
-
|
|
199
|
-
Suggested Fix: Remove the assignment on line 10 entirely, or if the
|
|
200
|
-
variable is needed later, move the declaration to where it's first used.
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
### Summary comment
|
|
204
|
-
|
|
205
|
-
Every PR also gets a summary with risk score, issue breakdown, complexity hotspots, and JIRA validation results:
|
|
206
|
-
|
|
207
|
-
```
|
|
208
|
-
# 🔍 IRA Review Summary
|
|
209
|
-
|
|
210
|
-
## 🟠 Risk: HIGH (45/100)
|
|
211
|
-
|
|
212
|
-
| Factor | Score | Detail |
|
|
213
|
-
|-------------------|-------|-------------------------------|
|
|
214
|
-
| Blocker Issues | 20/30 | 2 blocker issues found |
|
|
215
|
-
| Security Concerns | 10/20 | 1 security-related issue |
|
|
216
|
-
| Code Complexity | 10/15 | 2 high-complexity files |
|
|
217
|
-
| Critical Issues | 5/20 | 1 critical issue found |
|
|
218
|
-
| Issue Density | 0/15 | 0.5 issues per file changed |
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
---
|
|
118
|
+
## Optional integrations
|
|
222
119
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
### PR risk scoring
|
|
226
|
-
|
|
227
|
-
Every review calculates a risk score (0-100) from five factors:
|
|
228
|
-
|
|
229
|
-
| Factor | Max | What it measures |
|
|
120
|
+
| Integration | What it does | Key flags |
|
|
230
121
|
|---|---|---|
|
|
231
|
-
|
|
|
232
|
-
|
|
|
233
|
-
|
|
|
234
|
-
|
|
|
235
|
-
| Code Complexity | 15 | Files with cyclomatic/cognitive complexity > 15 |
|
|
236
|
-
|
|
237
|
-
**LOW** (0-19) · **MEDIUM** (20-39) · **HIGH** (40-59) · **CRITICAL** (60+)
|
|
238
|
-
|
|
239
|
-
### Framework detection
|
|
240
|
-
|
|
241
|
-
IRA auto-detects your framework and tailors AI suggestions to match its conventions:
|
|
242
|
-
|
|
243
|
-
| Framework | Detection |
|
|
244
|
-
|---|---|
|
|
245
|
-
| React | `react` in `package.json` dependencies |
|
|
246
|
-
| Angular | `@angular/core` in `package.json` dependencies |
|
|
247
|
-
| Vue | `vue` in `package.json` dependencies |
|
|
248
|
-
| NestJS | `@nestjs/core` in `package.json` dependencies |
|
|
249
|
-
| Node.js | `package.json` exists (fallback) |
|
|
122
|
+
| **SonarQube** | Enriches Sonar issues with AI analysis | `--sonar-url`, `--sonar-token`, `--project-key` |
|
|
123
|
+
| **JIRA** | Validates PR against acceptance criteria | `--jira-url`, `--jira-email`, `--jira-token`, `--jira-ticket` |
|
|
124
|
+
| **Slack** | Sends review summary to a channel | `--slack-webhook` |
|
|
125
|
+
| **Teams** | Sends review summary to a channel | `--teams-webhook` |
|
|
250
126
|
|
|
251
|
-
|
|
127
|
+
## Config file
|
|
252
128
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
### JIRA acceptance criteria
|
|
256
|
-
|
|
257
|
-
Validate your PR against JIRA acceptance criteria using AI:
|
|
258
|
-
|
|
259
|
-
```bash
|
|
260
|
-
npx ira-review review --pr 42 \
|
|
261
|
-
--jira-url https://yourcompany.atlassian.net \
|
|
262
|
-
--jira-email dev@company.com \
|
|
263
|
-
--jira-token jira_xxxxx \
|
|
264
|
-
--jira-ticket PROJ-123
|
|
265
|
-
```
|
|
266
|
-
|
|
267
|
-
Output:
|
|
268
|
-
|
|
269
|
-
```
|
|
270
|
-
✅ JIRA: PROJ-123 - Add user authentication
|
|
271
|
-
✅ Authentication endpoint implemented
|
|
272
|
-
❌ Input validation - Critical security issue in login handler
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
Use `--jira-ac-field customfield_10042` if your acceptance criteria live in a custom field (default: `customfield_10035`).
|
|
276
|
-
|
|
277
|
-
### Slack & Teams notifications
|
|
278
|
-
|
|
279
|
-
```bash
|
|
280
|
-
--slack-webhook https://hooks.slack.com/services/xxx/yyy/zzz
|
|
281
|
-
--teams-webhook https://outlook.office.com/webhook/xxx
|
|
282
|
-
```
|
|
283
|
-
|
|
284
|
-
Both can be used at the same time. Notifications include risk score, issue count, and framework detected.
|
|
285
|
-
|
|
286
|
-
---
|
|
287
|
-
|
|
288
|
-
## How it works
|
|
289
|
-
|
|
290
|
-
```mermaid
|
|
291
|
-
sequenceDiagram
|
|
292
|
-
participant Dev as Developer
|
|
293
|
-
participant CI as CI/CD Pipeline
|
|
294
|
-
participant Sonar as SonarQube (optional)
|
|
295
|
-
participant IRA as IRA Review
|
|
296
|
-
participant AI as AI Provider
|
|
297
|
-
participant SCM as GitHub / Bitbucket
|
|
298
|
-
participant JIRA as JIRA (optional)
|
|
299
|
-
participant Notify as Slack / Teams (optional)
|
|
300
|
-
|
|
301
|
-
Dev->>CI: Push code / Open PR
|
|
302
|
-
opt SonarQube configured
|
|
303
|
-
CI->>Sonar: Run static analysis
|
|
304
|
-
Sonar-->>CI: Analysis complete
|
|
305
|
-
end
|
|
306
|
-
CI->>IRA: Run ira-review
|
|
307
|
-
IRA->>SCM: Fetch PR diff + source files
|
|
308
|
-
opt SonarQube configured
|
|
309
|
-
IRA->>Sonar: Fetch PR issues
|
|
310
|
-
end
|
|
311
|
-
IRA->>AI: Review each file/issue
|
|
312
|
-
AI-->>IRA: Explanation + Impact + Fix
|
|
313
|
-
IRA->>IRA: Calculate risk score + deduplicate
|
|
314
|
-
opt JIRA configured
|
|
315
|
-
IRA->>JIRA: Fetch acceptance criteria
|
|
316
|
-
IRA->>AI: Validate AC against findings
|
|
317
|
-
end
|
|
318
|
-
IRA->>SCM: Post inline comments + summary
|
|
319
|
-
opt Notifications configured
|
|
320
|
-
IRA->>Notify: Send review summary
|
|
321
|
-
end
|
|
322
|
-
```
|
|
323
|
-
|
|
324
|
-
---
|
|
325
|
-
|
|
326
|
-
## Configuration
|
|
327
|
-
|
|
328
|
-
### Config file
|
|
329
|
-
|
|
330
|
-
Create `.irarc.json` or `ira.config.json` in your project root:
|
|
129
|
+
Create `.irarc.json` in your project root to set defaults:
|
|
331
130
|
|
|
332
131
|
```json
|
|
333
132
|
{
|
|
334
|
-
"projectKey": "my-org_my-project",
|
|
335
133
|
"scmProvider": "github",
|
|
336
134
|
"githubRepo": "owner/repo",
|
|
337
135
|
"aiModel": "gpt-4o-mini",
|
|
338
|
-
"minSeverity": "MAJOR"
|
|
339
|
-
"dryRun": false
|
|
136
|
+
"minSeverity": "MAJOR"
|
|
340
137
|
}
|
|
341
138
|
```
|
|
342
139
|
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
> **⚠️ Security:** Config files only accept non-sensitive settings (repo names, model selection, severity, flags). Tokens, API keys, service URLs, and webhooks are **automatically ignored** if found in config files. Use environment variables or CLI flags for those. Use `--no-config-file` in CI with untrusted PRs.
|
|
346
|
-
|
|
347
|
-
### Environment variables
|
|
348
|
-
|
|
349
|
-
All settings can be configured via env vars. Copy `.env.example` to `.env` to get started.
|
|
350
|
-
|
|
351
|
-
| Variable | Description |
|
|
352
|
-
|---|---|
|
|
353
|
-
| **AI** | |
|
|
354
|
-
| `IRA_AI_API_KEY` | AI provider API key (**required**, except Ollama). Also accepts `OPENAI_API_KEY` |
|
|
355
|
-
| `IRA_AI_BASE_URL` | AI provider base URL (Azure endpoint, Ollama URL) |
|
|
356
|
-
| `IRA_AI_API_VERSION` | Azure OpenAI API version |
|
|
357
|
-
| `IRA_AI_DEPLOYMENT_NAME` | Azure OpenAI deployment name |
|
|
358
|
-
| **SonarQube** *(optional)* | |
|
|
359
|
-
| `IRA_SONAR_URL` | SonarQube/SonarCloud URL |
|
|
360
|
-
| `IRA_SONAR_TOKEN` | Sonar API token |
|
|
361
|
-
| `IRA_PROJECT_KEY` | Sonar project key |
|
|
362
|
-
| **SCM** | |
|
|
363
|
-
| `IRA_PR` | Pull request ID |
|
|
364
|
-
| `IRA_SCM_PROVIDER` | `bitbucket` (default) or `github` |
|
|
365
|
-
| `IRA_BITBUCKET_TOKEN` | Bitbucket API token |
|
|
366
|
-
| `IRA_BITBUCKET_URL` | Bitbucket Server base URL (self-hosted only) |
|
|
367
|
-
| `IRA_REPO` | Bitbucket `workspace/repo-slug` |
|
|
368
|
-
| `IRA_GITHUB_TOKEN` | GitHub API token |
|
|
369
|
-
| `IRA_GITHUB_REPO` | GitHub `owner/repo` |
|
|
370
|
-
| `IRA_GITHUB_URL` | GitHub Enterprise base URL (self-hosted only) |
|
|
371
|
-
| **Review** | |
|
|
372
|
-
| `IRA_MIN_SEVERITY` | Minimum severity: `BLOCKER`, `CRITICAL` (default), `MAJOR`, `MINOR`, `INFO` |
|
|
373
|
-
| **JIRA** *(optional)* | |
|
|
374
|
-
| `IRA_JIRA_URL` | JIRA base URL |
|
|
375
|
-
| `IRA_JIRA_EMAIL` | JIRA account email |
|
|
376
|
-
| `IRA_JIRA_TOKEN` | JIRA API token |
|
|
377
|
-
| `IRA_JIRA_TICKET` | JIRA ticket key (e.g. `PROJ-123`) |
|
|
378
|
-
| **Notifications** *(optional)* | |
|
|
379
|
-
| `IRA_SLACK_WEBHOOK` | Slack incoming webhook URL |
|
|
380
|
-
| `IRA_TEAMS_WEBHOOK` | Microsoft Teams webhook URL |
|
|
381
|
-
|
|
382
|
-
### CLI reference
|
|
140
|
+
CLI flags override env vars, which override the config file. Tokens and keys are blocked from config files for security.
|
|
383
141
|
|
|
384
|
-
|
|
385
|
-
ira-review review [options]
|
|
386
|
-
|
|
387
|
-
Required:
|
|
388
|
-
--pr <id> Pull request ID (or IRA_PR)
|
|
389
|
-
|
|
390
|
-
SCM:
|
|
391
|
-
--scm-provider <provider> bitbucket (default) or github
|
|
392
|
-
--bitbucket-token <token> Bitbucket API token
|
|
393
|
-
--repo <repo> Bitbucket workspace/repo-slug
|
|
394
|
-
--bitbucket-url <url> Bitbucket Server base URL
|
|
395
|
-
--github-token <token> GitHub API token
|
|
396
|
-
--github-repo <repo> GitHub owner/repo
|
|
397
|
-
--github-url <url> GitHub Enterprise base URL
|
|
398
|
-
|
|
399
|
-
AI:
|
|
400
|
-
--ai-provider <provider> openai (default), azure-openai, anthropic, ollama
|
|
401
|
-
--ai-model <model> AI model (default: gpt-4o-mini)
|
|
402
|
-
--ai-model-critical <model> Stronger model for BLOCKER/CRITICAL issues
|
|
403
|
-
--ai-base-url <url> AI provider base URL
|
|
404
|
-
--ai-api-version <version> Azure OpenAI API version
|
|
405
|
-
--ai-deployment <name> Azure OpenAI deployment name
|
|
406
|
-
|
|
407
|
-
SonarQube (optional):
|
|
408
|
-
--sonar-url <url> SonarQube/SonarCloud base URL
|
|
409
|
-
--sonar-token <token> Sonar API token
|
|
410
|
-
--project-key <key> Sonar project key
|
|
411
|
-
|
|
412
|
-
Review:
|
|
413
|
-
--min-severity <level> BLOCKER, CRITICAL (default), MAJOR, MINOR, INFO
|
|
414
|
-
--dry-run Print to terminal instead of posting
|
|
415
|
-
|
|
416
|
-
JIRA (optional):
|
|
417
|
-
--jira-url <url> JIRA base URL
|
|
418
|
-
--jira-email <email> JIRA account email
|
|
419
|
-
--jira-token <token> JIRA API token
|
|
420
|
-
--jira-ticket <key> JIRA ticket key (e.g. PROJ-123)
|
|
421
|
-
--jira-ac-field <field> Custom field ID for acceptance criteria
|
|
422
|
-
|
|
423
|
-
Notifications (optional):
|
|
424
|
-
--slack-webhook <url> Slack webhook URL
|
|
425
|
-
--teams-webhook <url> Microsoft Teams webhook URL
|
|
426
|
-
|
|
427
|
-
Config:
|
|
428
|
-
--config <path> Path to config file
|
|
429
|
-
--no-config-file Disable auto-loading config from repo
|
|
430
|
-
```
|
|
142
|
+
## What IRA posts
|
|
431
143
|
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
## Programmatic API
|
|
435
|
-
|
|
436
|
-
Use IRA as a library for custom integrations:
|
|
437
|
-
|
|
438
|
-
```typescript
|
|
439
|
-
import { ReviewEngine } from "ira-review";
|
|
440
|
-
|
|
441
|
-
const engine = new ReviewEngine({
|
|
442
|
-
scmProvider: "github",
|
|
443
|
-
scm: {
|
|
444
|
-
token: process.env.GITHUB_TOKEN!,
|
|
445
|
-
owner: "my-org",
|
|
446
|
-
repo: "my-repo",
|
|
447
|
-
},
|
|
448
|
-
ai: {
|
|
449
|
-
provider: "openai",
|
|
450
|
-
apiKey: process.env.IRA_AI_API_KEY!,
|
|
451
|
-
},
|
|
452
|
-
pullRequestId: "42",
|
|
453
|
-
// Optional: add Sonar, JIRA, notifications
|
|
454
|
-
// sonar: { baseUrl: "...", token: "...", projectKey: "..." },
|
|
455
|
-
// jira: { baseUrl: "...", email: "...", token: "..." },
|
|
456
|
-
// jiraTicket: "PROJ-123",
|
|
457
|
-
// notifications: { slackWebhookUrl: "...", teamsWebhookUrl: "..." },
|
|
458
|
-
});
|
|
459
|
-
|
|
460
|
-
const result = await engine.run();
|
|
461
|
-
|
|
462
|
-
console.log(`Risk: ${result.risk?.level} (${result.risk?.score}/${result.risk?.maxScore})`);
|
|
463
|
-
console.log(`Issues: ${result.totalIssues} found, ${result.reviewedIssues} reviewed`);
|
|
464
|
-
console.log(`Comments: ${result.commentsPosted} posted`);
|
|
465
|
-
```
|
|
466
|
-
|
|
467
|
-
Add `dryRun: true` to preview without posting.
|
|
468
|
-
|
|
469
|
-
---
|
|
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.
|
|
470
146
|
|
|
471
147
|
## Security
|
|
472
148
|
|
|
473
|
-
-
|
|
474
|
-
-
|
|
475
|
-
-
|
|
476
|
-
-
|
|
477
|
-
- **Open source** - every line is auditable. Only compiled `dist/` ships to npm.
|
|
478
|
-
|
|
479
|
-
## Built-in reliability
|
|
480
|
-
|
|
481
|
-
- **Automatic retries** - all API calls retry up to 3x with exponential backoff and jitter
|
|
482
|
-
- **Timeout protection** - every HTTP call has a 30-second timeout
|
|
483
|
-
- **Concurrency control** - AI calls capped at 3 concurrent requests
|
|
484
|
-
- **Soft failures** - optional features (complexity, JIRA, notifications) fail gracefully with warnings
|
|
485
|
-
- **Full pagination** - Sonar issues and complexity metrics paginate through all results
|
|
486
|
-
|
|
487
|
-
---
|
|
488
|
-
|
|
489
|
-
## Development
|
|
490
|
-
|
|
491
|
-
```bash
|
|
492
|
-
npm install # install deps
|
|
493
|
-
npm run typecheck # type check
|
|
494
|
-
npm test # run all tests (133 tests, 19 files)
|
|
495
|
-
npm run test:watch # watch mode
|
|
496
|
-
npm run build # build ESM + CJS + types
|
|
497
|
-
```
|
|
498
|
-
|
|
499
|
-
### Project structure
|
|
500
|
-
|
|
501
|
-
```
|
|
502
|
-
src/
|
|
503
|
-
core/ reviewEngine, riskScorer, sonarClient, complexityAnalyzer,
|
|
504
|
-
acceptanceValidator, summaryBuilder, issueProcessor
|
|
505
|
-
ai/ aiClient (OpenAI, Azure, Anthropic, Ollama), promptBuilder
|
|
506
|
-
scm/ github, bitbucket, commentTracker
|
|
507
|
-
integrations/ jiraClient, notifier (Slack, Teams)
|
|
508
|
-
frameworks/ detector (React, Angular, Vue, NestJS, Node)
|
|
509
|
-
utils/ retry, concurrency, env, configFile
|
|
510
|
-
types/ config, sonar, review, risk, jira
|
|
511
|
-
```
|
|
149
|
+
- Runs in your CI — tokens never leave your infrastructure
|
|
150
|
+
- No telemetry, analytics, or tracking
|
|
151
|
+
- Config files block sensitive fields automatically
|
|
152
|
+
- Open source — every line is auditable
|
|
512
153
|
|
|
513
154
|
## Requirements
|
|
514
155
|
|
|
515
156
|
- Node.js 18+
|
|
516
|
-
- AI provider API key (
|
|
517
|
-
- GitHub or Bitbucket repo with an open
|
|
518
|
-
- SonarQube/SonarCloud *(optional)*
|
|
519
|
-
- JIRA Cloud *(optional)*
|
|
520
|
-
- Slack/Teams webhooks *(optional)*
|
|
157
|
+
- An AI provider API key (or Ollama running locally)
|
|
158
|
+
- A GitHub or Bitbucket repo with an open PR
|
|
521
159
|
|
|
522
160
|
## License
|
|
523
161
|
|
|
524
|
-
AGPL-3.0
|
|
162
|
+
[AGPL-3.0](LICENSE) — For commercial licensing, contact [patilmayur5572@gmail.com](mailto:patilmayur5572@gmail.com).
|
|
163
|
+
|
|
164
|
+
---
|
|
525
165
|
|
|
526
|
-
|
|
166
|
+
📖 **Full CLI reference:** Run `npx ira-review review --help`
|