From 112ed0b1816d8570f276367e88a98bf2538a32ba Mon Sep 17 00:00:00 2001 From: Myles Scolnick Date: Tue, 24 Nov 2026 22:55:05 -0500 Subject: [PATCH 1/5] Use local release preparation with one final approval --- .github/workflows/release-checks.yml | 2 +- .github/workflows/release-pr.yml | 66 ------------------- .github/workflows/release-tag.yml | 6 +- RELEASING.md | 14 +++- .../tests/cli/test_release_checks.py | 15 ++--- scripts/release.sh | 2 +- 6 files changed, 23 insertions(+), 82 deletions(-) delete mode 100644 .github/workflows/release-pr.yml diff --git a/.github/workflows/release-checks.yml b/.github/workflows/release-checks.yml index 2cf34f2c..2db0baaf 100644 --- a/.github/workflows/release-checks.yml +++ b/.github/workflows/release-checks.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 with: persist-credentials: false - - uses: marimo-team/internal-gh-actions/release-contract@36a2bd9a76109b91c9dc0bc65bfab95c9b632a3b + - uses: marimo-team/internal-gh-actions/release-contract@3c6ddeb4b132541309e3c56bbca8b3605d24ecfd with: workflows: | ci.yml diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml deleted file mode 100644 index 1d60abd4..00000000 --- a/.github/workflows/release-pr.yml +++ /dev/null @@ -1,66 +0,0 @@ -run-name: "Release ${{ inputs.version }} requested by @${{ github.actor }}" -name: Prepare release PR -on: - workflow_dispatch: - inputs: - version: - description: Stable X.Y.Z version or patch, minor, major - type: string - required: true -permissions: {} -concurrency: - group: prepare-release-pr - cancel-in-progress: false -jobs: - prepare: - if: github.ref == 'refs/heads/main' - runs-on: ${{ vars.CI_RUNNER_SMALL || 'ubuntu-latest' }} - environment: release - timeout-minutes: 15 - permissions: - contents: read - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 - with: - ref: main - persist-credentials: false - - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 - with: - node-version: 24 - - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 - with: - version: "0.12.23" - - name: Prepare versions - id: version - uses: marimo-team/internal-gh-actions/prepare-release@36a2bd9a76109b91c9dc0bc65bfab95c9b632a3b - with: - version: ${{ inputs.version }} - - name: Open release PR - id: pr - uses: marimo-team/internal-gh-actions/release-pr@36a2bd9a76109b91c9dc0bc65bfab95c9b632a3b - with: - app-id: ${{ vars.RELEASE_APP_ID }} - private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }} - current-version: ${{ steps.version.outputs.current-version }} - manifest: ${{ steps.version.outputs.manifest }} - version: ${{ steps.version.outputs.version }} - files: ${{ steps.version.outputs.files }} - - name: Link release PR - env: - PR_URL: ${{ steps.pr.outputs.url }} - run: | - echo "$PR_URL" >> "$GITHUB_STEP_SUMMARY" - - notify-approval: - name: Notify release approval - if: github.ref == 'refs/heads/main' - runs-on: ${{ vars.CI_RUNNER_SMALL || 'ubuntu-latest' }} - timeout-minutes: 12 - permissions: - actions: read - pull-requests: read - contents: read - steps: - - uses: marimo-team/internal-gh-actions/release-approval-notification@0a3db0e04217aaa03b3d011502874b020e9466a3 - with: - slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL_RELEASES }} diff --git a/.github/workflows/release-tag.yml b/.github/workflows/release-tag.yml index 147d16e3..ac63e43f 100644 --- a/.github/workflows/release-tag.yml +++ b/.github/workflows/release-tag.yml @@ -40,7 +40,7 @@ jobs: version=$(node -p "require(process.env.RUNNER_TEMP + '/release-manifest.json').version") test -s ".github/release-notes/v$version.md" - name: Wait for merged commit checks - uses: marimo-team/internal-gh-actions/wait-for-workflows@ddcee43722c904b25d4ab57a238df11e1a506ed0 + uses: marimo-team/internal-gh-actions/wait-for-workflows@3c6ddeb4b132541309e3c56bbca8b3605d24ecfd with: commit: ${{ github.event.pull_request.merge_commit_sha }} workflows: | @@ -49,7 +49,7 @@ jobs: platforms.yml pages.yml - name: Tag merged release - uses: marimo-team/internal-gh-actions/release-tag@3a52681ab8e200a34175ec8e5d14985e4e7ce3c3 + uses: marimo-team/internal-gh-actions/release-tag@3c6ddeb4b132541309e3c56bbca8b3605d24ecfd with: app-id: ${{ vars.RELEASE_APP_ID }} private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }} @@ -66,6 +66,6 @@ jobs: pull-requests: read contents: read steps: - - uses: marimo-team/internal-gh-actions/release-approval-notification@0a3db0e04217aaa03b3d011502874b020e9466a3 + - uses: marimo-team/internal-gh-actions/release-approval-notification@3c6ddeb4b132541309e3c56bbca8b3605d24ecfd with: slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL_RELEASES }} diff --git a/RELEASING.md b/RELEASING.md index 557d1433..caa63003 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -7,8 +7,20 @@ Maintainers request a release with an authenticated GitHub CLI: ``` Accepts `patch`, `minor`, `major`, or a stable `X.Y.Z` version. -Review and merge the generated PR to approve publication. +Review and merge the generated PR after CI passes. Then another `marimo-eng` member +approves tagging in the protected `release` environment. Preparation needs no environment approval. See the [maintainer runbook](https://github.com/marimo-team/github-maintenance/blob/main/docs/releases.md) (internal). Add `.github/release-notes/vX.Y.Z.md` to the PR before merging. See [package checks and previews](development_docs/releasing.md) for repository-specific details. + +## Local preparation + +Install Node 22+, Git, Docker with a running local daemon, and the shared +[`gh release-control` command](https://github.com/marimo-team/internal-gh-actions#release-command). +Authenticate with `gh auth login`. + +The shortcut prepares fresh `main` in a credential-free Docker container and opens the PR +using your GitHub login. Your checkout stays untouched. Normal PR review and CI still apply. +Use `gh release-control request patch --dry-run` to validate without creating a PR. +Use `gh release-control status` to follow the PR, final approval, and publication. diff --git a/packages/marimo-studio/tests/cli/test_release_checks.py b/packages/marimo-studio/tests/cli/test_release_checks.py index 39878735..fe46ccfa 100644 --- a/packages/marimo-studio/tests/cli/test_release_checks.py +++ b/packages/marimo-studio/tests/cli/test_release_checks.py @@ -189,13 +189,13 @@ def test_distribution_checksums_cover_release_artifacts(tmp_path: Path) -> None: ] -def test_release_dispatches_main_without_local_git_changes(tmp_path: Path) -> None: +def test_release_requests_shared_preparation_without_local_git_changes(tmp_path: Path) -> None: script, binaries = _release_workspace(tmp_path, "release.sh") command_log = tmp_path / "commands" _write_executable(binaries / "git", "#!/bin/sh\nexit 93\n") _write_executable( binaries / "gh", - '#!/bin/sh\nprintf "%s\\n" "$@" > "$COMMAND_LOG"\n', + '#!/bin/sh\nprintf "%s\\n" "$@" "$GITHUB_REPOSITORY" > "$COMMAND_LOG"\n', ) completed = subprocess.run( [script, "0.3.0"], @@ -210,15 +210,10 @@ def test_release_dispatches_main_without_local_git_changes(tmp_path: Path) -> No ) assert completed.returncode == 0, completed.stderr assert command_log.read_text().splitlines() == [ - "workflow", - "run", - "release-pr.yml", - "--repo", + "release-control", + "request", + "0.3.0", "marimo-team/marimo-studio", - "--ref", - "main", - "-f", - "version=0.3.0", ] diff --git a/scripts/release.sh b/scripts/release.sh index a4cc626f..ac6d3047 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -8,4 +8,4 @@ if [[ ! "$1" =~ ^(patch|minor|major|(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0 printf 'Expected patch, minor, major, or a stable X.Y.Z version.\n' >&2 exit 2 fi -exec gh workflow run release-pr.yml --repo marimo-team/marimo-studio --ref main -f "version=$1" +GITHUB_REPOSITORY=marimo-team/marimo-studio exec gh release-control request "$1" From ce6bf3842af564498b055ed0b6ae426d4ed9b0f7 Mon Sep 17 00:00:00 2001 From: Myles Scolnick Date: Tue, 24 Nov 2026 23:06:59 -0500 Subject: [PATCH 2/5] Format the release shortcut contract test --- packages/marimo-studio/tests/cli/test_release_checks.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/marimo-studio/tests/cli/test_release_checks.py b/packages/marimo-studio/tests/cli/test_release_checks.py index fe46ccfa..38dd65d2 100644 --- a/packages/marimo-studio/tests/cli/test_release_checks.py +++ b/packages/marimo-studio/tests/cli/test_release_checks.py @@ -189,7 +189,9 @@ def test_distribution_checksums_cover_release_artifacts(tmp_path: Path) -> None: ] -def test_release_requests_shared_preparation_without_local_git_changes(tmp_path: Path) -> None: +def test_release_requests_shared_preparation_without_local_git_changes( + tmp_path: Path, +) -> None: script, binaries = _release_workspace(tmp_path, "release.sh") command_log = tmp_path / "commands" _write_executable(binaries / "git", "#!/bin/sh\nexit 93\n") From 93a820993da46d2ea04cbdc848f662de2b1ac222 Mon Sep 17 00:00:00 2001 From: Myles Scolnick Date: Tue, 24 Nov 2026 23:36:21 -0500 Subject: [PATCH 3/5] Isolate repair-page diagnostics and bound macOS process-test concurrency --- .github/actions/test-python/action.yml | 4 ++++ apps/e2e/tests/standalone-readiness.spec.ts | 3 +++ 2 files changed, 7 insertions(+) diff --git a/.github/actions/test-python/action.yml b/.github/actions/test-python/action.yml index d3cff98d..01142cef 100644 --- a/.github/actions/test-python/action.yml +++ b/.github/actions/test-python/action.yml @@ -26,6 +26,10 @@ runs: if [[ "${{ runner.os }}" != "Linux" && "${{ inputs.profile }}" != "supported-python" ]]; then parallel+=(--parallel) fi + # Native tests launch process trees; four macOS workers exceed their startup deadlines. + if [[ "${{ runner.os }}" == "macOS" && "${{ inputs.profile }}" == "native" ]]; then + export PYTEST_XDIST_AUTO_NUM_WORKERS=2 + fi ./scripts/python-test.sh \ --profile "${{ inputs.profile }}" \ --python "${{ inputs.python-version }}" \ diff --git a/apps/e2e/tests/standalone-readiness.spec.ts b/apps/e2e/tests/standalone-readiness.spec.ts index 9d1e8ad1..e8826dd5 100644 --- a/apps/e2e/tests/standalone-readiness.spec.ts +++ b/apps/e2e/tests/standalone-readiness.spec.ts @@ -456,6 +456,9 @@ test("a repair page in the frame reports its error at the top level", async ({ try { await standalone.goto(`${studioOrigin()}/dashboard/?file=notebook.py`); await expectTopLevelReady(standalone); + const retirement = browserDiagnostics.expectPageRetirement(page); + await page.close(); + retirement.recovered(); const refused = browserDiagnostics.expectResponse({ path: /\/dashboard\/$/, status: 500, From beb4d4c4920dd4a81d434fb3787d76aa4074cd2c Mon Sep 17 00:00:00 2001 From: Myles Scolnick Date: Tue, 24 Nov 2026 23:48:37 -0500 Subject: [PATCH 4/5] Require supported platform wheels in provider acceptance --- scripts/verify-provider-bootstrap.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/verify-provider-bootstrap.py b/scripts/verify-provider-bootstrap.py index bef22463..c87670b5 100644 --- a/scripts/verify-provider-bootstrap.py +++ b/scripts/verify-provider-bootstrap.py @@ -97,6 +97,12 @@ async def _prepare(root: Path) -> None: document["project"] = project tool = tomlkit.table() uv = tomlkit.table() + # The acceptance project must resolve wheels for every supported CI platform. + uv["required-environments"] = [ + "sys_platform == 'darwin' and platform_machine == 'arm64'", + "sys_platform == 'linux' and platform_machine == 'x86_64'", + "sys_platform == 'win32' and platform_machine == 'AMD64'", + ] sources = tomlkit.table() for name, path in ( ("marimo-studio", studio_wheel), From 49d58db7e79dbdc21fb8c41fd6118e8cdba5221d Mon Sep 17 00:00:00 2001 From: Myles Scolnick Date: Wed, 25 Nov 2026 00:41:57 -0500 Subject: [PATCH 5/5] Avoid redundant query RPCs during browser preview activation --- .../presentation/src/runtime/wasm-query.ts | 13 ++++++- .../presentation/tests/wasm-runtime.test.ts | 37 +++++++++++++++++++ 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/packages/presentation/src/runtime/wasm-query.ts b/packages/presentation/src/runtime/wasm-query.ts index 4a54accd..63ab6604 100644 --- a/packages/presentation/src/runtime/wasm-query.ts +++ b/packages/presentation/src/runtime/wasm-query.ts @@ -1,4 +1,4 @@ -import { notebookQueryValues } from "@marimo-studio/protocol/query"; +import { notebookQueryValues, publicNotebookQuery } from "@marimo-studio/protocol/query"; import { z } from "zod"; import type { RuntimeInvoke } from "./runtime"; @@ -58,6 +58,7 @@ export const createWasmQueryWriter = (ownerSignal: AbortSignal) => { let active: PendingQueryUpdate | undefined; let pending: PendingQueryUpdate | undefined; let disposed = false; + let acknowledgedQuery: string | undefined; const disposal = new AbortController(); const signal = AbortSignal.any([ownerSignal, disposal.signal]); let resolveClosed = () => {}; @@ -77,7 +78,9 @@ export const createWasmQueryWriter = (ownerSignal: AbortSignal) => { active = update; try { signal.throwIfAborted(); + acknowledgedQuery = undefined; await synchronize(update.invoke, update.query, update.generation, signal); + acknowledgedQuery = update.query; update.waiters.forEach(({ resolve }) => resolve()); } catch (error) { const failure = @@ -101,11 +104,17 @@ export const createWasmQueryWriter = (ownerSignal: AbortSignal) => { return { write(invoke: RuntimeInvoke, query: string): Promise { - if (disposed) { + if (disposed || signal.aborted) { return Promise.reject( signal.reason ?? new DOMException("The runtime was disposed.", "AbortError"), ); } + query = publicNotebookQuery(query); + // Startup already synchronizes this query before executing projections. + // Do not queue the same query behind potentially expensive notebook work. + if (!active && !pending && acknowledgedQuery === query) { + return Promise.resolve(); + } const operation = new Promise((resolve, reject) => { pending = { invoke, diff --git a/packages/presentation/tests/wasm-runtime.test.ts b/packages/presentation/tests/wasm-runtime.test.ts index 0f60d2a7..72142acf 100644 --- a/packages/presentation/tests/wasm-runtime.test.ts +++ b/packages/presentation/tests/wasm-runtime.test.ts @@ -159,6 +159,43 @@ describe("WebAssembly query synchronization", () => { await writer.dispose(); }); + it("acknowledges the initialized query without waiting behind notebook execution", async () => { + const owner = new AbortController(); + const writer = createWasmQueryWriter(owner.signal); + const invoke = vi.fn(async (request) => ({ + found: true, + status: { code: "ok", message: null }, + return_value: { generation: request.args.generation, applied: true }, + })); + await writer.write(invoke, "?region=emea&file=notebook.py"); + // The worker is occupied rendering the notebook after startup. An unchanged + // activation query already has an acknowledgement and needs no worker RPC. + invoke.mockImplementation(() => new Promise(() => {})); + const repeated = writer.write(invoke, "?region=emea&runtime=wasm"); + expect(invoke).toHaveBeenCalledTimes(1); + await repeated; + await writer.dispose(); + }); + + it("does not reuse an acknowledgement after a different query fails", async () => { + const writer = createWasmQueryWriter(new AbortController().signal); + const invoke = vi.fn(async (request) => ({ + found: true, + status: { code: "ok", message: null }, + return_value: { generation: request.args.generation, applied: true }, + })); + await writer.write(invoke, "?region=emea"); + invoke.mockResolvedValueOnce({ + found: true, + status: { code: "error", message: "query failed" }, + return_value: null, + }); + await expect(writer.write(invoke, "?region=apac")).rejects.toThrow("query failed"); + await writer.write(invoke, "?region=emea"); + expect(invoke).toHaveBeenCalledTimes(3); + await writer.dispose(); + }); + it("stops retrying when the runtime is disposed", async () => { let rejectInvoke = (_error: Error) => {}; const invoke = vi.fn(