datagrok-tools 6.5.0 → 6.5.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/CHANGELOG.md CHANGED
@@ -1,41 +1,45 @@
1
1
  # Datagrok-tools changelog
2
2
 
3
- ## 6.5.0 (2026-07-22)
3
+ ## 6.5.1 (2026-07-22)
4
4
 
5
- * `grok test` ??? added a Node (browserless) pass: tests annotated `{node: true}` run headless under the js-api Node runtime before the browser launches; the browser pass excludes them and is skipped entirely when nothing browser-only matches. New flags: `--skip-node`, `--node-only`. Packages opt in by exporting `testNode()` from `package-test.ts`; others keep the previous behavior.
5
+ * `grok test` the Node-pass report now merges into the browser report by column name. The line-wise merge assumed identical column order, so node rows landed misaligned (string values in the integer `ms` column) and the CI test-report upload failed with `invalid input syntax for type integer`.
6
+
7
+ ## 6.5.0 (WIP)
8
+
9
+ * `grok test` — added a Node (browserless) pass: tests annotated `{node: true}` run headless under the js-api Node runtime before the browser launches; the browser pass excludes them and is skipped entirely when nothing browser-only matches. New flags: `--skip-node`, `--node-only`. Packages opt in by exporting `testNode()` from `package-test.ts`; others keep the previous behavior.
6
10
 
7
11
  ## 6.4.8 (2026-07-22)
8
12
 
9
- * GROK-20452: `grok publish` ??? always `docker build` the tools-generated worker dirs (`dockerfiles/queue`, `dockerfiles/celery`, `dockerfiles/<app>-celery`) instead of reusing a cached local tag. The "found local image" shortcut froze the worker at whatever stock base the daemon had when the tag was first built (CI ran day-old worker code with a fresh base available); the layer cache keeps an unchanged rebuild near-instant.
10
- * `grok test` ??? `--no-retry` is now honored for Playwright runs. minimist parsed `--no-retry` as `{retry:false}`, so the flag was silently dropped and failed specs were still retried once; normalized so `--retries=0` reaches Playwright.
13
+ * GROK-20452: `grok publish` always `docker build` the tools-generated worker dirs (`dockerfiles/queue`, `dockerfiles/celery`, `dockerfiles/<app>-celery`) instead of reusing a cached local tag. The "found local image" shortcut froze the worker at whatever stock base the daemon had when the tag was first built (CI ran day-old worker code with a fresh base available); the layer cache keeps an unchanged rebuild near-instant.
14
+ * `grok test` `--no-retry` is now honored for Playwright runs. minimist parsed `--no-retry` as `{retry:false}`, so the flag was silently dropped and failed specs were still retried once; normalized so `--retries=0` reaches Playwright.
11
15
 
12
16
  ## 6.4.7 (2026-07-22)
13
17
 
14
- * GROK-20452: `grok publish` ??? generate `dockerfiles/celery` / `dockerfiles/queue` **before** gathering files for the zip. They were generated after, so the generated Dockerfile never reached the server: `meta.queue` functions fell back to a server-side container named `<pkg>-queue-celery` while the client had built `<pkg>-queue` ??? image validation 404'd and the worker container never started ("Container is not started" on every call).
18
+ * GROK-20452: `grok publish` generate `dockerfiles/celery` / `dockerfiles/queue` **before** gathering files for the zip. They were generated after, so the generated Dockerfile never reached the server: `meta.queue` functions fell back to a server-side container named `<pkg>-queue-celery` while the client had built `<pkg>-queue` image validation 404'd and the worker container never started ("Container is not started" on every call).
15
19
 
16
20
  ## 6.4.6 (2026-07-22)
17
21
 
18
- * `grok test` ??? the whole-run Puppeteer cap (60 min) is now overridable via `GROK_TEST_INVOCATION_TIMEOUT_MS`. When the cap fires mid-pass all collected results are discarded (empty `test-report.csv`, "Passed tests: 0"), which CI reports as "no results produced"; loaded CI agents can now raise the cap instead.
22
+ * `grok test` the whole-run Puppeteer cap (60 min) is now overridable via `GROK_TEST_INVOCATION_TIMEOUT_MS`. When the cap fires mid-pass all collected results are discarded (empty `test-report.csv`, "Passed tests: 0"), which CI reports as "no results produced"; loaded CI agents can now raise the cap instead.
19
23
 
20
24
  ## 6.4.5 (2026-06-23)
21
25
 
22
- * `grok test` ??? screen recording (`--record`) is now optional: if `page.screencast()` can't start (e.g. `ffmpeg` is missing on the runner, `spawnSync ffmpeg ENOENT`), the run warns and continues instead of failing the whole Puppeteer pass with 0 tests executed.
26
+ * `grok test` screen recording (`--record`) is now optional: if `page.screencast()` can't start (e.g. `ffmpeg` is missing on the runner, `spawnSync ffmpeg ENOENT`), the run warns and continues instead of failing the whole Puppeteer pass with 0 tests executed.
23
27
 
24
28
  ## 6.4.4 (2026-06-22)
25
29
 
26
- * `grok publish` ??? fixed every publish failing with a silent `exit 1` after a successful upload: a stray `fs.unlinkSync('zip')` threw `ENOENT` (the archive is streamed in-memory, no `zip` file is ever written), and the surrounding `catch` only logged under `--verbose`. The errant unlink is removed and publish errors are now always surfaced.
30
+ * `grok publish` fixed every publish failing with a silent `exit 1` after a successful upload: a stray `fs.unlinkSync('zip')` threw `ENOENT` (the archive is streamed in-memory, no `zip` file is ever written), and the surrounding `catch` only logged under `--verbose`. The errant unlink is removed and publish errors are now always surfaced.
27
31
 
28
32
  ## 6.4.3 (2026-06-22)
29
33
 
30
- * `grok api` ??? numeric IVP model inputs are now generated with `nullable: false`, so an emptied input field fails form validation instead of running the solver with a null.
34
+ * `grok api` numeric IVP model inputs are now generated with `nullable: false`, so an emptied input field fails form validation instead of running the solver with a null.
31
35
 
32
36
  ## 6.4.2 (2026-06-18)
33
37
 
34
- * `grok publish` ??? registry-aware Docker fallback: when a package's image isn't built locally and the target server has no compatible record, `grok publish` now checks the configured registry and Docker Hub (`docker manifest inspect`) for the expected `datagrok/<name>:<version>` (and content-hashed) tag and uses it, instead of reporting "No fallback available" and failing. Fixes dependency publishes (e.g. Bio ??? @datagrok/chem) on CI runners where the image exists in the registry but not locally.
38
+ * `grok publish` registry-aware Docker fallback: when a package's image isn't built locally and the target server has no compatible record, `grok publish` now checks the configured registry and Docker Hub (`docker manifest inspect`) for the expected `datagrok/<name>:<version>` (and content-hashed) tag and uses it, instead of reporting "No fallback available" and failing. Fixes dependency publishes (e.g. Bio @datagrok/chem) on CI runners where the image exists in the registry but not locally.
35
39
 
36
40
  ## 6.4.1 (2026-06-18)
37
41
 
38
- * Fixed `grok` failing with `Cannot find module './commands/build'` ??? the `.npmignore` `build.js` rule was unanchored and excluded the compiled `bin/commands/build.js` from the published package; anchored it to `/build.js`.
42
+ * Fixed `grok` failing with `Cannot find module './commands/build'` the `.npmignore` `build.js` rule was unanchored and excluded the compiled `bin/commands/build.js` from the published package; anchored it to `/build.js`.
39
43
  * Pinned `ignore-walk` to ^6.0.5 so the package still supports Node 18 (9.x requires Node 22+).
40
44
 
41
45
  ## 6.4.0 (2026-06-18)
@@ -47,46 +51,46 @@
47
51
 
48
52
  ## 6.3.3 (2026-06-16)
49
53
 
50
- * Fixed Celery Docker image generation ??? the image wasn't built locally on publish.
54
+ * Fixed Celery Docker image generation the image wasn't built locally on publish.
51
55
 
52
56
  ## 6.3.2 (2026-06-15)
53
57
 
54
- * `func-gen` webpack plugin ??? generated RichFunctionView model inputs now use the script-form names (argument bounds/step `_t0`/`_t1`/`_h`, loop count `_count`) instead of the deprefixed forms, so the run, fitting, and sensitivity-analysis paths share one set of input names with diff-grok's pipeline. Fixes `Inconsistent inputs: "_t0" is missing` when starting fitting/SA from a Rich Function View.
55
- * `func-gen` webpack plugin ??? the generated RichFunctionView model output annotation appends the `DiffStudio Facet` viewer (last), alongside Grid and Line chart.
56
- * `grok stresstest` ??? run the ApiTests Node test runner directly via tsx (`src/package-test-node.ts`) instead of a compiled `dist-node` bundle; dropped the obsolete `npm run build-node` step and the `tsconfig-paths-bootstrap.js` / `dist-node` invocation.
58
+ * `func-gen` webpack plugin generated RichFunctionView model inputs now use the script-form names (argument bounds/step `_t0`/`_t1`/`_h`, loop count `_count`) instead of the deprefixed forms, so the run, fitting, and sensitivity-analysis paths share one set of input names with diff-grok's pipeline. Fixes `Inconsistent inputs: "_t0" is missing` when starting fitting/SA from a Rich Function View.
59
+ * `func-gen` webpack plugin the generated RichFunctionView model output annotation appends the `DiffStudio Facet` viewer (last), alongside Grid and Line chart.
60
+ * `grok stresstest` run the ApiTests Node test runner directly via tsx (`src/package-test-node.ts`) instead of a compiled `dist-node` bundle; dropped the obsolete `npm run build-node` step and the `tsconfig-paths-bootstrap.js` / `dist-node` invocation.
57
61
 
58
62
  ## 6.3.0 (2026-06-12)
59
63
 
60
- * `func-gen` webpack plugin ??? generates RichFunctionView model wrappers from Diff Studio `#meta.role: model` `.ivp` files. Inputs/output are derived from the parsed IVP, `#meta.icon` becomes the model icon, and `#meta.inputs` lookups are emitted as real `propagateChoice: all` inputs (rendered natively by the Rich Function View, unlike `meta.inputs`). Ships a prebuilt, tree-shaken CJS bundle of diff-grok's IVP parser (`plugins/ivp-parser.bundle.cjs`); regenerate with `npm run update:ivp-parser`.
64
+ * `func-gen` webpack plugin generates RichFunctionView model wrappers from Diff Studio `#meta.role: model` `.ivp` files. Inputs/output are derived from the parsed IVP, `#meta.icon` becomes the model icon, and `#meta.inputs` lookups are emitted as real `propagateChoice: all` inputs (rendered natively by the Rich Function View, unlike `meta.inputs`). Ships a prebuilt, tree-shaken CJS bundle of diff-grok's IVP parser (`plugins/ivp-parser.bundle.cjs`); regenerate with `npm run update:ivp-parser`.
61
65
 
62
66
  ## 6.2.6 (2026-05-26)
63
67
 
64
- * `grok s tables upload` ??? accepts `.d42` binary blobs in addition to `.csv`. Content-Type is auto-detected from the file extension (`application/octet-stream` for d42, `text/csv` otherwise); server content-negotiates and persists either form against the same `/public/v1/tables/{name}` endpoint.
68
+ * `grok s tables upload` accepts `.d42` binary blobs in addition to `.csv`. Content-Type is auto-detected from the file extension (`application/octet-stream` for d42, `text/csv` otherwise); server content-negotiates and persists either form against the same `/public/v1/tables/{name}` endpoint.
65
69
 
66
70
  ## 6.2.5 (2026-05-21)
67
71
 
68
- * `grok report read` ??? renamed `--extract-actions` to `--extract-client-log`; sidecar is now `<stem>_client_log.json`. The old flag is no longer accepted.
69
- * `grok report read` ??? legacy `actions` field in pre-consolidation report zips is folded into `clientLog` at read time (stderr warning emitted), so downstream consumers see one canonical field. Companion to the platform-side merge that drops `reports_data.actions` in favor of `client_log`.
72
+ * `grok report read` renamed `--extract-actions` to `--extract-client-log`; sidecar is now `<stem>_client_log.json`. The old flag is no longer accepted.
73
+ * `grok report read` legacy `actions` field in pre-consolidation report zips is folded into `clientLog` at read time (stderr warning emitted), so downstream consumers see one canonical field. Companion to the platform-side merge that drops `reports_data.actions` in favor of `client_log`.
70
74
 
71
75
  ## 6.2.4 (2026-05-13)
72
76
 
73
- * GROK-20097: package template ??? replaced deprecated `"moduleResolution": "node"` in `tsconfig.json` with `"bundler"`, suppressing the TypeScript warning for new packages.
77
+ * GROK-20097: package template replaced deprecated `"moduleResolution": "node"` in `tsconfig.json` with `"bundler"`, suppressing the TypeScript warning for new packages.
74
78
 
75
79
  ## 6.2.3 (2026-05-06)
76
80
 
77
- * `grok test` ??? added `--skip-puppeteer` flag (symmetric counterpart of `--skip-playwright`). Bypasses `loadPackages()` and the Puppeteer/`DG.Test` runner so Playwright-only test directories (e.g. `public/playwright-public`) can run end-to-end via `grok test --skip-puppeteer` without tripping the Dart/JS package loader.
81
+ * `grok test` added `--skip-puppeteer` flag (symmetric counterpart of `--skip-playwright`). Bypasses `loadPackages()` and the Puppeteer/`DG.Test` runner so Playwright-only test directories (e.g. `public/playwright-public`) can run end-to-end via `grok test --skip-puppeteer` without tripping the Dart/JS package loader.
78
82
 
79
83
  ## 6.2.2 (2026-05-05)
80
84
 
81
- * `grok test` ??? Playwright runner now writes `test-report-playwright.csv` next to the existing merged `test-report.csv`, so CI can ship Playwright rows to a dedicated Datlas reporting bucket without disturbing the legacy `package` flow.
85
+ * `grok test` Playwright runner now writes `test-report-playwright.csv` next to the existing merged `test-report.csv`, so CI can ship Playwright rows to a dedicated Datlas reporting bucket without disturbing the legacy `package` flow.
82
86
 
83
87
  ## 6.2.1 (2026-05-05)
84
88
 
85
- * Reports: `grok report attach <ticket> <file>` ??? upload a file as a JIRA issue attachment via REST v2 multipart POST.
89
+ * Reports: `grok report attach <ticket> <file>` upload a file as a JIRA issue attachment via REST v2 multipart POST.
86
90
 
87
91
  ## 6.2.0 (2026-05-04)
88
92
 
89
- * `grok test` ??? Playwright support: when a package's `package.json` declares `"playwrightTests": "<path>"`, `grok test` runs `npx playwright test` against that directory in addition to the existing Puppeteer pass and merges results into a single `test-report.csv`. Auth is unified with the Puppeteer pass (dev key from `~/.grok/config.yaml` ??? session token ??? cookie + `localStorage` injection ??? no login form). Optional `DATAGROK_DEV_KEY_2` env var enables a second-user identity for specs that need it (`DATAGROK_AUTH_TOKEN_2` exposed to specs). New `--skip-playwright` flag opts out of the Playwright pass for a single run.
93
+ * `grok test` Playwright support: when a package's `package.json` declares `"playwrightTests": "<path>"`, `grok test` runs `npx playwright test` against that directory in addition to the existing Puppeteer pass and merges results into a single `test-report.csv`. Auth is unified with the Puppeteer pass (dev key from `~/.grok/config.yaml` session token cookie + `localStorage` injection no login form). Optional `DATAGROK_DEV_KEY_2` env var enables a second-user identity for specs that need it (`DATAGROK_AUTH_TOKEN_2` exposed to specs). New `--skip-playwright` flag opts out of the Playwright pass for a single run.
90
94
 
91
95
  ## 6.1.14 (2026-05-01)
92
96
 
@@ -98,17 +102,17 @@
98
102
 
99
103
  ## 6.1.11 (2026-04-27)
100
104
 
101
- * `grok report read <path | instance number>` ??? normalize a report zip/json into one JSON object on stdout (envelope unwrap, `_meta.json` merge, optional `--extract-screenshot` / `--extract-d42` / `--extract-actions`)
102
- * `grok report fetch` ??? single round-trip via the new `/reports/by-number/<number>/zip` endpoint, with fallback to the legacy search-then-download path on 404
105
+ * `grok report read <path | instance number>` normalize a report zip/json into one JSON object on stdout (envelope unwrap, `_meta.json` merge, optional `--extract-screenshot` / `--extract-d42` / `--extract-actions`)
106
+ * `grok report fetch` single round-trip via the new `/reports/by-number/<number>/zip` endpoint, with fallback to the legacy search-then-download path on 404
103
107
 
104
108
  ## 6.1.10 (2026-04-17)
105
109
 
106
- * `grok s connections save` ??? create/update a connection from a JSON file (`--save-credentials` optional)
107
- * `grok s connections test` ??? test connectivity by JSON body or by existing id/name
108
- * `grok s users save` ??? create/update a user from a JSON file
109
- * `grok s groups save` ??? create/update a group from a JSON file (`--save-relations` optional)
110
- * `grok s shares add` ??? share an entity with one or more groups (`--access View|Edit`)
111
- * `grok s shares list` ??? list who an entity is shared with
110
+ * `grok s connections save` create/update a connection from a JSON file (`--save-credentials` optional)
111
+ * `grok s connections test` test connectivity by JSON body or by existing id/name
112
+ * `grok s users save` create/update a user from a JSON file
113
+ * `grok s groups save` create/update a group from a JSON file (`--save-relations` optional)
114
+ * `grok s shares add` share an entity with one or more groups (`--access View|Edit`)
115
+ * `grok s shares list` list who an entity is shared with
112
116
  * Tools: Normalize package name to lowercase in grok create, preserve original as friendlyName
113
117
 
114
118
  ## 5.1.3 (2026-02-03)
@@ -289,22 +289,18 @@ async function test(args) {
289
289
  }
290
290
  }
291
291
  if (nodeRes != null) {
292
- // Merge the Node pass into the browser result (same CSV columns/order).
293
- if (!res.csv || res.csv.trim().split('\n').length < 2) {
294
- res.csv = nodeRes.csv;
295
- res.passedAmount += nodeRes.passedAmount;
296
- res.failedAmount += nodeRes.failedAmount;
297
- res.skippedAmount += nodeRes.skippedAmount;
298
- res.failed = res.failed || nodeRes.failed;
299
- res.verbosePassed = (res.verbosePassed || '') + nodeRes.verbosePassed;
300
- res.verboseFailed = (res.verboseFailed || '') + nodeRes.verboseFailed;
301
- res.verboseSkipped = (res.verboseSkipped || '') + nodeRes.verboseSkipped;
302
- res.modernOutput = res.modernOutput || nodeRes.modernOutput;
303
- } else if (nodeRes.csv && nodeRes.csv.trim().split('\n').length >= 2) {
304
- res = await (0, _testUtils.mergeBrowsersResults)([res, nodeRes]);
305
- } else {
306
- res.failed = res.failed || nodeRes.failed;
307
- }
292
+ // Merge the Node pass into the browser result. CSVs merge by column NAME —
293
+ // the two passes emit different column orders, and a line-wise concat would
294
+ // misalign rows (string values in integer columns break the report upload).
295
+ res.csv = testUtils.mergeCsvByHeader(res.csv, nodeRes.csv);
296
+ res.passedAmount += nodeRes.passedAmount;
297
+ res.failedAmount += nodeRes.failedAmount;
298
+ res.skippedAmount += nodeRes.skippedAmount;
299
+ res.failed = res.failed || nodeRes.failed;
300
+ res.verbosePassed = (res.verbosePassed || '') + nodeRes.verbosePassed;
301
+ res.verboseFailed = (res.verboseFailed || '') + nodeRes.verboseFailed;
302
+ res.verboseSkipped = (res.verboseSkipped || '') + nodeRes.verboseSkipped;
303
+ res.modernOutput = res.modernOutput || nodeRes.modernOutput;
308
304
  }
309
305
  if (!args['skip-playwright'] && !args['node-only']) {
310
306
  const ptDir = playwrightRunner.hasPlaywrightTests(curDir);
@@ -20,6 +20,7 @@ exports.loadPackage = loadPackage;
20
20
  exports.loadPackages = loadPackages;
21
21
  exports.loadTestsList = loadTestsList;
22
22
  exports.mergeBrowsersResults = mergeBrowsersResults;
23
+ exports.mergeCsvByHeader = mergeCsvByHeader;
23
24
  exports.printBrowsersResult = printBrowsersResult;
24
25
  exports.runBrowser = runBrowser;
25
26
  exports.runWithTimeout = runWithTimeout;
@@ -946,6 +947,29 @@ class TestContext {
946
947
  }
947
948
  }
948
949
  exports.TestContext = TestContext;
950
+ /**
951
+ * Merges two test-result CSVs by column NAME (union of headers), unlike
952
+ * mergeBrowsersResults' line concatenation which assumes identical column order.
953
+ * Used to merge the Node-pass report into the browser report.
954
+ */
955
+ function mergeCsvByHeader(a, b) {
956
+ const hasRows = csv => csv && csv.trim().split('\n').length >= 2;
957
+ if (!hasRows(a)) return hasRows(b) ? b : a || b || '';
958
+ if (!hasRows(b)) return a;
959
+ const pa = _papaparse.default.parse(a.trim(), {
960
+ header: true,
961
+ skipEmptyLines: true
962
+ });
963
+ const pb = _papaparse.default.parse(b.trim(), {
964
+ header: true,
965
+ skipEmptyLines: true
966
+ });
967
+ const columns = [...(pa.meta.fields ?? [])];
968
+ for (const f of pb.meta.fields ?? []) if (!columns.includes(f)) columns.push(f);
969
+ return _papaparse.default.unparse([...pa.data, ...pb.data], {
970
+ columns
971
+ });
972
+ }
949
973
  function addColumnToCsv(csv, columnName, defaultValue) {
950
974
  const results = _papaparse.default.parse(csv, {
951
975
  header: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datagrok-tools",
3
- "version": "6.5.0",
3
+ "version": "6.5.1",
4
4
  "description": "Utility to upload and publish packages to Datagrok",
5
5
  "homepage": "https://github.com/datagrok-ai/public/tree/master/tools#readme",
6
6
  "dependencies": {