Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(azure-devops): preserve the source commit for review guides #18651

Closedbruno-c-p(GitHub profile, opens in a new tab)wants to merge 4 commits intomain fromrefs/pull/18651/headopened View on GitHub

Showing 4 changed files with 97 additions and 6 deletions (loading 1).

x
0 of 4 viewed, 4 left
59 additions and 0 deletionspackages/source-control-azure-devops/src/server/AzureDevOpsPullRequestProvider.test.tsModified
View file
@@ -169,6 +169,65 @@
});
​
describe("getChangeRequest", () => {
+ it.effect("reports the source commit even when file counting fails", () =>
+ Effect.gen(function* () {
+ const headSha = "3761752e895bc343b031539eb30802c3080b564b";
+ const provider = yield* make.pipe(
+ Effect.provide(
+ Layer.mock(AzureDevOpsPullRequestCli.AzureDevOpsPullRequestCli)({
+ getPullRequest: () => Effect.succeed({ ...PULL_REQUEST, headSha }),
+ listIterations: () =>
+ Effect.fail(
+ new AzureDevOpsPullRequestCli.AzureDevOpsPullRequestReadError({
+ command: "az",
+ cwd: "/w",
+ operation: "listIterations",
+ cause: new Error("iterations unavailable"),
+ }),
+ ),
+ }),
+ ),
+ );
+​
+ const detail = yield* provider.getChangeRequest({
+ cwd: "/w",
+ repository: "acme/web",
+ host: "dev.azure.com",
+ number: 7,
+ });