Skip to content

Commit 213f804

Browse files
committed
Revert "test(config): stop a broken pipe preempting the exit-code diagnosis"
This reverts b772491. The fix is sound but has nothing to do with workers logs; it landed here to stabilise this branch's CI. Moved to #6455 off develop so it does not merge or revert with the workers work. Raised in review on #6410. Until #6455 lands, the `packages/config` release-script test it stabilises can flake on a loaded runner.
1 parent 57f6249 commit 213f804

1 file changed

Lines changed: 2 additions & 28 deletions

File tree

packages/config/scripts/semantic-release-path-filter.ts

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,6 @@ export const PACKAGE_PATH_PREFIX = "packages/config/";
7070
* nothing too — `--root` closes that gap by diffing it against the empty
7171
* tree (merge behavior is unaffected).
7272
*/
73-
/**
74-
* Whether a write failed because the reader is gone.
75-
*
76-
* Node and Bun both tag this as `EPIPE` on the error object; the message text
77-
* differs between them and is not matched.
78-
*/
79-
function isBrokenPipe(cause: unknown): boolean {
80-
if (typeof cause !== "object" || cause === null || !("code" in cause)) {
81-
return false;
82-
}
83-
return cause.code === "EPIPE";
84-
}
85-
8673
export async function filterCommitsToPackage<T extends { hash: string }>(
8774
commits: readonly T[],
8875
cwd: string,
@@ -120,21 +107,8 @@ export async function filterCommitsToPackage<T extends { hash: string }>(
120107
// is one runtime port away — don't rely on the buffering behavior.
121108
const stdoutText = new Response(proc.stdout).text();
122109
const stderrText = new Response(proc.stderr).text();
123-
// A `git` that rejects its arguments — a `cwd` outside any repository, say —
124-
// exits before it reads a single hash, and writing to a process that has
125-
// already gone raises EPIPE. Whether that happens is a race against process
126-
// startup, so surfacing it would make the failure mode nondeterministic:
127-
// sometimes `EPIPE: broken pipe, send`, sometimes the real diagnosis. The
128-
// exit code and stderr below are the diagnosis, so a broken pipe here is
129-
// dropped and the reporting left to them.
130-
try {
131-
await proc.stdin.write(`${hashes.join("\n")}\n`);
132-
await proc.stdin.end();
133-
} catch (cause) {
134-
if (!isBrokenPipe(cause)) {
135-
throw cause;
136-
}
137-
}
110+
await proc.stdin.write(`${hashes.join("\n")}\n`);
111+
await proc.stdin.end();
138112

139113
const [exitCode, stdout, stderr] = await Promise.all([proc.exited, stdoutText, stderrText]);
140114
if (exitCode !== 0) {

0 commit comments

Comments
 (0)