feat(aws): AWS project settings and the stop guard
Add Project picks Local or an AWS connection, a region and a ready, joined environment, with repositories instead of folders. The Config tab's Host section edits CPU/memory (valid pairs only), architecture, storage, ephemeral size, Spot, idle stop, WIP push and repositories, and can remove the AWS resources or move the project back to this machine. Docker access, VPN, port mappings and the gateway backend are disabled on AWS with the reason; the sandbox shows Off on AWS for now. Stop on an AWS workspace with unsaved work asks first (Push to WIP branch preselected); a failed start shows the task's last log lines; removing an AWS project can delete its saved files, and asks again when its connection is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
51042f5d9e
commit
eb7c6c7b21
25 files changed
+2065
-232
No files matched your search
@@ -0,0 +1,37 @@
|
||||
import { describe, it, expect, vi } from "vitest";
|
||||
import { render, screen, fireEvent } from "@testing-library/react";
|
||||
import ConfirmRemoveModal, { ConfirmForgetAwsModal } from "./ConfirmRemoveModal";
|
||||
|
||||
describe("ConfirmRemoveModal", () => {
|
||||
it("keeps an AWS workspace's saved files unless asked", () => {
|
||||
const onConfirm = vi.fn();
|
||||
render(<ConfirmRemoveModal projectName="api" aws onConfirm={onConfirm} onCancel={vi.fn()} />);
|
||||
const box = screen.getByRole("checkbox", { name: /saved files \(EFS\)/ });
|
||||
expect(box).not.toBeChecked();
|
||||
fireEvent.click(screen.getByRole("button", { name: "Remove" }));
|
||||
fireEvent.click(box);
|
||||
fireEvent.click(screen.getByRole("button", { name: "Remove" }));
|
||||
expect(onConfirm.mock.calls).toEqual([[{ discardData: false }], [{ discardData: true }]]);
|
||||
});
|
||||
|
||||
it("offers no EFS choice for a local project", () => {
|
||||
render(<ConfirmRemoveModal projectName="api" onConfirm={vi.fn()} onCancel={vi.fn()} />);
|
||||
expect(screen.queryByRole("checkbox")).toBeNull();
|
||||
expect(screen.getByText(/mounted in, not copied/)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("says what is left in AWS when the connection is gone", () => {
|
||||
const onConfirm = vi.fn();
|
||||
render(
|
||||
<ConfirmForgetAwsModal
|
||||
projectName="api"
|
||||
reason="This project's AWS connection no longer exists"
|
||||
onConfirm={onConfirm}
|
||||
onCancel={vi.fn()}
|
||||
/>,
|
||||
);
|
||||
expect(screen.getByText(/task definitions, its secret and its saved files/)).toBeInTheDocument();
|
||||
fireEvent.click(screen.getByRole("button", { name: "Remove and leave them in AWS" }));
|
||||
expect(onConfirm).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user