Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions apps/server/src/pullRequest/PullRequestReviewGuideService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,51 @@ it.layer(layerBase, { excludeTestServices: true })("PullRequestReviewGuideServic
),
);

it.effect("keeps excerpts of source lines a configured diff driver would convert away", () =>
Effect.scoped(
Effect.gen(function* () {
const repositories = yield* makeRepositories;
const fs = yield* FileSystem.FileSystem;
yield* fs.writeFileString(
`${repositories.workspace}/.git/info/attributes`,
"feature.txt diff=blank\n",
);
yield* git(repositories.workspace, ["config", "diff.blank.textconv", "true"]);
const stored = yield* Deferred.make<void>();
const context = yield* Layer.build(
makeLayer({
...repositories,
stored,
generate: () =>
Effect.succeed({
stops: [
{
title: "The feature",
summary: "The change.",
attention: null,
excerpts: [{ path: "feature.txt", side: "new", start: 1, end: 3, caption: "" }],
files: [],
notes: [],
questions: [],
},
],
}),
}),
);
const service = Context.get(
context,
PullRequestReviewGuideService.PullRequestReviewGuideService,
);
yield* service.generate(reference);
yield* Deferred.await(stored);
const result = yield* service.get(reference);
assert.deepStrictEqual(result.guide?.stops[0]?.excerpts, [
{ path: "feature.txt", side: "new", start: 1, end: 3, caption: "" },
]);
}),
),
);

it.effect("refuses generation when the verified remote disappeared despite a usable origin", () =>
Effect.scoped(
Effect.gen(function* () {
Expand Down
5 changes: 4 additions & 1 deletion apps/server/src/pullRequest/PullRequestReviewGuideService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,10 @@ const make = Effect.gen(function* () {
})
.pipe(Effect.map((result) => result.stdout));
const [nameOnly, patch] = yield* Effect.all(
[diff(["--name-only", "-z"]), diff(["--unified=0", "--no-color", "--no-ext-diff"])],
[
diff(["--name-only", "-z"]),
diff(["--unified=0", "--no-color", "--no-ext-diff", "--no-textconv"]),
],
{ concurrency: "unbounded" },
);
return parseReviewGuideChange(nameOnly, patch);
Expand Down
Loading