feat(auth): separate source control write permissions (#9787)

Co-authored-by: Claude Fable 5 <[email protected]>
This commit is contained in:
Julius MarmingeandClaude Fable 5 authored and GitHub committed 2026-10-06 20:30:11 -07:00
1 parent 28ce9d1c17
commit 2eda8ac6a3
59 files changed
+3628 -315

No files matched your search

@@ -19,7 +19,6 @@ import { AsyncResult, Atom, AtomRegistry } from "effect/reactivity";
import {
createAtomCommandScheduler,
createEnvironmentCommand,
createEnvironmentRpcCommand,
createEnvironmentRpcQueryAtomFamily,
createEnvironmentRpcSubscriptionAtomFamily,
@@ -320,7 +319,8 @@ export function createPullRequestEnvironmentAtoms<R, E>(
JSON.stringify([environmentId, input.projectId, input.repository, input.number]),
},
}),
runAction: createEnvironmentCommand(runtime, {
runAction: createEnvironmentRpcCommand(runtime, {
tag: WS_METHODS.pullRequestsRunAction,
label: "environment-data:pull-requests:run-action",
// Preparation belongs to the write's lane. Refreshable queries would restart it after
// every preceding action, and preparing outside the lane could reorder the clicks.
@@ -328,8 +328,6 @@ export function createPullRequestEnvironmentAtoms<R, E>(
input: PullRequestActionInput & {
readonly resolveMergeMethod?: (detail: PullRequestDetail) => PullRequestMergeMethod;
},
registry,
environmentId,
) =>
Effect.gen(function* () {
const { resolveMergeMethod, ...actionInput } = input;
@@ -369,9 +367,10 @@ export function createPullRequestEnvironmentAtoms<R, E>(
});
preparedInput = { ...actionInput, mergeMethod };
}
yield* routedRequest(WS_METHODS.pullRequestsRunAction, preparedInput);
registry.refresh(preview({ environmentId, input: actionInput }));
return yield* routedRequest(WS_METHODS.pullRequestsRunAction, preparedInput);
}),
onSuccess: ({ environmentId, input }, registry) =>
Effect.sync(() => registry.refresh(preview({ environmentId, input }))),
scheduler: commandScheduler,
concurrency: serialPerEnvironment,
}),