ira-review 2.0.2 → 3.0.1
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 +7 -6
- package/README.md +3 -3
- package/README.npm.md +3 -3
- package/dist/{bitbucket-CSZZGWYR.js → bitbucket-TXGRB3VV.js} +1 -1
- package/dist/{chunk-4XYBVOZW.js → chunk-SC7RXB4Y.js} +14 -0
- package/dist/{chunk-RAJNISC2.js → chunk-ZKADAXVW.js} +12 -0
- package/dist/cli.js +212 -52
- package/dist/{github-XKKZJIZ4.js → github-65TBQVFD.js} +1 -1
- package/dist/index.cjs +257 -42
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +33 -2
- package/dist/index.d.ts +33 -2
- package/dist/index.js +251 -40
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.github.md
CHANGED
|
@@ -39,7 +39,7 @@ IRA runs a 13-step pipeline for each review. Every step after step 1 is designed
|
|
|
39
39
|
7. Fetch source files for changed files (for full-file context)
|
|
40
40
|
8. Run AI review on each file/issue (concurrent, configurable model)
|
|
41
41
|
9. Calculate risk score (0-100) from issue severity, complexity, and security signals
|
|
42
|
-
10.
|
|
42
|
+
10. Automatically validate or generate JIRA acceptance criteria (if configured)
|
|
43
43
|
11. Deduplicate: skip issues already commented on in previous runs
|
|
44
44
|
12. Post summary + inline comments to the PR
|
|
45
45
|
13. Send Slack/Teams notification (if configured, respects risk threshold)
|
|
@@ -98,7 +98,7 @@ flowchart LR
|
|
|
98
98
|
|
|
99
99
|
```
|
|
100
100
|
src/
|
|
101
|
-
ai/ AI provider abstraction (OpenAI, Anthropic, Azure, Ollama)
|
|
101
|
+
ai/ AI provider abstraction (OpenAI, Anthropic, Azure, Ollama, AMP)
|
|
102
102
|
core/ Review engine, risk scorer, acceptance validator, test generator
|
|
103
103
|
scm/ GitHub and Bitbucket clients (diff, comments, labels, build status)
|
|
104
104
|
integrations/ JIRA client, Slack/Teams notifier
|
|
@@ -182,7 +182,7 @@ Each rule has a `message` (what to tell the developer), a `severity` (BLOCKER, C
|
|
|
182
182
|
}
|
|
183
183
|
```
|
|
184
184
|
|
|
185
|
-
Rules without `paths` apply to all files. Rules with `paths` are only checked against matching files. The file is validated at load time: invalid severity values and missing required fields are skipped with a warning. Maximum
|
|
185
|
+
Rules without `paths` apply to all files. Rules with `paths` are only checked against matching files. The file is validated at load time: invalid severity values and missing required fields are skipped with a warning. Maximum 100 rules per file. IRA rules are for nuanced, context-dependent standards that linters cannot express. Deterministic checks (naming conventions, import order, formatting) belong in ESLint.
|
|
186
186
|
|
|
187
187
|
Rules are enforced in all review surfaces (CLI, CI/CD, VS Code extension) with no license gating. In the VS Code extension, run `IRA: Init Rules File` from the command palette to scaffold an empty `.ira-rules.json`. The extension ships a JSON Schema for the file, so you get autocomplete and validation as you edit.
|
|
188
188
|
|
|
@@ -210,7 +210,7 @@ IRA is not a SaaS product. There is no hosted service, no telemetry, no analytic
|
|
|
210
210
|
| | CLI | VS Code Extension |
|
|
211
211
|
|---|---|---|
|
|
212
212
|
| **Use case** | CI pipelines, scripting, headless environments | Interactive development |
|
|
213
|
-
| **AI default** | OpenAI (requires API key) | GitHub Copilot (zero config) |
|
|
213
|
+
| **AI default** | OpenAI (requires API key) | GitHub Copilot (zero config), AMP CLI also supported |
|
|
214
214
|
| **Auth** | Environment variables or CLI flags | VS Code OAuth + OS keychain |
|
|
215
215
|
| **Output** | Terminal + PR comments | Inline diagnostics, CodeLens, TreeView, risk badge |
|
|
216
216
|
| **JIRA/Sonar** | CLI flags or env vars | VS Code settings |
|
|
@@ -282,7 +282,7 @@ Suggested Fix: Use parameterized queries:
|
|
|
282
282
|
3. `Cmd+Shift+P` > `IRA: Review Current PR`
|
|
283
283
|
4. Enter your PR number
|
|
284
284
|
|
|
285
|
-
If you have GitHub Copilot, that is all you need. No API keys, no configuration.
|
|
285
|
+
If you have GitHub Copilot, that is all you need. No API keys, no configuration. Alternatively, set the AI provider to `amp` if you have the AMP CLI installed (`amp login`).
|
|
286
286
|
|
|
287
287
|
### CLI
|
|
288
288
|
|
|
@@ -393,6 +393,7 @@ npx ira-review review \
|
|
|
393
393
|
| Provider | Notes |
|
|
394
394
|
|---|---|
|
|
395
395
|
| GitHub Copilot | VS Code only, zero config, uses existing session |
|
|
396
|
+
| AMP CLI | VS Code only, requires `amp` CLI installed and authenticated (`amp login`) |
|
|
396
397
|
| OpenAI | Default for CLI |
|
|
397
398
|
| Azure OpenAI | Requires `--ai-base-url` and `--ai-deployment` |
|
|
398
399
|
| Anthropic | Pass key with `--ai-api-key` |
|
|
@@ -420,7 +421,7 @@ CLI flags override environment variables, which override the config file. Token
|
|
|
420
421
|
## Requirements
|
|
421
422
|
|
|
422
423
|
- Node.js 18+
|
|
423
|
-
- An AI provider API key (or Ollama running locally, or GitHub Copilot for the VS Code extension)
|
|
424
|
+
- An AI provider API key (or Ollama running locally, or GitHub Copilot / AMP CLI for the VS Code extension)
|
|
424
425
|
- A GitHub or Bitbucket repo with an open PR
|
|
425
426
|
|
|
426
427
|
## License
|
package/README.md
CHANGED
|
@@ -78,7 +78,7 @@ Commit a `.ira-rules.json` to your repo root. Rules are injected into the AI pro
|
|
|
78
78
|
**Rules:**
|
|
79
79
|
- `message` + `severity` required. `bad`/`good` examples and `paths` are optional.
|
|
80
80
|
- Rules without `paths` apply to all files. Rules with `paths` match only those directories.
|
|
81
|
-
- Maximum
|
|
81
|
+
- Maximum 100 rules. Deterministic checks (naming, formatting) belong in ESLint.
|
|
82
82
|
- Invalid rules are skipped with a warning, not a crash.
|
|
83
83
|
- No license gating. Works in CLI, CI/CD, and VS Code extension.
|
|
84
84
|
|
|
@@ -172,12 +172,12 @@ CLI flags override env vars, which override the config file. Token fields are bl
|
|
|
172
172
|
|
|
173
173
|
**SCM:** GitHub, GitHub Enterprise, Bitbucket Cloud, Bitbucket Server/Data Center
|
|
174
174
|
|
|
175
|
-
**AI:** OpenAI (default), Azure OpenAI, Anthropic, Ollama (local, no key needed)
|
|
175
|
+
**AI:** OpenAI (default), Azure OpenAI, Anthropic, Ollama (local, no key needed), AMP CLI (VS Code extension)
|
|
176
176
|
|
|
177
177
|
## Requirements
|
|
178
178
|
|
|
179
179
|
- Node.js 18+
|
|
180
|
-
- An AI provider API key (or Ollama running locally)
|
|
180
|
+
- An AI provider API key (or Ollama running locally, or AMP CLI / GitHub Copilot for the VS Code extension)
|
|
181
181
|
|
|
182
182
|
## Security
|
|
183
183
|
|
package/README.npm.md
CHANGED
|
@@ -78,7 +78,7 @@ Commit a `.ira-rules.json` to your repo root. Rules are injected into the AI pro
|
|
|
78
78
|
**Rules:**
|
|
79
79
|
- `message` + `severity` required. `bad`/`good` examples and `paths` are optional.
|
|
80
80
|
- Rules without `paths` apply to all files. Rules with `paths` match only those directories.
|
|
81
|
-
- Maximum
|
|
81
|
+
- Maximum 100 rules. Deterministic checks (naming, formatting) belong in ESLint.
|
|
82
82
|
- Invalid rules are skipped with a warning, not a crash.
|
|
83
83
|
- No license gating. Works in CLI, CI/CD, and VS Code extension.
|
|
84
84
|
|
|
@@ -172,12 +172,12 @@ CLI flags override env vars, which override the config file. Token fields are bl
|
|
|
172
172
|
|
|
173
173
|
**SCM:** GitHub, GitHub Enterprise, Bitbucket Cloud, Bitbucket Server/Data Center
|
|
174
174
|
|
|
175
|
-
**AI:** OpenAI (default), Azure OpenAI, Anthropic, Ollama (local, no key needed)
|
|
175
|
+
**AI:** OpenAI (default), Azure OpenAI, Anthropic, Ollama (local, no key needed), AMP CLI (VS Code extension)
|
|
176
176
|
|
|
177
177
|
## Requirements
|
|
178
178
|
|
|
179
179
|
- Node.js 18+
|
|
180
|
-
- An AI provider API key (or Ollama running locally)
|
|
180
|
+
- An AI provider API key (or Ollama running locally, or AMP CLI / GitHub Copilot for the VS Code extension)
|
|
181
181
|
|
|
182
182
|
## Security
|
|
183
183
|
|
|
@@ -55,6 +55,20 @@ var GitHubClient = class {
|
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
+
async getIssueComments(pullRequestId) {
|
|
59
|
+
const bodies = [];
|
|
60
|
+
let page = 1;
|
|
61
|
+
while (true) {
|
|
62
|
+
const url = `${this.baseUrl}/repos/${this.owner}/${this.repo}/issues/${pullRequestId}/comments?per_page=100&page=${page}`;
|
|
63
|
+
const response = await fetchWithTimeout(url, { headers: this.headers });
|
|
64
|
+
if (!response.ok) break;
|
|
65
|
+
const comments = await response.json();
|
|
66
|
+
for (const c of comments) bodies.push(c.body);
|
|
67
|
+
if (comments.length < 100) break;
|
|
68
|
+
page++;
|
|
69
|
+
}
|
|
70
|
+
return bodies;
|
|
71
|
+
}
|
|
58
72
|
async getPRState(pullRequestId) {
|
|
59
73
|
const url = `${this.baseUrl}/repos/${this.owner}/${this.repo}/pulls/${pullRequestId}`;
|
|
60
74
|
const response = await fetchWithTimeout(url, { headers: this.headers });
|
|
@@ -89,6 +89,18 @@ var BitbucketClient = class {
|
|
|
89
89
|
}
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
|
+
async getIssueComments(pullRequestId) {
|
|
93
|
+
const bodies = [];
|
|
94
|
+
let url = `${this.baseUrl}/repositories/${this.workspace}/${this.repoSlug}/pullrequests/${pullRequestId}/comments?pagelen=100`;
|
|
95
|
+
while (url) {
|
|
96
|
+
const response = await fetchWithTimeout(url, { headers: this.headers });
|
|
97
|
+
if (!response.ok) break;
|
|
98
|
+
const data = await response.json();
|
|
99
|
+
for (const c of data.values) bodies.push(c.content.raw);
|
|
100
|
+
url = data.next;
|
|
101
|
+
}
|
|
102
|
+
return bodies;
|
|
103
|
+
}
|
|
92
104
|
async getFileContent(filePath, pullRequestId) {
|
|
93
105
|
const sourceHash = await this.getSourceHash(pullRequestId);
|
|
94
106
|
const encodedPath = filePath.split("/").map(encodeURIComponent).join("/");
|