Skip to content

Commit c12341e

Browse files
committed
docs(ci): refresh scripts README for the final pipeline design
- determine-nt-version.mjs (Python toolchain removed) - build-vs-test scope split (e2e-only changes test but don't build) + full_build output - PR scoping now diffs against the base merge-base
1 parent 70f6f14 commit c12341e

1 file changed

Lines changed: 48 additions & 19 deletions

File tree

.github/scripts/README.md

Lines changed: 48 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,43 +4,72 @@ This directory contains helper scripts used by the CI/CD pipeline.
44

55
## determine-widget-scope.sh
66

7-
Determines which widgets and JS actions should be built and tested based on changed files or manual input.
7+
Determines which widgets and JS actions should be built and tested, based on the
8+
files changed in a PR or on manual `workflow_dispatch` input.
89

910
### Usage
1011

1112
```bash
12-
./determine-widget-scope.sh <event_name> <input_workspace> <before_commit> <current_commit>
13+
./determine-widget-scope.sh <event_name> <input_workspace> <base_commit> <current_commit>
1314
```
1415

16+
For a `pull_request`, `<base_commit>` is the PR base SHA
17+
(`github.event.pull_request.base.sha`). The script diffs against the **merge-base** of
18+
that and `<current_commit>`, so every commit in the PR is considered (not just the
19+
latest). This needs full git history — the `scope` job checks out with `fetch-depth: 0`.
20+
On `workflow_dispatch`, `<input_workspace>` drives the scope and the commit args are
21+
ignored.
22+
1523
### Outputs
1624

17-
| Output | Description |
18-
| -------------------- | ---------------------------------------------------- |
19-
| `scope` | pnpm filter scope for building |
20-
| `widgets` | JSON array of widgets to BUILD |
21-
| `widgets_to_test` | JSON array of widgets to TEST (used for test matrix) |
22-
| `js_actions_changed` | Boolean flag indicating if JS actions changed |
25+
| Output | Description |
26+
| -------------------- | -------------------------------------------------------------------------------- |
27+
| `scope` | pnpm filter scope (used by the unit-test step) |
28+
| `widgets` | JSON array of widgets to BUILD |
29+
| `widgets_to_test` | JSON array of widgets to TEST (the test matrix) |
30+
| `js_actions_changed` | Boolean — whether JS actions changed |
31+
| `full_build` | Boolean — true when every widget is (re)built; gates the dist cache restore/save |
32+
33+
### Build vs. test scope
34+
35+
`widgets_to_test` and `widgets` are deliberately **separate**:
36+
37+
- A change anywhere under a widget folder marks it for **testing**.
38+
- Only a **build-affecting** change (anything outside the widget's `e2e/` folder, e.g.
39+
`src/**` or `package.json`) marks it for **building**. A change confined to `e2e/`
40+
(Maestro flows / screenshots) changes only the test, so the widget is tested against
41+
the test project's baseline `.mpk` instead of being rebuilt.
42+
43+
So `widgets` can be a strict subset of `widgets_to_test` (or empty while
44+
`widgets_to_test` is non-empty, for an e2e-only PR).
2345

2446
### Pipeline Behavior
2547

26-
| Scenario | Widgets Built | Widgets Tested | JS Actions Built | JS Actions Tested |
27-
| ---------------------- | --------------- | --------------- | ---------------- | ----------------- |
28-
| Only JS actions change | All | None | Yes | Yes |
29-
| Only widgets change | Changed only | Changed only | No | No |
30-
| Both change | Changed widgets | Changed widgets | Yes | Yes |
31-
| Full run (`*-native`) | All | All | Yes | Yes |
32-
| Manual: `js-actions` | All | None | Yes | Yes |
48+
| Scenario | Widgets Built | Widgets Tested | JS Actions Built | JS Actions Tested |
49+
| ------------------------------- | ---------------------- | --------------- | ---------------- | ----------------- |
50+
| Only JS actions change | All | None | Yes | Yes |
51+
| Only widget `src`/deps change | Changed only | Changed only | No | No |
52+
| Only widget `e2e/` changes | None (use baseline) | Changed only | No | No |
53+
| Both widgets and JS actions | Build-affected widgets | Changed widgets | Yes | Yes |
54+
| Full run (`*-native` / default) | All | All | Yes | Yes |
55+
| Manual: `js-actions` | All | None | Yes | Yes |
3356

3457
### Why build all widgets when only JS actions change?
3558

36-
The JS action tests run against a full test project that requires all widgets to be present. Without building all widgets, the test project would be incomplete and tests would fail.
59+
The JS action tests run against a full test project that requires all widgets to be
60+
present. Without building all widgets, the test project would be incomplete and tests
61+
would fail.
3762

3863
## Other Scripts
3964

40-
- **determine-nt-version.py** - Determines the Native Template version based on Mendix version
41-
- **mxbuild.Dockerfile** - Docker image for mxbuild
65+
- **determine-nt-version.mjs** — resolves the Native Template release/branch from the
66+
Mendix version. Node ESM, no external deps (uses global `fetch` + a small version
67+
comparator); run with the runner's preinstalled `node`. Replaced the former
68+
`determine-nt-version.py` (the Python toolchain — `setup-python` / `pip install`
69+
was dropped). Fails loudly rather than silently pinning `master`.
70+
- **mxbuild.Dockerfile** — Docker image for mxbuild.
4271

43-
> The Mendix runtime for the test jobs is now produced as a **portable app package**
72+
> The Mendix runtime for the test jobs is produced as a **portable app package**
4473
> (`mxbuild --target=portable-app-package`) in the `project` job and started by the
4574
> `start-mendix-runtime` composite action, which waits for a real readiness probe.
4675
> This replaced the old `setup-runtime.sh` / `start-runtime-with-verification.sh`

0 commit comments

Comments
 (0)