ira-review 3.1.2 → 3.1.3
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/dist/cli.js +14 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -14,9 +14,10 @@ import {
|
|
|
14
14
|
|
|
15
15
|
// src/cli.ts
|
|
16
16
|
import { Command } from "commander";
|
|
17
|
-
import { existsSync as existsSync9 } from "fs";
|
|
17
|
+
import { existsSync as existsSync9, readFileSync as readFileSync7 } from "fs";
|
|
18
18
|
import { readFile } from "fs/promises";
|
|
19
|
-
import { resolve as resolve3, join as join7 } from "path";
|
|
19
|
+
import { resolve as resolve3, join as join7, dirname } from "path";
|
|
20
|
+
import { fileURLToPath } from "url";
|
|
20
21
|
import { execSync as execSync5 } from "child_process";
|
|
21
22
|
|
|
22
23
|
// src/core/sonarClient.ts
|
|
@@ -4078,8 +4079,18 @@ function logEnvironmentInfo(config) {
|
|
|
4078
4079
|
step("\u{1F510}", `SSL_CERT_FILE: ${sslCert}`);
|
|
4079
4080
|
}
|
|
4080
4081
|
}
|
|
4082
|
+
function readPackageVersion() {
|
|
4083
|
+
try {
|
|
4084
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
4085
|
+
const pkgPath = resolve3(here, "..", "package.json");
|
|
4086
|
+
const pkg = JSON.parse(readFileSync7(pkgPath, "utf-8"));
|
|
4087
|
+
if (pkg.version) return pkg.version;
|
|
4088
|
+
} catch {
|
|
4089
|
+
}
|
|
4090
|
+
return "unknown";
|
|
4091
|
+
}
|
|
4081
4092
|
var program = new Command();
|
|
4082
|
-
program.name("ira-review").description("AI-powered PR review tool with SonarQube + GitHub/Bitbucket integration").version(
|
|
4093
|
+
program.name("ira-review").description("AI-powered PR review tool with SonarQube + GitHub/Bitbucket integration").version(readPackageVersion());
|
|
4083
4094
|
program.command("review").description("Run AI-powered review on a pull request").option("--sonar-url <url>", "SonarQube/SonarCloud base URL (or IRA_SONAR_URL)").option("--sonar-token <token>", "SonarQube API token (or IRA_SONAR_TOKEN)").option("--project-key <key>", "Sonar project key (or IRA_PROJECT_KEY)").option("--pr <id>", "Pull request ID (or IRA_PR)").option("--scm-provider <provider>", "SCM provider: bitbucket or github (or IRA_SCM_PROVIDER)").option("--bitbucket-token <token>", "Bitbucket API token (or IRA_BITBUCKET_TOKEN)").option("--repo <repo>", "Bitbucket workspace/repo-slug (Cloud) or PROJECT/repo-slug (Server) (or IRA_REPO)").option("--bitbucket-url <url>", "Bitbucket base URL (or IRA_BITBUCKET_URL)").option("--bitbucket-type <type>", "Bitbucket type: cloud or server (auto-detects from URL if omitted; or IRA_BITBUCKET_TYPE)").option("--github-token <token>", "GitHub API token (or IRA_GITHUB_TOKEN)").option("--github-repo <repo>", "GitHub owner/repo (or IRA_GITHUB_REPO)").option("--github-url <url>", "GitHub Enterprise URL (or IRA_GITHUB_URL)").option("--ai-provider <provider>", "AI provider").option("--ai-model <model>", "AI model to use").option("--dry-run", "Print comments to stdout instead of posting to SCM").option("--min-severity <level>", "Minimum severity to review (BLOCKER|CRITICAL|MAJOR|MINOR|INFO)").option("--jira-url <url>", "JIRA base URL (or IRA_JIRA_URL)").option("--jira-email <email>", "JIRA email (or IRA_JIRA_EMAIL)").option("--jira-token <token>", "JIRA API token (or IRA_JIRA_TOKEN)").option("--jira-type <type>", "JIRA type: cloud or server (auto-detects from URL if omitted)").option("--jira-ticket <key>", "JIRA ticket key (e.g. PROJ-123)").option("--jira-ac-field <field>", "Custom field ID for acceptance criteria").option("--jira-ac-source <source>", "Where to look for AC: customField, description, or both (default: customField)").option("--no-post-acs-to-jira", "Don't post AI-generated acceptance criteria back to the JIRA ticket when none exist; keep them in the PR summary only (or IRA_POST_ACS_TO_JIRA=false)").option("--slack-webhook <url>", "Slack webhook URL for notifications").option("--teams-webhook <url>", "Teams webhook URL for notifications").option("--notify-min-risk <level>", "Only notify when risk is at or above this level: low, medium, high, critical").option("--notify-on-ac-fail", "Send notification when JIRA acceptance criteria validation fails").option("--ai-base-url <url>", "AI provider base URL (Azure endpoint, Ollama URL)").option("--ai-api-key <key>", "AI API key (or IRA_AI_API_KEY / OPENAI_API_KEY)").option("--ai-api-version <version>", "Azure OpenAI API version").option("--ai-deployment <name>", "Azure OpenAI deployment name").option("--ai-model-critical <model>", "Stronger AI model for BLOCKER/CRITICAL issues").option("--generate-tests", "Generate test cases from JIRA acceptance criteria").option("--test-framework <framework>", "Test framework: jest, vitest, mocha, playwright, cypress, gherkin, pytest, junit (default: jest)").option("--config <path>", "Path to config file (default: auto-detect .irarc.json / ira.config.json)").option("--no-config-file", "Disable auto-loading config file from repo").option("--rules-url <url>", "Fetch .ira-rules.json from URL (raw HTTP) \u2014 useful when CI has no full checkout (or IRA_RULES_URL)").option("--comment-style <style>", "Comment formatter style: compact (default) or detailed (or IRA_COMMENT_STYLE)").action(async (opts) => {
|
|
4084
4095
|
try {
|
|
4085
4096
|
console.log(`
|