Repository navigation
Closed
Closed
Copy link
Labels
vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/web
Steps to reproduce
- Open a local thread in a repository with uncommitted changes and a pre-commit hook that rejects the commit.
- Open the Commit changes dialog.
- Enter a commit message.
- Click Commit.
- Wait for the failure message.
- Select a local thread in another repository with uncommitted changes from the sidebar.
- Open its Commit changes dialog.
Expected behavior
The second repository opens with a blank commit message.
Actual behavior
The second repository’s commit message contains the text from the failed commit.
Impact
Minor bug or occasional failure. People switching repositories after a failed commit can accidentally reuse the earlier repository’s message.
Version or commit
main at 80cf4f7945. The cause is at apps/web/src/components/GitActionsControl.tsx:1379.
Environment
Linux x64 boat.dev default machine, a fresh checkout.
Logs or stack traces
The second repository starts with a blank commit messageAutomated repro
Fails in 2 of 2 runs on main: apply the patch with git apply, then run the command.
diff --git a/scripts/scenarios/failed-commit-message-stays-in-its-repository.e2e.ts b/scripts/scenarios/failed-commit-message-stays-in-its-repository.e2e.ts
new file mode 100644
index 0000000000..5ff0507e42
--- /dev/null
+++ b/scripts/scenarios/failed-commit-message-stays-in-its-repository.e2e.ts
@@ -0,0 +1,68 @@
+/// <reference lib="dom" />
+import { expect } from "e2e";
+import * as Effect from "effect/Effect";
+import * as FileSystem from "effect/FileSystem";
+
+import { run } from "./shell.ts";
+import { runPromise, test, WEB } from "./t3.ts";
+
+test(
+ "A failed commit message stays in the repository it was written for",
+ WEB,
+ async ({ t3, app, browser, screen }) => {
+ const first = await t3.project("first-repository");
+ const second = await t3.project("second-repository");
+ const firstThread = await t3.thread({
+ project: first,
+ title: "First checkout",
+ messages: ["First"],
+ });
+ await t3.thread({ project: second, title: "Second checkout", messages: ["Second"] });
+
+ await runPromise(
+ Effect.gen(function* () {
+ const fs = yield* FileSystem.FileSystem;
+ const hook = `${first}/.git/hooks/pre-commit`;
+ yield* fs.writeFileString(
+ hook,
+ "#!/bin/sh\necho 'Scenario hook rejected the commit' >&2\nexit 1\n",
+ );
+ yield* fs.chmod(hook, 0o755);
+ yield* run("git", ["config", "core.hooksPath", ".git/hooks"], { cwd: first });
+ yield* run("git", ["config", "user.name", "Scenario"], { cwd: first });
+ yield* run("git", ["config", "user.email", "[email protected]"], { cwd: first });
+ yield* fs.writeFileString(`${first}/first.txt`, "A new change in the first repository\n");
+ yield* fs.writeFileString(
+ `${second}/second.txt`,
+ "A new change in the second repository\n",
+ );
+ }),
+ );
+
+ await browser.setViewport({ width: 1920, height: 1000 });
+ await t3.open(firstThread);
+ const openCommit = async (file: string) => {
+ await screen.getByRole("button", "Git action options").tap();
+ await screen.getByRole("menuitem", "Commit", { exact: true }).tap();
+ await screen.getByRole("button", `Open ${file} in editor`, { exact: true }).waitFor();
+ };
+ await openCommit("first.txt");
+ await screen
+ .getByPlaceholder("Leave empty to auto-generate")
+ .fill("Describe the first checkout");
+ await screen.getByRole("button", "Commit", { exact: true }).tap();
+ await screen.getByText("Action failed", { exact: true }).waitFor();
+
+ // Navigate in the running app so the shared thread view stays mounted.
+ await screen.getByRole("button", /^Second checkout(?:,|$)/).tap();
+ await openCommit("second.txt");
+ await app.screenshot("commit-message-in-second-repository");
+ const message = await browser.evaluate(
+ () =>
+ document.querySelector<HTMLTextAreaElement>(
+ 'textarea[placeholder="Leave empty to auto-generate"]',
+ )?.value,
+ );
+ expect(message, "The second repository starts with a blank commit message").toBe("");
+ },
+);pnpm scenarios:prove scripts/scenarios/failed-commit-message-stays-in-its-repository.e2e.ts --base mainWorkaround
No response
Metadata
Metadata
Assignees
Labels
vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.


Activity