Skip to content

Commit 270e0ae

Browse files
Merge branch 'main' into feat/web/duplicate-default-theme
2 parents b073632 + cad2c93 commit 270e0ae

143 files changed

Lines changed: 34121 additions & 443 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎apps/server/src/auth/RpcAuthorization.test.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,17 @@ describe("RPC authorization scopes", () => {
3737
expect(requiredScopeForRpcMethod(WS_METHODS.cloudInstallRelayClient)).toBe(AuthRelayWriteScope);
3838
});
3939

40+
it("reads the reviewer menu under the same scope as the pull request it belongs to", () => {
41+
// The candidate list is a read like the detail beside it, and asking somebody for a review is
42+
// a write like every other pull request operation.
43+
expect(requiredScopeForRpcMethod(WS_METHODS.pullRequestsReviewerCandidates)).toBe(
44+
requiredScopeForRpcMethod(WS_METHODS.pullRequestsDetail),
45+
);
46+
expect(requiredScopeForRpcMethod(WS_METHODS.pullRequestsRequestReviewers)).toBe(
47+
requiredScopeForRpcMethod(WS_METHODS.pullRequestsComment),
48+
);
49+
});
50+
4051
it("rejects unknown RPC method names", () => {
4152
for (const method of ["server.notRegistered", "toString", "constructor"]) {
4253
expect(() => requiredScopeForRpcMethod(method)).toThrow(

‎apps/server/src/auth/RpcAuthorization.ts‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,23 @@ export const RPC_REQUIRED_SCOPES = {
5252
[WS_METHODS.serverGetBackgroundPolicy]: AuthOrchestrationReadScope,
5353
[WS_METHODS.cloudGetRelayClientStatus]: AuthRelayReadScope,
5454
[WS_METHODS.cloudInstallRelayClient]: AuthRelayWriteScope,
55+
[WS_METHODS.pullRequestsList]: AuthOrchestrationReadScope,
56+
[WS_METHODS.pullRequestsListStats]: AuthOrchestrationReadScope,
57+
[WS_METHODS.pullRequestsDetail]: AuthOrchestrationReadScope,
58+
[WS_METHODS.pullRequestsActivity]: AuthOrchestrationReadScope,
59+
[WS_METHODS.pullRequestsDiffFileContents]: AuthOrchestrationReadScope,
60+
[WS_METHODS.pullRequestsRunAction]: AuthOrchestrationOperateScope,
61+
[WS_METHODS.pullRequestsComment]: AuthOrchestrationOperateScope,
62+
[WS_METHODS.pullRequestsSubmitReview]: AuthOrchestrationOperateScope,
63+
[WS_METHODS.pullRequestsReplyToThread]: AuthOrchestrationOperateScope,
64+
[WS_METHODS.pullRequestsSetThreadResolution]: AuthOrchestrationOperateScope,
65+
// Read scope like the reads it un-caches: refreshing is part of reading, and a read-only
66+
// client pressing refresh must not be told it may not look again.
67+
[WS_METHODS.pullRequestsInvalidate]: AuthOrchestrationReadScope,
68+
// The candidate list is a read like the detail beside it; asking somebody for a review is a
69+
// write like every other one.
70+
[WS_METHODS.pullRequestsReviewerCandidates]: AuthOrchestrationReadScope,
71+
[WS_METHODS.pullRequestsRequestReviewers]: AuthOrchestrationOperateScope,
5572
[WS_METHODS.sourceControlLookupRepository]: AuthOrchestrationReadScope,
5673
[WS_METHODS.sourceControlCloneRepository]: AuthOrchestrationOperateScope,
5774
[WS_METHODS.sourceControlPublishRepository]: AuthOrchestrationOperateScope,

‎apps/server/src/cloud/bootService.test.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ const makeHarness = Effect.fn("test.make_boot_service_harness")(function* (
8181
timedOut: false,
8282
stdoutTruncated: false,
8383
stderrTruncated: false,
84+
stdoutInvalidUtf8: false,
85+
stderrInvalidUtf8: false,
8486
};
8587
}),
8688
});

‎apps/server/src/cloud/pinnedRuntime.test.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ const successfulRunner = (fs: FileSystem.FileSystem, path: Path.Path) =>
3131
timedOut: false,
3232
stdoutTruncated: false,
3333
stderrTruncated: false,
34+
stdoutInvalidUtf8: false,
35+
stderrInvalidUtf8: false,
3436
};
3537
}),
3638
});

‎apps/server/src/cloud/selfUpdate.test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ const makeHarness = Effect.fn("test.make_self_update_harness")(function* (
4545
timedOut: false,
4646
stdoutTruncated: false,
4747
stderrTruncated: false,
48+
stdoutInvalidUtf8: false,
49+
stderrInvalidUtf8: false,
4850
};
4951
}
5052
order.push("preflight");
@@ -64,6 +66,8 @@ const makeHarness = Effect.fn("test.make_self_update_harness")(function* (
6466
timedOut: false,
6567
stdoutTruncated: false,
6668
stderrTruncated: false,
69+
stdoutInvalidUtf8: false,
70+
stderrInvalidUtf8: false,
6771
};
6872
}),
6973
});

‎apps/server/src/environment/ServerEnvironment.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ it.layer(NodeServices.layer)("ServerEnvironmentLive", (it) => {
6969
expect(first.environmentId).toBe(second.environmentId);
7070
expect(second.capabilities.repositoryIdentity).toBe(true);
7171
expect(second.capabilities.connectionProbe).toBe(true);
72+
expect(second.capabilities.pullRequests).toBe(true);
7273
expect(second.capabilities.threadTitleRegeneration).toBe(true);
7374
}),
7475
);

‎apps/server/src/environment/ServerEnvironment.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ export const make = Effect.gen(function* () {
143143
capabilities: {
144144
repositoryIdentity: true,
145145
connectionProbe: true,
146+
pullRequests: true,
146147
threadSettlement: true,
147148
threadSnooze: true,
148149
threadPinning: true,

‎apps/server/src/environment/ServerEnvironmentLabel.test.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ describe("resolveServerEnvironmentLabel", () => {
8181
timedOut: false,
8282
stdoutTruncated: false,
8383
stderrTruncated: false,
84+
stdoutInvalidUtf8: false,
85+
stderrInvalidUtf8: false,
8486
}),
8587
);
8688

@@ -120,6 +122,8 @@ describe("resolveServerEnvironmentLabel", () => {
120122
timedOut: false,
121123
stdoutTruncated: false,
122124
stderrTruncated: false,
125+
stdoutInvalidUtf8: false,
126+
stderrInvalidUtf8: false,
123127
}),
124128
);
125129

@@ -223,6 +227,8 @@ describe("resolveServerEnvironmentLabel", () => {
223227
timedOut: false,
224228
stdoutTruncated: false,
225229
stderrTruncated: false,
230+
stdoutInvalidUtf8: false,
231+
stderrInvalidUtf8: false,
226232
}),
227233
);
228234

@@ -264,6 +270,8 @@ describe("resolveServerEnvironmentLabel", () => {
264270
timedOut: false,
265271
stdoutTruncated: false,
266272
stderrTruncated: false,
273+
stdoutInvalidUtf8: false,
274+
stderrInvalidUtf8: false,
267275
}),
268276
);
269277

0 commit comments

Comments
 (0)