-
Notifications
You must be signed in to change notification settings - Fork 9
feat(ci): add cross-platform final build checks #279
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 7 commits into
ProverCoderAI:main
from
konard:issue-278-d92a50df7e27
May 13, 2026
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ee6d0e6
Initial commit with task details
konard 87ede21
feat(ci): add cross-platform final build checks
konard a872a79
fix(ci): bound clone cache mirror refresh refs
konard 67968fb
Merge remote-tracking branch 'origin/main' into issue-278-d92a50df7e27
skulidropek 7cf5e22
ci(final-build): verify browser clone flow
skulidropek feffc8b
test(app): add create flow property checks
skulidropek 203db75
fix(test): satisfy effect lint for generators
skulidropek 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,6 @@ | ||
| --- | ||
| "@prover-coder-ai/docker-git": patch | ||
| "@prover-coder-ai/docker-git-session-sync": patch | ||
| --- | ||
|
|
||
| Add portable launch/build scripts and CI final-build verification across Linux, macOS, and Windows. |
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 |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| name: Final Build | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| final-build: | ||
| name: Final build (${{ matrix.os }}) | ||
| runs-on: ${{ matrix.os }} | ||
| timeout-minutes: 20 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-latest, macos-latest, windows-latest] | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - name: Install dependencies | ||
| uses: ./.github/actions/setup | ||
| with: | ||
| bun-version: 1.3.11 | ||
| node-version: 24.14.0 | ||
| - name: Build final workspace packages | ||
| run: bun run build | ||
| - name: Verify docker-git CLI starts | ||
| run: bun ./packages/app/dist/src/docker-git/main.js --help | ||
| - name: Verify session sync CLI starts | ||
| run: bun ./packages/docker-git-session-sync/dist/docker-git-session-sync.js --help | ||
| - name: Verify browser UI and menu clone smoke checks | ||
| run: | | ||
| bun run --cwd packages/app build:web | ||
| bun scripts/final-build/browser-web-smoke.mjs | ||
| bun run --cwd packages/app vitest run tests/docker-git/browser-frontend.test.ts tests/docker-git/app-ready-create.test.ts tests/docker-git/actions-project-create.test.ts | ||
| - name: Prepare package artifacts directory | ||
| run: | | ||
| node -e "require('node:fs').mkdirSync('artifacts', { recursive: true })" | ||
| - name: Pack docker-git package | ||
| working-directory: packages/app | ||
| run: bun pm pack --quiet --ignore-scripts --destination ../../artifacts | ||
| - name: Pack session sync package | ||
| working-directory: packages/docker-git-session-sync | ||
| run: bun pm pack --quiet --ignore-scripts --destination ../../artifacts | ||
| - name: Upload final build artifacts | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: final-build-${{ matrix.os }} | ||
| path: artifacts/*.tgz | ||
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
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
207 changes: 207 additions & 0 deletions
207
packages/app/tests/docker-git/actions-project-create.test.ts
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,207 @@ | ||
| import { describe, expect, it } from "@effect/vitest" | ||
| import { Effect } from "effect" | ||
| import * as fc from "fast-check" | ||
| import { beforeEach, vi } from "vitest" | ||
|
|
||
| import type { CreateInputs } from "../../src/docker-git/menu-types.js" | ||
| import { submitCreateInputs } from "../../src/web/actions-project-create.js" | ||
| import type { ApiEvent, loadProjectDetails, ProjectDetails, startCreateProject } from "../../src/web/api.js" | ||
| import type { openProjectEventStream } from "../../src/web/project-events.js" | ||
| import { makeBrowserActionContext, waitForAssertion } from "./browser-action-context-fixture.js" | ||
|
|
||
| const eventStreamCloseMock = vi.hoisted(() => vi.fn<() => void>()) | ||
| const loadProjectDetailsMock = vi.hoisted(() => vi.fn<typeof loadProjectDetails>()) | ||
| const openProjectEventStreamMock = vi.hoisted(() => vi.fn<typeof openProjectEventStream>()) | ||
| const startCreateProjectMock = vi.hoisted(() => vi.fn<typeof startCreateProject>()) | ||
|
|
||
| vi.mock("../../src/web/api.js", () => ({ | ||
| loadProjectDetails: loadProjectDetailsMock, | ||
| startCreateProject: startCreateProjectMock | ||
| })) | ||
|
|
||
| vi.mock("../../src/web/project-events.js", () => ({ | ||
| openProjectEventStream: openProjectEventStreamMock | ||
| })) | ||
|
|
||
| const createInputConfig = { | ||
| cpuLimit: "75%", | ||
| enableMcpPlaywright: true, | ||
| force: false, | ||
| forceEnv: false, | ||
| gpu: "none", | ||
| outDir: "/home/dev/.docker-git/octocat/Hello-World", | ||
| ramLimit: "1g", | ||
| repoRef: "main", | ||
| repoUrl: "https://github.com/octocat/Hello-World.git" | ||
| } satisfies Omit<CreateInputs, "runUp"> | ||
|
|
||
| const createInputs: CreateInputs = { | ||
| ...createInputConfig, | ||
| runUp: true | ||
| } | ||
|
|
||
| const expectedCreateDraft = { | ||
| ...createInputConfig, | ||
| up: createInputs.runUp | ||
| } | ||
|
|
||
| const project = { | ||
| authorizedKeysExists: true, | ||
| authorizedKeysPath: "/home/dev/.docker-git/octocat/Hello-World/.ssh/authorized_keys", | ||
| clonedOnHostname: "runner", | ||
| codexAuthPath: "/home/dev/.docker-git/.orch/auth/codex", | ||
| codexHome: "/home/dev/.docker-git/.orch/codex", | ||
| containerName: "docker-git-octocat-hello-world", | ||
| displayName: "octocat/Hello-World", | ||
| envGlobalPath: "/home/dev/.docker-git/.orch/env/global.env", | ||
| envProjectPath: "/home/dev/.docker-git/octocat/Hello-World/.orch/env/project.env", | ||
| gpu: "none", | ||
| id: "project-1", | ||
| projectDir: "/home/dev/.docker-git/octocat/Hello-World", | ||
| projectKey: "octocat/Hello-World", | ||
| repoRef: "main", | ||
| repoUrl: "https://github.com/octocat/Hello-World.git", | ||
| serviceName: "app", | ||
| sshCommand: "ssh -p 2244 dev@127.0.0.1", | ||
| sshPort: 2244, | ||
| sshSessions: 0, | ||
| sshUser: "dev", | ||
| startedAtEpochMs: 1_777_000_000_000, | ||
| startedAtIso: "2026-05-13T00:00:00.000Z", | ||
| status: "running", | ||
| statusLabel: "running", | ||
| targetDir: "/home/dev/project" | ||
| } satisfies ProjectDetails | ||
|
|
||
| const projectDetailsWithId = (projectId: string) => | ||
| ({ | ||
| ...project, | ||
| id: projectId | ||
| }) satisfies ProjectDetails | ||
|
|
||
| const projectCreatedEventFor = ( | ||
| createdProject: ReturnType<typeof projectDetailsWithId> | ||
| ): ApiEvent => ({ | ||
| at: "2026-05-13T00:00:01.000Z", | ||
| payload: { | ||
| project: createdProject, | ||
| projectId: createdProject.id | ||
| }, | ||
| projectId: createdProject.id, | ||
| seq: 8, | ||
| type: "project.created" | ||
| }) | ||
|
|
||
| const readCreateEventHandler = () => { | ||
| const handler = openProjectEventStreamMock.mock.calls[0]?.[1]?.onEvent | ||
| if (handler === undefined) { | ||
| throw new Error("missing create event handler") | ||
| } | ||
| return handler | ||
| } | ||
|
|
||
| const resetCreateMocks = ( | ||
| projectId = project.id, | ||
| cursor = 7 | ||
| ) => { | ||
| eventStreamCloseMock.mockReset() | ||
| loadProjectDetailsMock.mockReset() | ||
| openProjectEventStreamMock.mockReset() | ||
| startCreateProjectMock.mockReset() | ||
| startCreateProjectMock.mockImplementation(() => | ||
| Effect.succeed({ | ||
| accepted: true, | ||
| cursor, | ||
| projectId | ||
| }) | ||
| ) | ||
| openProjectEventStreamMock.mockImplementation(() => ({ close: eventStreamCloseMock })) | ||
| } | ||
|
|
||
| const runCreateFlow = ( | ||
| createdProject: ReturnType<typeof projectDetailsWithId> | ||
| ) => | ||
| Effect.gen(function*(_) { | ||
| const { context, output, reloadDashboard, setMessage } = makeBrowserActionContext() | ||
|
|
||
| submitCreateInputs(createInputs, context) | ||
|
|
||
| yield* _(waitForAssertion(() => { | ||
| expect(openProjectEventStreamMock).toHaveBeenCalledTimes(1) | ||
| })) | ||
| readCreateEventHandler()(projectCreatedEventFor(createdProject)) | ||
|
|
||
| yield* _(waitForAssertion(() => { | ||
| expect(context.setSelectedProject).toHaveBeenCalledWith(createdProject) | ||
| })) | ||
|
|
||
| return { context, createdProject, output, reloadDashboard, setMessage } | ||
| }) | ||
|
|
||
| const expectCreateFlowInvariants = ( | ||
| { | ||
| context, | ||
| createdProject, | ||
| cursor, | ||
| reloadDashboard | ||
| }: { | ||
| readonly context: ReturnType<typeof makeBrowserActionContext>["context"] | ||
| readonly createdProject: ReturnType<typeof projectDetailsWithId> | ||
| readonly cursor: number | ||
| readonly reloadDashboard: ReturnType<typeof makeBrowserActionContext>["reloadDashboard"] | ||
| } | ||
| ) => { | ||
| expect(openProjectEventStreamMock).toHaveBeenCalledWith( | ||
| createdProject.id, | ||
| expect.objectContaining({ initialCursor: cursor }) | ||
| ) | ||
| expect(eventStreamCloseMock).toHaveBeenCalledTimes(1) | ||
| expect(loadProjectDetailsMock).not.toHaveBeenCalled() | ||
| expect(reloadDashboard).toHaveBeenCalledTimes(1) | ||
| expect(context.setSelectedProjectId).toHaveBeenCalledWith(createdProject.id) | ||
| expect(context.setSelectedProject).toHaveBeenCalledWith(createdProject) | ||
| } | ||
|
|
||
| describe("browser create project action", () => { | ||
| beforeEach(() => { | ||
| resetCreateMocks() | ||
| }) | ||
|
|
||
| it.effect("clones a project through the browser menu create flow", () => | ||
| Effect.gen(function*(_) { | ||
| const { context, createdProject, output, reloadDashboard, setMessage } = yield* _( | ||
| runCreateFlow(projectDetailsWithId(project.id)) | ||
| ) | ||
|
|
||
| expect(startCreateProjectMock).toHaveBeenCalledWith(expectedCreateDraft) | ||
| expectCreateFlowInvariants({ context, createdProject, cursor: 7, reloadDashboard }) | ||
| expect(context.setSelectedMenuIndex).toHaveBeenCalledWith(1) | ||
| expect(setMessage).toHaveBeenLastCalledWith("Created octocat/Hello-World.") | ||
| expect(output()).toContain("[create] Project creation requested") | ||
| expect(output()).toContain("[create] Project accepted: project-1") | ||
| expect(output()).toContain("[create] Project created") | ||
| })) | ||
|
|
||
| it.effect("preserves create event invariants for generated project ids and cursors", () => | ||
| Effect.tryPromise({ | ||
| catch: (error) => error, | ||
| try: () => | ||
| fc.assert( | ||
| fc.asyncProperty( | ||
| fc.uuid(), | ||
| fc.integer({ min: 0, max: 10_000 }), | ||
| (projectId, cursor) => | ||
| Effect.runPromise( | ||
| Effect.gen(function*(_) { | ||
| resetCreateMocks(projectId, cursor) | ||
| const createdProject = projectDetailsWithId(projectId) | ||
| const { context, reloadDashboard } = yield* _(runCreateFlow(createdProject)) | ||
|
|
||
| expectCreateFlowInvariants({ context, createdProject, cursor, reloadDashboard }) | ||
| }) | ||
| ) | ||
| ), | ||
| { numRuns: 25 } | ||
| ) | ||
| })) | ||
| }) | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
Oops, something went wrong.
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.