Skip to content

fix(scripts): resolve the test's script path natively, and record a drifted example folder (iou-architectuur#105) - #237

Merged
sgort merged 1 commit into
accfrom
fix/audit-105-source-fixes
Sep 29, 2026
Merged

sgort merged 1 commit into
accfrom
fix/audit-105-source-fixes

Conversation

@sgort

@sgort sgort commented Sep 29, 2026

Copy link
Copy Markdown
Owner

Items 5 and 6 of sgort/iou-architectuur#105.

5 — test:scripts failed on Windows, and took the second suite with it

scripts/promotion-targets.test.mjs:8 resolved the script under test with new URL(...).pathname. On Windows that is /C:/Users/.../promotion-targets.mjs — the leading slash makes it not a native path, so execFileSync(process.execPath, [SCRIPT, …]) could not resolve it and every command-line check failed.

Demonstrated rather than assumed, from this Linux host:

.pathname                          /C:/Users/.../promotion-targets.mjs
fileURLToPath(url, {windows:true})  C:\Users\...\promotion-targets.mjs

The script itself was never at fault — run by hand it answered correctly and exited 0, and Linux CI passed throughout, so only Windows contributors saw it. Knock-on: test:scripts joins the two suites with &&, so dso-dossier.test.mjs never ran there either.

Now fileURLToPath(new URL(...)), which gives a native path on every platform.

A guard goes with it. The test exits 1 if SCRIPT is not an existing path — portable, and exactly how the bug hid: false on Windows, true everywhere else. The same mistake cannot return silently.

The other scripts were checked, as the issue asked. dso-dossier.test.mjs uses .href for a dynamic import, which is correct; this file's other two uses (line 27 .href, line 155 a URL passed to readFileSync) are both fine. One line needed changing.

Both suites pass: 24 checks each, and test:scripts now runs both.

6 — four of the five were already fixed; the fifth is a folder the repo has written off

The issue found camunda:formKey="embedded:deployment:awb-missing-info-form.html" in five files, naming a form that exists nowhere. Four are already fixed on acc: the seeded and fixture copies of AwbShellProcess and AwbZorgtoeslagProcess now carry camunda:formRef to kapvergunning-aanvullende-gegevens and zorgtoeslag-aanvullende-gegevens, both of which exist — so Gateway_StillIncomplete's ${supplementReceived} branch has something that can set it.

The fifth is examples/organizations/flevoland/thuisbatterij/, which this repository has already written off in two places:

  • e2e-fixtures/manifest.json — the fixture came from the deployed bundle "not from examples/organizations/flevoland/thuisbatterij/ — that folder's -main/-subprocess pair and its two forms have drifted behind what is actually deployed"
  • the 2026-09-24 swimlanes plan — "Source of truth: packages/frontend/public/examples/flevoland/. examples/organizations/flevoland/thuisbatterij/ is not touched."

Reading it against the tree shows the drift is wider than the item. -main.bpmn references three forms that exist nowhere, not one:

reference exists
thuisbatterij-subsidie-start ✗
awb-missing-info-form.html ✗ — the one item 6 names
thuisbatterij-notify-applicant ✗

The maintained copy's three all resolve.

So the BPMN is left as it is and a README records what the folder is. Repairing one of three dangling references would fix a third of the problem while making a written-off file look maintained; repairing all three would mean re-deriving a definition the repository has already replaced. Neither existing statement about this folder is visible from inside it, which is the gap the README closes — and it says to delete itself if the folder is ever made current.

If you would rather have the BPMN repaired outright, say so and I will — it is a different call, not a harder one.

Checks

test:scripts 24 + 24 · check-rip-bpmn-copies green (12 fingerprinted, 2 fixture copies identical) · prettier --check clean on both changed files.

…rifted example folder

Items 5 and 6 of sgort/iou-architectuur#105.

## 5. test:scripts failed on Windows, and took the second suite with it

scripts/promotion-targets.test.mjs resolved the script under test with

    new URL('./promotion-targets.mjs', import.meta.url).pathname

On Windows that is '/C:/Users/.../promotion-targets.mjs' -- the leading slash
makes it not a native path, so execFileSync(process.execPath, [SCRIPT, ...])
could not resolve it and every command-line check failed. Demonstrated rather
than assumed, on this Linux host:

    .pathname                        /C:/Users/.../promotion-targets.mjs
    fileURLToPath(url,{windows:true})  C:\Users\...\promotion-targets.mjs

The script itself was never at fault -- run by hand it answered correctly and
exited 0, and Linux CI passed throughout, so only Windows contributors saw it.
A knock-on: test:scripts joins the two suites with &&, so dso-dossier.test.mjs
never ran there either.

Now fileURLToPath(new URL(...)), which gives a native path on every platform.

A guard goes with it: the test exits 1 if SCRIPT is not an existing path. That
is portable and it is exactly how the bug hid -- false on Windows, true
everywhere else -- so the same mistake cannot return silently.

The issue asked for the other scripts to be checked for the same pattern.
dso-dossier.test.mjs uses .href for a dynamic import, which is correct;
promotion-targets.test.mjs's other two uses (line 27 .href, line 155 a URL
passed to readFileSync) are both fine. Only the one line needed changing.

Both suites pass here: 24 checks each, and test:scripts now runs both.

## 6. The AWB missing-information form -- four of five were already fixed

The issue found camunda:formKey="embedded:deployment:awb-missing-info-form.html"
in five files, referring to a form that exists nowhere. Four are fixed on acc
already: the seeded and fixture copies of AwbShellProcess and
AwbZorgtoeslagProcess now carry camunda:formRef to
kapvergunning-aanvullende-gegevens and zorgtoeslag-aanvullende-gegevens, both
of which exist, so Gateway_StillIncomplete's ${supplementReceived} branch has
something that can set it.

The fifth is examples/organizations/flevoland/thuisbatterij/, which this
repository has already written off: e2e-fixtures/manifest.json says the fixture
was taken from the deployed bundle "not from
examples/organizations/flevoland/thuisbatterij/ -- that folder's -main/-subprocess
pair and its two forms have drifted behind what is actually deployed", and the
2026-09-24 swimlanes plan says the source of truth is
packages/frontend/public/examples/flevoland/ and that folder is not touched.

Reading it against the tree shows the drift is wider than the item: -main.bpmn
references THREE forms that exist nowhere, not one --
thuisbatterij-subsidie-start, awb-missing-info-form.html and
thuisbatterij-notify-applicant. The maintained copy's three all resolve.

So the file is left as it is, and a README records what the folder is. Fixing
one of three dangling references would fix a third of the problem while making
a written-off file look maintained; fixing all three would mean re-deriving a
definition the repository has already replaced. Neither of the two existing
statements about this folder is visible from inside it, which is the gap the
README closes -- and it says to delete itself if the folder is ever made
current.
@sgort
sgort merged commit 8c9a507 into acc Sep 29, 2026
10 checks passed
@sgort
sgort deleted the fix/audit-105-source-fixes branch September 29, 2026 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant