Skip to content

Commit 5cf8ea6

Browse files
committed
docs: document Sigima snapshot and release workflow
Refs #18 Assisted-by: GPT-5.6 Sol
1 parent 0268ec5 commit 5cf8ea6

6 files changed

Lines changed: 108 additions & 23 deletions

File tree

‎.env.template‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
#
33
# Copy this file to ``.env`` and adjust ``PYTHONPATH`` to point at your
44
# local sibling checkouts of Sigima and guidata (or remove those entries
5-
# entirely if you installed them with ``pip install -r requirements-dev.txt``
6-
# and want to use the wheels from PyPI).
5+
# entirely if you used ``scripts/sigima_dependency.py install`` and want to
6+
# exercise the manifest-selected packages instead). Sibling paths always take
7+
# priority over packages installed in the virtual environment.
78
#
89
# The Python interpreter itself is the project-local virtualenv created
910
# with::
1011
#
1112
# py -3.11 -m venv .venv
12-
# .\.venv\Scripts\python -m pip install -r requirements-dev.txt
13+
# .\.venv\Scripts\python scripts\sigima_dependency.py install
1314
#
1415
# ``scripts/run_with_env.py`` automatically picks up ``.venv\Scripts\python``
1516
# when no ``PYTHON`` override is set. Set ``PYTHON=...`` here only if you
@@ -21,7 +22,8 @@
2122

2223
PYTHONPATH=.;..\Sigima;..\guidata
2324

24-
# Pyodide cannot import sibling source trees through PYTHONPATH. To exercise
25-
# unreleased Sigima changes in the browser, build a wheel under ../Sigima/dist
26-
# and point Vite at it with an absolute /@fs/ URL (use forward slashes):
25+
# Pyodide cannot import sibling source trees through PYTHONPATH. During rapid
26+
# local iteration, build the sibling checkout under ../Sigima/dist and point
27+
# Vite at it with an absolute /@fs/ URL (use forward slashes). This local value
28+
# overrides both fields in sigima-dependency.json for browser runtimes only:
2729
# VITE_SIGIMA_INSTALL_SPEC=/@fs/C:/path/to/Sigima/dist/sigima-X.Y.Z-py3-none-any.whl

‎.vscode/tasks.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@
466466
},
467467
{
468468
"label": "📦 Release Package (app + SDK)",
469-
"detail": "Lint + Vitest + build, then produce datalab-web-<v>.tgz and datalab-platform-web-sdk-<v>.tgz under release/.",
469+
"detail": "Sigima release guard + lint + Vitest + qualified build, then produce both tarballs under release/.",
470470
"type": "shell",
471471
"command": "npm",
472472
"args": ["run", "release:pack"],

‎CONTRIBUTING.md‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,34 @@ DataLab-Web is fully internationalised: English is the source language and Frenc
8181

8282
DataLab-Web sometimes backports a feature or patches a bug that is fixed upstream (`guidata`, `sigima`, …) but not yet in a released wheel. These **temporary shims** are tracked centrally so they can be audited and removed once upstream catches up. Every backport shim is declared once in [src/runtime/shims/registry.ts](src/runtime/shims/registry.ts), carries `# TEMPORARY SHIM` / `@shim-registry: <id>` markers in its source, and is kept in sync by a network-free anti-drift test that runs in `npm test`. Use `npm run audit:shims` for the fast PyPI/lockfile pre-audit and `npm run audit:shims:runtime` to verify the versions actually installed in Pyodide. A `ready-to-remove` version result is only a candidate: focused contract or E2E tests must also prove native behavioral parity before the shim is deleted. The full workflow is in [doc/shim-registry.md](doc/shim-registry.md).
8383

84+
## Sigima development snapshots
85+
86+
When DataLab-Web needs a Sigima change that is merged but not yet published,
87+
declare it in [sigima-dependency.json](sigima-dependency.json). Keep
88+
`publishedRequirement` as the exact release target (`sigima==X.Y.Z`) and set
89+
`developmentRef` to the full lowercase 40-character commit SHA. Branch names,
90+
tags, abbreviated SHAs and version ranges are rejected because they are not an
91+
immutable, release-qualified dependency.
92+
93+
Do not add a source URL to [requirements-dev.txt](requirements-dev.txt) or copy
94+
the SHA into a workflow. The following command installs the common Python
95+
requirements and then resolves the configured Sigima selection:
96+
97+
```powershell
98+
.\.venv\Scripts\python scripts\sigima_dependency.py install
99+
```
100+
101+
The `PYTHONPATH` entries in `.env` take priority over installed packages;
102+
remove `..\Sigima` when the purpose of the test is to qualify the exact SHA
103+
declared in the manifest.
104+
105+
CI uses the same resolver to build the Pyodide wheel. A non-null
106+
`developmentRef` blocks `release:guard`, `release:pack`, the tag helper and the
107+
release workflow. After the exact target version is published, qualify CPython
108+
and Pyodide without `PYTHONPATH` or `VITE_SIGIMA_INSTALL_SPEC`, then set
109+
`developmentRef` to `null`. See [doc/releasing.md](doc/releasing.md) for the
110+
release checklist.
111+
84112
## Branching model
85113

86114
DataLab-Web follows the same two-branch model as the sibling repositories (DataLab, Sigima): day-to-day work lands on **`develop`**, and **`main`** is the release branch — `develop` is merged into `main` only when cutting a real release. CI ([tests.yml](.github/workflows/tests.yml)) runs the cheap regression suite on both branches and on pull requests targeting either. The multi-minute performance benchmarks are **not** part of that run; they are opt-in and driven by a separate on-demand workflow (see the **Performance benchmarks** section of [doc/testing-strategy.md](doc/testing-strategy.md)).

‎README.md‎

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,25 @@ The first dev load downloads Pyodide (~10 MB) and installs Sigima via `micropip`
6464

6565
### Testing unreleased Sigima changes
6666

67-
`PYTHONPATH` makes the sibling Sigima checkout available to the CPython tests,
68-
but the browser's Pyodide runtime requires a wheel. To test DataLab-Web against
69-
changes on Sigima's `develop` branch before they are released, first build the
70-
sibling checkout:
67+
Cross-repository integration snapshots are declared once in
68+
[`sigima-dependency.json`](sigima-dependency.json). `publishedRequirement` is
69+
the exact PyPI version qualified for releases; `developmentRef` is either
70+
`null` or a full 40-character commit SHA already merged into Sigima. The test
71+
and performance workflows turn that immutable SHA into both the CPython
72+
requirement and the Pyodide wheel. Install the same configured dependency
73+
locally with:
74+
75+
```powershell
76+
.\.venv\Scripts\python scripts\sigima_dependency.py install
77+
```
78+
79+
If `.env` still includes `..\Sigima` in `PYTHONPATH`, that sibling checkout
80+
intentionally takes priority for CPython. Remove the entry when qualifying the
81+
exact manifest-selected snapshot.
82+
83+
For rapid work on an uncommitted sibling checkout, `PYTHONPATH` makes the local
84+
Sigima sources available to CPython, but the browser still requires a wheel.
85+
Build that checkout directly:
7186

7287
```powershell
7388
cd ..\Sigima
@@ -85,8 +100,15 @@ VITE_SIGIMA_INSTALL_SPEC=/@fs/C:/Dev/Sigima/dist/sigima-X.Y.Z-py3-none-any.whl
85100
Replace `X.Y.Z` with the generated filename, then use the usual `npm run dev`
86101
or Playwright commands. The override applies to the main runtime and the macro
87102
and notebook workers. Rebuild the wheel and restart Vite after each Sigima
88-
change. Remove the line to return to the released PyPI requirement; `/@fs/`
89-
URLs are for local development only and must not be used for release builds.
103+
change. This ignored `.env` override takes priority over the published
104+
requirement but does not change the versioned CI snapshot. Remove the line to
105+
return to the exact PyPI requirement; `/@fs/` URLs are for local development
106+
only and must not be used for release builds.
107+
108+
Any non-null `developmentRef` deliberately blocks DataLab-Web releases. Once
109+
the target Sigima version is published and qualified without a local override,
110+
set the field to `null`; the generalized snapshot mechanism remains available
111+
for the next coordinated change.
90112

91113
## Documentation
92114

‎doc/releasing.md‎

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,40 @@
22

33
## Versioning
44

5-
The application version is declared **once**, in `package.json`, and is injected into the bundle at build time via Vite's `define` option (see `vite.config.ts`). The _Help → About_ dialog reads it from `import.meta.env.VITE_APP_VERSION`.
5+
The application version is declared in `package.json`, kept aligned with `packages/sdk/package.json`, and injected into the bundle at build time via Vite's `define` option (see `vite.config.ts`). The _Help → About_ dialog reads it from `import.meta.env.VITE_APP_VERSION`.
66

7-
To bump the version, use the standard npm command (it edits `package.json`, creates a commit, and tags it `vX.Y.Z`):
7+
Use the release helper to bump both packages, promote the changelog, create one commit and tag it `vX.Y.Z`:
88

99
```powershell
10-
npm version patch # bug fix: 0.1.0 → 0.1.1
11-
npm version minor # feature: 0.1.0 → 0.2.0
12-
npm version major # breaking: 0.1.0 → 1.0.0
10+
node scripts/release.mjs patch # bug fix: 0.1.0 → 0.1.1
11+
node scripts/release.mjs minor # feature: 0.1.0 → 0.2.0
12+
node scripts/release.mjs major # breaking: 0.1.0 → 1.0.0
1313
```
1414

15-
The next `npm run dev` or `npm run build` automatically picks up the new value — no other file needs to be edited.
15+
The push remains manual, providing a final checkpoint before the release workflow starts.
1616

17-
> **Keep `packages/sdk/package.json` in sync** — bump its `version` to the same value before tagging. The release CI fails if the two `package.json` files disagree.
17+
## Sigima release qualification
1818

19-
> **What `git push --tags` triggers** — the [`Release tarballs`](../.github/workflows/release.yml) workflow runs, in order: version coherence check (tag ↔ both `package.json` files) → `pytest tests/python` (3.11 + 3.12) and Playwright E2E (in parallel) → lint + Vitest + build + pack the two `.tgz` → publish a GitHub Release with the tarballs and auto-generated notes → deploy `dist/` to GitHub Pages. Any failing gate aborts the release **and** the deploy.
19+
[`sigima-dependency.json`](../sigima-dependency.json) separates the exact
20+
published requirement from the temporary integration snapshot. Before
21+
preparing a DataLab-Web release:
22+
23+
1. Confirm that `publishedRequirement` is an exact pin such as
24+
`sigima==1.3.0` and is available on PyPI.
25+
2. Run pytest and Playwright without a sibling Sigima `PYTHONPATH`, local wheel
26+
or `VITE_SIGIMA_INSTALL_SPEC`.
27+
3. Confirm the live Pyodide runtime reports that exact Sigima version.
28+
4. Set `developmentRef` to `null` only after those checks pass.
29+
30+
`npm run release:guard` performs the network-free structural checks. It blocks
31+
while any snapshot SHA is active and is called before `release:pack`, before
32+
the release helper mutates files, and by the release workflow before its other
33+
jobs. The release Python tests explicitly install `publishedRequirement`, and
34+
the release browser tests never build or export a development wheel.
35+
`release:pack` uses `build:release`, whose release mode ignores even an
36+
accidental `VITE_SIGIMA_INSTALL_SPEC` from the developer's ignored `.env`.
37+
38+
> **What `git push --tags` triggers** — the [`Release tarballs`](../.github/workflows/release.yml) workflow runs, in order: Sigima release guard and version coherence check (tag ↔ both `package.json` files) → `pytest tests/python` (3.11 + 3.12) and Playwright E2E against the published Sigima pin (in parallel) → lint + Vitest + build + pack the two `.tgz` → publish a GitHub Release with the tarballs and auto-generated notes → deploy `dist/` to GitHub Pages. Any failing gate aborts the release **and** the deploy.
2039
2140
## Distribution: app bundle + SDK tarballs
2241

@@ -30,7 +49,7 @@ DataLab-Web is shipped to integrators as **two `.tgz` artefacts** produced by th
3049
Generate them locally:
3150

3251
```powershell
33-
npm run release:pack # lint → test → build → SDK pack → app pack → summary
52+
npm run release:pack # guard → lint → test → build → SDK pack → app pack
3453
```
3554

3655
Or invoke each step independently (`npm run sdk:pack`, `npm run app:pack`). Output lands in `release/`.

‎doc/testing-strategy.md‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ A continuous layer ties the three together: GitHub Actions (`tests.yml`) runs al
2828
# introspection).
2929
Copy-Item .env.template .env
3030
py -3.11 -m venv .venv
31-
.\.venv\Scripts\python -m pip install -r requirements-dev.txt
31+
.\.venv\Scripts\python scripts\sigima_dependency.py install
3232
3333
# Python unit tests + coverage report (htmlcov-python/)
3434
.\.venv\Scripts\python -m pytest tests/python --cov=src/runtime --cov-report=html:htmlcov-python
@@ -49,6 +49,20 @@ npx playwright test --project=perf
4949
$env:PW_REPRO=1; npx playwright test --project=repro tests/e2e/_repro_x.spec.ts
5050
```
5151

52+
The resolver reads [sigima-dependency.json](../sigima-dependency.json). Normal
53+
test and performance CI use its `developmentRef` when one is configured;
54+
release CI explicitly selects `publishedRequirement`. The browser receives a
55+
development snapshot only as a wheel through `VITE_SIGIMA_INSTALL_SPEC`.
56+
For rapid local iteration, the ignored `.env` may point to a wheel built from
57+
the sibling checkout, and its `PYTHONPATH` may prioritize sibling Python
58+
sources, but neither alters the versioned CI selection. Remove those local
59+
overrides when qualifying the exact manifest-selected dependency.
60+
61+
When qualifying a published Sigima version for release, use a clean environment
62+
without `..\Sigima` in `PYTHONPATH` and without `VITE_SIGIMA_INSTALL_SPEC`.
63+
This ensures both pytest and Playwright exercise the exact PyPI version rather
64+
than a sibling checkout or cached local wheel.
65+
5266
Test layout:
5367

5468
```text

0 commit comments

Comments
 (0)