-
Notifications
You must be signed in to change notification settings - Fork 12
fix(app): pin React and stabilize E2E builds #386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
skulidropek
merged 5 commits into
ProverCoderAI:main
from
konard:issue-385-c985e1f92a8e
Jun 12, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
31aa560
Initial commit with task details
konard e6cd158
fix(app): pin React for Gridland renderer
konard 3c50976
fix(api): harden controller tooling install
konard f5dc2c7
fix(e2e): retry opencode auth bootstrap
konard 07ad660
fix(review): pin node-gyp and harden singleton/retry contracts
konard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@prover-coder-ai/docker-git": patch | ||
| --- | ||
|
|
||
| Pin React and React DOM to the Gridland renderer-compatible 19.2.4 release so the CLI menu keeps a single valid React hook dispatcher. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,11 +46,32 @@ RUN set -eu; \ | |
| && nvidia-ctk runtime configure --runtime=docker \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| RUN curl -fsSL https://deb.nodesource.com/setup_24.x | bash - \ | ||
| && apt-get install -y --no-install-recommends nodejs \ | ||
| && curl -fsSL https://bun.sh/install | bash \ | ||
| && npm i -g node-gyp \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
| RUN set -eu; \ | ||
| installed=0; \ | ||
| for attempt in 1 2 3 4 5; do \ | ||
| rm -rf /var/lib/apt/lists/* /opt/bun; \ | ||
| if curl -fsSL --retry 5 --retry-all-errors --retry-delay 2 https://deb.nodesource.com/setup_24.x -o /tmp/nodesource-setup.sh \ | ||
| && bash /tmp/nodesource-setup.sh \ | ||
| && apt-get -o Acquire::Retries=3 install -y --no-install-recommends nodejs \ | ||
| && npm install -g --prefix /opt/bun --no-audit --no-fund [email protected] [email protected] \ | ||
| && node -v \ | ||
| && npm -v \ | ||
| && bun --version \ | ||
| && test "$(bun --version)" = "1.3.11" \ | ||
| && node-gyp --version; then \ | ||
| installed=1; \ | ||
| break; \ | ||
| fi; \ | ||
| echo "controller tooling install attempt ${attempt} failed; retrying..." >&2; \ | ||
| rm -f /tmp/nodesource-setup.sh; \ | ||
| sleep $((attempt * 2)); \ | ||
| done; \ | ||
| if [ "$installed" != "1" ]; then \ | ||
| echo "controller tooling install failed after retries" >&2; \ | ||
| exit 1; \ | ||
| fi; \ | ||
| rm -f /tmp/nodesource-setup.sh; \ | ||
| rm -rf /var/lib/apt/lists/* | ||
|
|
||
| FROM controller-base AS workspace-deps | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -108,6 +108,35 @@ describe("API Dockerfile Electron materialization", () => { | |
| })) | ||
| }) | ||
|
|
||
| describe("API Dockerfile controller tooling install", () => { | ||
| it.effect("retries network-bound controller tooling downloads", () => | ||
| Effect.gen(function*(_) { | ||
| const contents = yield* _(readComposeFile("packages/api/Dockerfile")) | ||
| expect(contents).toContain("https://deb.nodesource.com/setup_24.x -o /tmp/nodesource-setup.sh") | ||
| expect(contents).toContain("npm install -g --prefix /opt/bun --no-audit --no-fund [email protected] [email protected]") | ||
| expect(contents).toContain("curl -fsSL --retry 5 --retry-all-errors --retry-delay 2") | ||
| expect(contents).toContain("for attempt in 1 2 3 4 5; do") | ||
| expect(contents).toContain("controller tooling install failed after retries") | ||
| expect(contents).toContain("test \"$(bun --version)\" = \"1.3.11\"") | ||
| expect(contents).toContain("node-gyp --version") | ||
| })) | ||
| }) | ||
|
|
||
| describe("OpenCode E2E auth bootstrap", () => { | ||
| it.effect("retries controller auth commands before the clone scenario", () => | ||
| Effect.gen(function*(_) { | ||
| const contents = yield* _(readComposeFile("scripts/e2e/opencode-autoconnect.sh")) | ||
| expect(contents).toContain("auth_attempts=3") | ||
| expect(contents).toContain(": > \"$AUTH_LOG\"") | ||
| expect(contents).toContain("if (") | ||
| expect(contents).toContain("dg_run_docker_git \"$REPO_ROOT\" auth codex import") | ||
| expect(contents).toContain("dg_run_docker_git \"$REPO_ROOT\" auth codex status") | ||
| expect(contents).toContain(") >>\"$AUTH_LOG\" 2>&1") | ||
| expect(contents).toContain("auth bootstrap attempt $auth_attempt/$auth_attempts failed") | ||
| expect(contents).toContain("docker-git auth bootstrap failed after $auth_attempts attempts") | ||
| })) | ||
| }) | ||
|
|
||
| describe("controller resource limit resolution", () => { | ||
| it.effect("resolves CPU and RAM defaults to 90% of host resources", () => | ||
| Effect.sync(() => { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,11 +2,46 @@ import { describe, expect, it } from "@effect/vitest" | |
| import { Effect } from "effect" | ||
|
|
||
| import rootPackage from "../../../../package.json" with { type: "json" } | ||
| import terminalPackage from "../../../terminal/package.json" with { type: "json" } | ||
| import appPackage from "../../package.json" with { type: "json" } | ||
|
|
||
| // CHANGE: encode the React version resolved for the Gridland Bun renderer. | ||
| // WHY: @gridland/bun embeds [email protected]; Bun resolves that renderer contract to React 19.2.4. | ||
| // QUOTE(ISSUE): "TypeError: null is not an object (evaluating 'resolveDispatcher().useCallback')" | ||
| // REF: issue-385 | ||
| // SOURCE: n/a | ||
| // FORMAT THEOREM: workspaceReactVersion = rendererReactVersion -> dispatcher(hookCall) != null | ||
| // PURITY: CORE | ||
| // EFFECT: n/a | ||
| // INVARIANT: every workspace React entry resolves to the renderer-compatible singleton version. | ||
| // COMPLEXITY: O(1) | ||
| const gridlandRendererReactVersion = "19.2.4" | ||
|
|
||
| const stripCaret = (value: string): string => value.replace(/^\^/u, "") | ||
|
|
||
| // CHANGE: resolve a dependency version from either dependencies or devDependencies. | ||
| // WHY: the terminal package exports React components but never renders to the DOM itself, | ||
| // so `react-dom` is a devDependency there; the singleton pin must still be enforced | ||
| // wherever the dependency is declared. REF: PR-386 CodeRabbit review. | ||
| const resolveDepVersion = ( | ||
| pkg: { dependencies?: Record<string, string>; devDependencies?: Record<string, string> }, | ||
| name: string | ||
| ): string => { | ||
| const version = pkg.dependencies?.[name] ?? pkg.devDependencies?.[name] | ||
| if (version === undefined) { | ||
| throw new Error(`Expected ${name} to be declared in dependencies or devDependencies`) | ||
| } | ||
| return stripCaret(version) | ||
| } | ||
|
|
||
| describe("Gridland React singleton contract", () => { | ||
| it.effect("pins React across workspace dependencies for the Gridland renderer", () => | ||
| Effect.sync(() => { | ||
| expect(rootPackage.overrides.react).toBe(appPackage.dependencies.react.replace(/^\^/u, "")) | ||
| expect(rootPackage.overrides.react).toBe(gridlandRendererReactVersion) | ||
| expect(rootPackage.overrides["react-dom"]).toBe(gridlandRendererReactVersion) | ||
| expect(stripCaret(appPackage.dependencies.react)).toBe(gridlandRendererReactVersion) | ||
| expect(stripCaret(appPackage.dependencies["react-dom"])).toBe(gridlandRendererReactVersion) | ||
| expect(resolveDepVersion(terminalPackage, "react")).toBe(gridlandRendererReactVersion) | ||
| expect(resolveDepVersion(terminalPackage, "react-dom")).toBe(gridlandRendererReactVersion) | ||
| })) | ||
| }) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -124,11 +124,26 @@ OPENCODE_AUTO_CONNECT=1 | |
| EOF_ENV | ||
|
|
||
| AUTH_LOG="$ROOT/codex-auth.log" | ||
| ( | ||
| cd "$REPO_ROOT" | ||
| dg_run_docker_git "$REPO_ROOT" auth codex import --codex-auth "$ROOT/.orch/auth/codex" | ||
| dg_run_docker_git "$REPO_ROOT" auth codex status --codex-auth "$ROOT/.orch/auth/codex" | ||
| ) >"$AUTH_LOG" 2>&1 | ||
| auth_attempts=3 | ||
| auth_attempt=1 | ||
| auth_exit=0 | ||
| : > "$AUTH_LOG" | ||
| while [[ "$auth_attempt" -le "$auth_attempts" ]]; do | ||
| if ( | ||
| cd "$REPO_ROOT" | ||
| dg_run_docker_git "$REPO_ROOT" auth codex import --codex-auth "$ROOT/.orch/auth/codex" | ||
| dg_run_docker_git "$REPO_ROOT" auth codex status --codex-auth "$ROOT/.orch/auth/codex" | ||
| ) >>"$AUTH_LOG" 2>&1; then | ||
| auth_exit=0 | ||
| break | ||
| else | ||
| auth_exit=$? | ||
| fi | ||
| echo "e2e/opencode-autoconnect: auth bootstrap attempt $auth_attempt/$auth_attempts failed (exit: $auth_exit); retrying..." >&2 | ||
| auth_attempt="$((auth_attempt + 1))" | ||
| sleep 2 | ||
| done | ||
| [[ "$auth_exit" -eq 0 ]] || fail "docker-git auth bootstrap failed after $auth_attempts attempts (last exit: $auth_exit)" | ||
|
|
||
| auth_confirmation_count="$(grep -Fc -- "Codex auth imported into controller state (account: [email protected])." "$AUTH_LOG" || true)" | ||
| [[ "$auth_confirmation_count" -ge 2 ]] \ | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.