Repository navigation
fix(mx_execute): assign line from the input buffer in the Viya outlogds step - #477
Conversation
…ds step The outlogds loop added in #476 reads each record with input; but never copies the buffer into the declared line variable, so every row of the captured Viya job log has LINE missing. Assign line=_infile_ after input, matching the ms_runstp read fixed in the same PR.
There was a problem hiding this comment.
Reviewed the full diff: the Viya outlogds read loop in xplatform/mx_execute.sas now assigns line=infile inside the do-while, mirrored in the generated all.sas. That matches the existing infile idiom elsewhere in the same macro, and the SAS 9 branch that only creates an empty dataset is unaffected.
Reviewed the diff - no blocking issues found.
The Test 3 volume assertion carries an unquoted comma in desc=, so SAS reads everything after it as a positional parameter: 'All positional parameters must precede keyword parameters', every following statement in the test then fails to compile, and the suite reports no results at all. Reworded without the comma so &loglines still resolves.
|
Ran the suite against the SASjs Server estate ( 13 of 13 assertions PASS, and the SAS log for the run contains no
The first run failed, and it was a test defectThe suite reported no results at all ( Fixed in e45a16a by rewording without the comma ( Scope of this evidenceThis exercises the SASjs Server path only. The Viya branch - the one this PR changes - is not reachable from a SASjs Server target, so it remains code-review only; there is no Viya session available here to run the suite against. |
|
🎉 This PR is included in version 6.1.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
`@sasjs/lint` 4.4.0 carries the author-time half of this work (sasjs/lint#265): the `noNestedCommentsInHeader` rule, and the `hasDoxygenHeader` check and fix for a header that closes with a single asterisk. Both report at WARNING, so a project's lint return code does not change on upgrade. `@sasjs/core` 6.1.1 is the `mx_execute` fix for the Viya outlogds step (sasjs/core#477) - a patch with no API change. The bumps ride in this PR because both touch `package.json` and `package-lock.json`, which this branch already changes for `@sasjs/utils` 4.1.1; two PRs editing the same lockfile would only conflict. Verified with `npm ci` against the new lockfile: lint 4.4.0, core 6.1.1 and utils 4.1.1 resolve; `npm audit --production --audit-level=low` reports no vulnerabilities.
The compile-time half of this (sasjs/utils#288) and the author-time half (sasjs/lint#265) are released; this brings them to the CLI and names the file in the error. `removeHeader` takes the source path from `@sasjs/utils` 4.1.1, so both call sites that read a file and strip its header pass it: the compile path for `SASJsFileType.file`, and the build path that reads program files. A truncated header used to report line numbers with no file name on those paths, which is the failure the check exists to prevent. Dependencies, all in this one commit because they share `package-lock.json`: - `@sasjs/utils` ^4.1.0 -> ^4.1.1, the release carrying the path argument. - `@sasjs/lint` ^4.3.2 -> ^4.4.0, carrying `noNestedCommentsInHeader` and the `hasDoxygenHeader` single-asterisk close check and fix. Both report at WARNING, so a project's lint return code does not change on upgrade. - `@sasjs/core` ^6.0.0 -> ^6.1.1, the `mx_execute` Viya outlogds fix (sasjs/core#477) - a patch with no API change. The `@sasjs/lint` devDependencies entry is gone: it is a runtime dependency of `src/commands/lint/processLint.ts`, so the second declaration was dead weight. Its peer range moves to ^4.4.0, since 4.4.0 is where the rule the CLI ships comes from. One unplanned effect of the lint bump: 4.3.2 pinned `@sasjs/utils` exactly and nested a second copy at 4.0.0 under `node_modules/@sasjs/lint`. 4.4.0 ranges it, so the tree carries a single utils at 4.1.1 and the lockfile loses 49 lines. That nesting is why these remain caret ranges rather than exact pins. CI: `.github/workflows/run-tests.yml` gains `HTTP_PORT=5000` in the server `.env`. `sasjs/server` 3.0.0 (released 2026-10-26 23:35) refuses to start with no listener enabled, and the job downloads `releases/latest`, so the server step failed before any test ran on every PR opened since. The wait step polls port 5000, which is why that is the port. Verified: `npm ci` on the new lockfile (one copy of each package), `npm audit --production` clean, tsc and prettier clean, mocked suite 629 passed with only the environmental `printVersion` failure that also fails on main in this environment. The new spec fails with the path argument reverted.
The compile-time half of this (sasjs/utils#288) and the author-time half (sasjs/lint#265) are released; this brings them to the CLI and names the file in the error. What changes for a project: a SAS file whose doxygen header is cut short by a block comment inside it used to compile, and the header text after the cut was handed to SAS as code. It now fails the compile with a message naming the file and the lines involved. The input cannot compile - SAS block comments do not nest, so the first `*/` ends the comment - and the old behaviour silently ran whatever followed. This is the check from @sasjs/utils 4.1.1, which this release adopts. `removeHeader` takes the source path from @sasjs/utils 4.1.1, so both call sites that read a file and strip its header pass it: the compile path for `SASJsFileType.file`, and the build path that reads program files. Without it the diagnostic reported line numbers with no file name on exactly the paths where a user meets it. Dependencies, all in this one commit because they share `package-lock.json`: - `@sasjs/utils` ^4.1.0 -> ^4.1.1, the release carrying the path argument. - `@sasjs/lint` ^4.3.2 -> ^4.4.0 in `devDependencies` and `peerDependencies`, carrying `noNestedCommentsInHeader` and the `hasDoxygenHeader` single-asterisk close check and fix. Both report at WARNING, so a project's lint return code does not change on upgrade. The declaration stays peer plus dev, as on main: lint is imported at runtime and npm 7+ installs a peer automatically, so it is not promoted to a hard dependency. - `@sasjs/core` ^6.0.0 -> ^6.1.1, the `mx_execute` Viya outlogds fix (sasjs/core#477) - a patch with no API change. One unplanned effect of the lint bump: 4.3.2 pinned `@sasjs/utils` exactly and nested a second copy at 4.0.0 under `node_modules/@sasjs/lint`. 4.4.0 ranges it, so the tree carries a single utils at 4.1.1 and the lockfile loses 49 lines. That nesting is why these remain caret ranges rather than exact pins. CI: `.github/workflows/run-tests.yml` gains `HTTP_PORT=5000` in the server `.env`. `sasjs/server` 3.0.0 (released 2026-10-26 23:35) refuses to start with no listener enabled, and the job downloads `releases/latest`, so the server step failed before any test ran on every PR opened since. The wait step polls port 5000, which is why that is the port. Verified: `npm ci` on the new lockfile (one copy of each package), `npm audit --production` clean, tsc and prettier clean, mocked suite 629 passed with only the environmental `printVersion` failure that also fails on main in this environment. The spec that pins the file name fails when the path argument is reverted, and asserts the diagnostic's shape rather than the library's wording.
The compile-time half of this (sasjs/utils#288) and the author-time half (sasjs/lint#265) are released; this brings them to the CLI and names the file in the error. What changes for a project: a SAS file whose doxygen header is cut short by a block comment inside it used to compile, and the header text after the cut was handed to SAS as code. It now fails the compile with a message naming the file and the lines involved. The input cannot compile - SAS block comments do not nest, so the first `*/` ends the comment - and the old behaviour silently ran whatever followed. This is the check from @sasjs/utils 4.1.1, which this release adopts. `removeHeader` takes the source path from @sasjs/utils 4.1.1, so both call sites that read a file and strip its header pass it: the compile path for `SASJsFileType.file`, and the build path that reads program files. Without it the diagnostic reported line numbers with no file name on exactly the paths where a user meets it. Dependencies, all in this one commit because they share `package-lock.json`: - `@sasjs/utils` ^4.1.0 -> ^4.1.1, the release carrying the path argument. - `@sasjs/lint` ^4.3.2 -> ^4.4.0 in `devDependencies` and `peerDependencies`, carrying `noNestedCommentsInHeader` and the `hasDoxygenHeader` single-asterisk close check and fix. Both report at WARNING, so a project's lint return code does not change on upgrade. The declaration stays peer plus dev, as on main: lint is imported at runtime and npm 7+ installs a peer automatically, so it is not promoted to a hard dependency. - `@sasjs/core` ^6.0.0 -> ^6.1.1, the `mx_execute` Viya outlogds fix (sasjs/core#477) - a patch with no API change. One unplanned effect of the lint bump: 4.3.2 pinned `@sasjs/utils` exactly and nested a second copy at 4.0.0 under `node_modules/@sasjs/lint`. 4.4.0 ranges it, so the tree carries a single utils at 4.1.1 and the lockfile loses 49 lines. That nesting is why these remain caret ranges rather than exact pins. CI: `.github/workflows/run-tests.yml` gains `HTTP_PORT=5000` in the server `.env`. `sasjs/server` 3.0.0 (released 2026-10-26 23:35) refuses to start with no listener enabled, and the job downloads `releases/latest`, so the server step failed before any test ran on every PR opened since. The wait step polls port 5000, which is why that is the port. Verified: `npm ci` on the new lockfile (one copy of each package), `npm audit --production` clean, tsc and prettier clean, mocked suite 629 passed with only the environmental `printVersion` failure that also fails on main in this environment. The spec that pins the file name fails when the path argument is reverted, and asserts the diagnostic's shape rather than the library's wording.
The compile-time half of this (sasjs/utils#288) and the author-time half (sasjs/lint#265) are released; this brings them to the CLI and names the file in the error. What changes for a project: a SAS file whose doxygen header is cut short by a block comment inside it used to compile, and the header text after the cut was handed to SAS as code. It now fails the compile with a message naming the file and the lines involved. The input cannot compile - SAS block comments do not nest, so the first `*/` ends the comment - and the old behaviour silently ran whatever followed. This is the check from @sasjs/utils 4.1.1, which this release adopts. `removeHeader` takes the source path from @sasjs/utils 4.1.1, so both call sites that read a file and strip its header pass it: the compile path for `SASJsFileType.file`, and the build path that reads program files. Without it the diagnostic reported line numbers with no file name on exactly the paths where a user meets it. Dependencies, all in this one commit because they share `package-lock.json`: - `@sasjs/utils` ^4.1.0 -> ^4.1.1, the release carrying the path argument. - `@sasjs/lint` ^4.3.2 -> ^4.4.0 in `devDependencies` and `peerDependencies`, carrying `noNestedCommentsInHeader` and the `hasDoxygenHeader` single-asterisk close check and fix. Both report at WARNING, so a project's lint return code does not change on upgrade. The declaration stays peer plus dev, as on main: lint is imported at runtime and npm 7+ installs a peer automatically, so it is not promoted to a hard dependency. - `@sasjs/core` ^6.0.0 -> ^6.1.1, the `mx_execute` Viya outlogds fix (sasjs/core#477) - a patch with no API change. One unplanned effect of the lint bump: 4.3.2 pinned `@sasjs/utils` exactly and nested a second copy at 4.0.0 under `node_modules/@sasjs/lint`. 4.4.0 ranges it, so the tree carries a single utils at 4.1.1 and the lockfile loses 49 lines. That nesting is why these remain caret ranges rather than exact pins. CI: `.github/workflows/run-tests.yml` gains `HTTP_PORT=5000` in the server `.env`. `sasjs/server` 3.0.0 (released 2026-10-26 23:35) refuses to start with no listener enabled, and the job downloads `releases/latest`, so the server step failed before any test ran on every PR opened since. The wait step polls port 5000, which is why that is the port. Verified: `npm ci` on the new lockfile (one copy of each package), `npm audit --production` clean, tsc and prettier clean, mocked suite 629 passed with only the environmental `printVersion` failure that also fails on main in this environment. The spec that pins the file name fails when the path argument is reverted, and asserts the diagnostic's shape rather than the library's wording.
…1500) The compile-time half of this (sasjs/utils#288) and the author-time half (sasjs/lint#265) are released; this brings them to the CLI and names the file in the error. What changes for a project: a SAS file whose doxygen header is cut short by a block comment inside it used to compile, and the header text after the cut was handed to SAS as code. It now fails the compile with a message naming the file and the lines involved. The input cannot compile - SAS block comments do not nest, so the first `*/` ends the comment - and the old behaviour silently ran whatever followed. This is the check from @sasjs/utils 4.1.1, which this release adopts. `removeHeader` takes the source path from @sasjs/utils 4.1.1, so both call sites that read a file and strip its header pass it: the compile path for `SASJsFileType.file`, and the build path that reads program files. Without it the diagnostic reported line numbers with no file name on exactly the paths where a user meets it. Dependencies, all in this one commit because they share `package-lock.json`: - `@sasjs/utils` ^4.1.0 -> ^4.1.1, the release carrying the path argument. - `@sasjs/lint` ^4.3.2 -> ^4.4.0 in `devDependencies` and `peerDependencies`, carrying `noNestedCommentsInHeader` and the `hasDoxygenHeader` single-asterisk close check and fix. Both report at WARNING, so a project's lint return code does not change on upgrade. The declaration stays peer plus dev, as on main: lint is imported at runtime and npm 7+ installs a peer automatically, so it is not promoted to a hard dependency. - `@sasjs/core` ^6.0.0 -> ^6.1.1, the `mx_execute` Viya outlogds fix (sasjs/core#477) - a patch with no API change. One unplanned effect of the lint bump: 4.3.2 pinned `@sasjs/utils` exactly and nested a second copy at 4.0.0 under `node_modules/@sasjs/lint`. 4.4.0 ranges it, so the tree carries a single utils at 4.1.1 and the lockfile loses 49 lines. That nesting is why these remain caret ranges rather than exact pins. CI: `.github/workflows/run-tests.yml` gains `HTTP_PORT=5000` in the server `.env`. `sasjs/server` 3.0.0 (released 2026-10-26 23:35) refuses to start with no listener enabled, and the job downloads `releases/latest`, so the server step failed before any test ran on every PR opened since. The wait step polls port 5000, which is why that is the port. Verified: `npm ci` on the new lockfile (one copy of each package), `npm audit --production` clean, tsc and prettier clean, mocked suite 629 passed with only the environmental `printVersion` failure that also fails on main in this environment. The spec that pins the file name fails when the path argument is reverted, and asserts the diagnostic's shape rather than the library's wording. Co-authored-by: [email protected] <[email protected]>
Follow-up to the first finding in the post-merge review of #476.
The Viya
outlogdsloop reads each job-log record withinput;but never copies the buffer into the declaredlinevariable, sooutlogdscomes back with the right number of rows andLINEmissing on every one of them. The dataset looked populated while carrying no log text.This assigns
line=_infile_;straight afterinput;, the same wayms_runstp.sasreads the chopped log in #476 (and theputlogstep a few lines above already relies on_infile_).sasjs lint: exit 0, no errors or warnings inxplatform/mx_execute.sas.tests/x-platform/mx_execute.test.sasagainst, so Test 3 has not been re-executed on Viya. The SASjs Server path is untouched by this change.all.sasis generated by the pipeline; not edited here.