@alibaba-group/open-code-review 1.10.0 → 1.10.2

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.
Files changed (2) hide show
  1. package/bin/ocr.js +19 -1
  2. package/package.json +10 -9
package/bin/ocr.js CHANGED
@@ -14,6 +14,24 @@ const { resolveNativeBinary } = require("../scripts/platform");
14
14
  const { version: packageVersion } = require("../package.json");
15
15
  const { shouldShowUpdateHint } = require("../scripts/version");
16
16
 
17
+ // Maps a child process result to the launcher exit code.
18
+ // A child killed by a signal has status = null, which must not fall through
19
+ // to a clean 0 — pipelines gating on the exit code would read an OOM kill
20
+ // (or any signal death) as success. Conventional 128+signo is used instead.
21
+ function launcherExitCode(result) {
22
+ if (result.signal) {
23
+ return 128 + (os.constants.signals[result.signal] ?? 1);
24
+ }
25
+ return result.status ?? (result.error ? 1 : 0);
26
+ }
27
+
28
+ module.exports = { launcherExitCode };
29
+
30
+ if (require.main !== module) {
31
+ // Required as a module (tests); the launcher body below must not run.
32
+ return;
33
+ }
34
+
17
35
  const resolved = resolveNativeBinary();
18
36
  if (!resolved) {
19
37
  console.error(
@@ -64,4 +82,4 @@ const result = spawnSync(binaryPath, process.argv.slice(2), {
64
82
  env: process.env,
65
83
  });
66
84
 
67
- process.exit(result.status ?? (result.error ? 1 : 0));
85
+ process.exit(launcherExitCode(result));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alibaba-group/open-code-review",
3
- "version": "1.10.0",
3
+ "version": "1.10.2",
4
4
  "description": "OpenCodeReview CLI — AI-powered code review tool",
5
5
  "bin": {
6
6
  "ocr": "bin/ocr.js"
@@ -15,8 +15,9 @@
15
15
  ],
16
16
  "scripts": {
17
17
  "postinstall": "node scripts/install.js",
18
- "test:github-actions": "node scripts/github-actions/post-review-comments.test.js && node scripts/github-actions/check-translation-sync.test.js",
19
- "test:update": "node scripts/version.test.js"
18
+ "test:github-actions": "node scripts/github-actions/post-review-comments.test.js && node scripts/github-actions/check-translation-sync.test.js && node scripts/github-actions/action-contract.test.js",
19
+ "test:update": "node scripts/version.test.js",
20
+ "test:launcher": "node bin/ocr.test.js"
20
21
  },
21
22
  "repository": {
22
23
  "type": "git",
@@ -30,12 +31,12 @@
30
31
  "checksumPattern": "https://github.com/alibaba/open-code-review/releases/download/v{version}/sha256sum.txt"
31
32
  },
32
33
  "optionalDependencies": {
33
- "@alibaba-group/ocr-darwin-arm64": "1.10.0",
34
- "@alibaba-group/ocr-darwin-x64": "1.10.0",
35
- "@alibaba-group/ocr-linux-arm64": "1.10.0",
36
- "@alibaba-group/ocr-linux-x64": "1.10.0",
37
- "@alibaba-group/ocr-win32-arm64": "1.10.0",
38
- "@alibaba-group/ocr-win32-x64": "1.10.0"
34
+ "@alibaba-group/ocr-darwin-arm64": "1.10.2",
35
+ "@alibaba-group/ocr-darwin-x64": "1.10.2",
36
+ "@alibaba-group/ocr-linux-arm64": "1.10.2",
37
+ "@alibaba-group/ocr-linux-x64": "1.10.2",
38
+ "@alibaba-group/ocr-win32-arm64": "1.10.2",
39
+ "@alibaba-group/ocr-win32-x64": "1.10.2"
39
40
  },
40
41
  "engines": {
41
42
  "node": ">=14"