-
Notifications
You must be signed in to change notification settings - Fork 11
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -108,6 +108,34 @@ 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 bun@1.3.11 node-gyp") | ||
| expect(contents).toContain("curl -fsSL --retry 5 --retry-all-errors --retry-delay 2") | ||
| expect(contents).toContain("controller tooling install failed after retries") | ||
| expect(contents).toContain("test \"$(bun --version)\" = \"1.3.11\"") | ||
| expect(contents).toContain("node-gyp --version") | ||
| })) | ||
|
Comment on lines
+112
to
+121
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Добавьте проверку верхней границы retry-цикла ( Сейчас тест не закрепляет ключевой инвариант из этого изменения — максимальное число попыток. На практике это позволит регрессии пройти незаметно. Предлагаемое усиление теста 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")🤖 Prompt for AI Agents |
||
| }) | ||
|
|
||
| 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(() => { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,11 +2,31 @@ 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 react-reconciler@0.33.0; 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, "") | ||
|
|
||
| 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(stripCaret(terminalPackage.dependencies.react)).toBe(gridlandRendererReactVersion) | ||
| expect(stripCaret(terminalPackage.devDependencies["react-dom"])).toBe(gridlandRendererReactVersion) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "Проверка, что тест валидирует нужное поле и манифест соответствует ему"
rg -n --type=ts 'terminalPackage\.(devDependencies|dependencies)\["react-dom"\]' packages/app/tests/docker-git/gridland-react-singleton.test.ts
python - <<'PY'
import json, pathlib
pkg = json.loads(pathlib.Path("packages/terminal/package.json").read_text())
print("dependencies.react-dom:", pkg.get("dependencies", {}).get("react-dom"))
print("devDependencies.react-dom:", pkg.get("devDependencies", {}).get("react-dom"))
PYRepository: ProverCoderAI/docker-git Length of output: 311 Исправить тест singleton-контракта: проверять Сейчас тест на Line ~30 фиксирует Предлагаемый фикс- expect(stripCaret(terminalPackage.devDependencies["react-dom"])).toBe(gridlandRendererReactVersion)
+ expect(stripCaret(terminalPackage.dependencies["react-dom"])).toBe(gridlandRendererReactVersion)🤖 Prompt for AI AgentsSource: Coding guidelines |
||
| })) | ||
| }) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: ProverCoderAI/docker-git
Length of output: 175
🏁 Script executed:
Repository: ProverCoderAI/docker-git
Length of output: 4653
Зафиксируйте точную версию
node-gypпри глобальной установке controller tooling.В
packages/api/Dockerfileстрока 56npm install -g --prefix /opt/bun --no-audit --no-fund bun@1.3.11 node-gypвыполняется без версии, из-за чего сборка недетерминирована и растёт supply-chain риск (также в корневомDockerfilenpm i -g node-gypбез версии).Предлагаемый фикс
🤖 Prompt for AI Agents
Sources: Coding guidelines, Linters/SAST tools