Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

IssueService.ts

683 lines25.7 KB

1// A project bound to a standalone tracker (Linear) in settings lists it beside its git host's.
2// References outside the project's canonical repository may be read on the same host,
3// but every write must pass through requireWritable.
4import * as Context from "effect/Context";
5import * as Effect from "effect/Effect";
6import * as Layer from "effect/Layer";
7import * as Option from "effect/Option";
8import {
9 IssueOperationError,
10 IssueTrackerKind,
11 IssueUnavailableError,
12 type IssueCandidates,
13 type IssueCommentInput,
14 type IssueCommentsPage,
15 type IssueCommentsPageInput,
16 type IssueCreateInput,
17 type IssueCreateResult,
18 type IssueDetail,
19 type IssueError,
20 type IssueListEntry,
21 type IssueListInput,
22 type IssueListProjectError,
23 type IssueListResult,
24 type IssueReactionInput,
25 type IssueRef,
26 type IssueScopeRef,
27 type IssueSetStateInput,
28 type IssueTemplateList,
29 type IssueTrackerSummary,
30 type IssueUpdateInput,
31 type OrchestrationProjectShell,
32 type ProjectId,
33} from "@t3tools/contracts";
34import * as SourceControlRateLimit from "@t3tools/source-control-core/server/SourceControlRateLimit";
35import {
36 IssueTrackerError,
37 isStandaloneIssueTracker,
38 type IssueTrackerApi,
39} from "@t3tools/source-control-core/server/IssueTracker";
40​
41import * as IssueTrackerBindings from "../persistence/IssueTrackerBindings.ts";
42import * as ProjectService from "../project/ProjectService.ts";
43import * as RepositoryIdentityResolver from "../project/RepositoryIdentityResolver.ts";
44import { sourceControlDefinitions } from "../sourceControl/sourceControlDefinitions.ts";
45import * as IssueTrackerRegistry from "./IssueTrackerRegistry.ts";
46​
47const DEFAULT_LIST_LIMIT = 50;
48const SCOPE_CONCURRENCY = 4;
49​
50const interactive =
51 <I, A>(call: (input: I) => Effect.Effect<A, IssueError>) =>
52 (input: I) =>
53 call(input).pipe(Effect.provideService(SourceControlRateLimit.Interactive, true));
54​
55const traced =
56 <I, A>(operation: string, call: (input: I) => Effect.Effect<A, IssueError>) =>
57 (input: I) =>
58 call(input).pipe(Effect.withSpan(`IssueService.${operation}`));
59​
60/** A tracker may fail with no detail; the wire errors carry a non-empty one. */
61export function trackerDetail(error: IssueTrackerError): string {
62 return error.detail.trim() || "The issue tracker request failed.";
64​
65/** One project's resolved tracker: which driver, where it is served from, and its container. */
66interface ProjectTrackerBinding {
67 readonly tracker: IssueTrackerKind;
68 readonly host: string;
69 readonly scope: string;
71​
72/** A project the registry has a tracker for, ready to serve reads and writes. */
73interface SupportedProject extends ProjectTrackerBinding {
74 readonly project: OrchestrationProjectShell;
75 readonly api: IssueTrackerApi;
77​
78/**
79 * The git-host path of resolution: the tracker is the host's own, named like the remote's
80 * provider kind. Null for a project with no remote or a kind no tracker claims.
81 */
82function resolveGitHostBinding(project: OrchestrationProjectShell): ProjectTrackerBinding | null {
83 const identity = project.repositoryIdentity;
84 const scope = sourceControlDefinitions.issueScope(identity);
85 const kind = identity?.provider;
86 if (!identity || kind === undefined || kind === "unknown" || scope === null) return null;
87 return {
88 tracker: IssueTrackerKind.make(kind),
89 host: sourceControlDefinitions.changeRequestHost(identity, kind),
90 scope,
91 };
93​
94/** Lower case, so a scope keeps its cursor whichever project's spelling of it is read. */
95function listCursorKey(host: string, scope: string): string {
96 return `${host} ${scope.toLowerCase()}`;
98​
99function isTrackerUnusable(error: IssueTrackerError): boolean {
100 return error.reason === "missing-tool" || error.reason === "unauthenticated";
102​
103function toIssueError(operation: string): (error: IssueTrackerError) => IssueError {
104 return (error) =>
105 isTrackerUnusable(error)
106 ? new IssueUnavailableError({
107 reason: error.reason === "missing-tool" ? "tool-missing" : "unauthenticated",
108 tracker: error.tracker,
109 cause: error,
110 })
111 : new IssueOperationError({
112 operation,
113 detail: trackerDetail(error),
114 ...(error.reason === "not-found" || error.reason === "rate-limited"
115 ? { reason: error.reason }
116 : {}),
117 ...(error.retryAt === undefined ? {} : { retryAt: error.retryAt }),
118 cause: error,
119 });
121​
122const readOnly = (operation: string) =>
123 new IssueOperationError({
124 operation,
125 reason: "read-only",
126 detail:
127 "This issue belongs to a repository outside the selected project and cannot be changed from here.",
128 });
129​
130const unsupported = (operation: string, what: string) =>
131 new IssueOperationError({ operation, detail: `This tracker does not support ${what}.` });
132​
133export class IssueService extends Context.Service<
134 IssueService,
135 {
136 readonly list: (input: IssueListInput) => Effect.Effect<IssueListResult, IssueError>;
137 readonly detail: (input: IssueRef) => Effect.Effect<IssueDetail, IssueError>;
138 readonly comments: (
139 input: IssueCommentsPageInput,
140 ) => Effect.Effect<IssueCommentsPage, IssueError>;
141 readonly templates: (input: IssueScopeRef) => Effect.Effect<IssueTemplateList, IssueError>;
142 readonly candidates: (input: IssueScopeRef) => Effect.Effect<IssueCandidates, IssueError>;
143 readonly create: (input: IssueCreateInput) => Effect.Effect<IssueCreateResult, IssueError>;
144 readonly comment: (input: IssueCommentInput) => Effect.Effect<void, IssueError>;
145 readonly update: (input: IssueUpdateInput) => Effect.Effect<void, IssueError>;
146 readonly setState: (input: IssueSetStateInput) => Effect.Effect<void, IssueError>;
147 readonly react: (input: IssueReactionInput) => Effect.Effect<void, IssueError>;
148 /**
149 * The reference behind an issue URL: served by the project whose binding is that host and
150 * scope, else read-only through any project on the same tracker and host. `preferredProjectId`
151 * wins among equals, so a thread's own project serves its own issues.
152 */
153 /** The tracker and container a project's own issues live in. */
154 readonly projectScope: (
155 projectId: ProjectId,
156 ) => Effect.Effect<IssueScopeRef & { readonly host: string }, IssueError>;
157 readonly resolveUrl: (
158 url: string,
159 preferredProjectId?: ProjectId,
160 ) => Effect.Effect<
161 IssueRef & { readonly host: string; readonly writable: boolean },
162 IssueError
163 >;
164 }
165>()("t3/issue/IssueService") {}
166​
167const make = Effect.gen(function* () {
168 const registry = yield* IssueTrackerRegistry.IssueTrackerRegistry;
169 const projects = yield* ProjectService.ProjectService;
170 const repositoryIdentities = yield* RepositoryIdentityResolver.RepositoryIdentityResolver;
171 const bindings = yield* IssueTrackerBindings.IssueTrackerBindingsRepository;
172​
173 // Read per resolution so a binding saved in Settings applies without a restart.
174 const resolveStandaloneBinding = (
175 project: OrchestrationProjectShell,
176 ): Effect.Effect<ProjectTrackerBinding | null, IssueOperationError> =>
177 bindings.list.pipe(
178 Effect.map((bound) => {
179 const binding = bound.get(project.id);
180 const api = binding === undefined ? null : registry.get(binding.tracker);
181 if (binding === undefined || api === null || !isStandaloneIssueTracker(api)) return null;
182 return {
183 tracker: binding.tracker,
184 host: api.standalone.host,
185 scope: binding.scope,
186 };
187 }),
188 // A failed read is not an unbound project: that would list the git host's issues alone.
189 Effect.mapError(
190 (cause) =>
191 new IssueOperationError({
192 operation: "listProjects",
193 detail: "The project's issue tracker binding could not be read.",
194 cause,
195 }),
196 ),
197 );
198​
199 /**
200 * Where a project's issues live: its bound standalone tracker, its git host's, or both. The
201 * tracker bound in Settings leads, as the one the user chose for the project.
202 */
203 const resolveProjectTracker = (
204 project: OrchestrationProjectShell,
205 ): Effect.Effect<ReadonlyArray<ProjectTrackerBinding>, IssueOperationError> =>
206 Effect.all([
207 resolveStandaloneBinding(project),
208 (project.repositoryIdentity != null
209 ? Effect.succeed(project.repositoryIdentity)
210 : repositoryIdentities.resolve(project.workspaceRoot)
211 ).pipe(
212 Effect.map((repositoryIdentity) =>
213 resolveGitHostBinding({ ...project, repositoryIdentity }),
214 ),
215 ),
216 ]).pipe(Effect.map((resolved) => resolved.filter((binding) => binding !== null)));
217​
218 const listProjects = (filter: {
219 readonly projectId?: IssueListInput["projectId"];
220 readonly host?: string | undefined;
221 /** The link's `host:port`, for a host whose binding keeps its port. */
222 readonly authority?: string | undefined;
223 }) =>
224 (filter.projectId === undefined
225 ? projects.listShells()
226 : projects.getShell(filter.projectId).pipe(Effect.map(Option.toArray))
227 ).pipe(
228 Effect.mapError(
229 (cause) =>
230 new IssueOperationError({
231 operation: "listProjects",
232 detail: "The project list could not be read.",
233 cause,
234 }),
235 ),
236 Effect.flatMap((shells) =>
237 Effect.forEach(
238 shells,
239 (project) =>
240 resolveProjectTracker(project).pipe(
241 Effect.map((bindings) => bindings.map((binding) => ({ project, ...binding }))),
242 ),
243 { concurrency: SCOPE_CONCURRENCY },
244 ),
245 ),
246 Effect.map((bound) => {
247 const host = filter.host?.trim().toLowerCase();
248 const supported: SupportedProject[] = [];
249 const unimplemented = new Map<
250 string,
251 { tracker: IssueTrackerKind; projectCount: number }
252 >();
253 for (const candidate of bound.flat()) {
254 if (host !== undefined && candidate.host !== host && candidate.host !== filter.authority)
255 continue;
256 const api = registry.get(candidate.tracker);
257 if (api === null) {
258 const counted = unimplemented.get(candidate.host);
259 if (counted === undefined)
260 unimplemented.set(candidate.host, { tracker: candidate.tracker, projectCount: 1 });
261 else counted.projectCount += 1;
262 continue;
263 }
264 supported.push({ ...candidate, api });
265 }
266 return { supported, unimplemented };
267 }),
268 );
269​
270 /**
271 * The project whose checkout and credentials serve a reference, and whether the reference is
272 * the project's own scope. A reference naming another scope on the same tracker and host is
273 * served by the project but marked read-only. A project with two trackers serves the one the
274 * reference names.
275 */
276 const requireProject = (
277 ref: IssueScopeRef,
278 ): Effect.Effect<SupportedProject & { readonly writable: boolean }, IssueError> =>
279 listProjects({ projectId: ref.projectId }).pipe(
280 Effect.flatMap(({ supported }) => {
281 const own = supported.find((candidate) => candidate.tracker === ref.tracker);
282 if (own === undefined) {
283 return Effect.fail(new IssueUnavailableError({ reason: "tracker-unsupported" }));
284 }
285 const host = ref.host?.trim().toLowerCase() ?? own.host;
286 if (host !== own.host) {
287 return Effect.fail(new IssueUnavailableError({ reason: "tracker-unsupported" }));
288 }
289 const scope = ref.scope.trim();
290 const writable = scope.toLowerCase() === own.scope.toLowerCase();
291 return Effect.succeed({ ...own, scope, writable });
292 }),
293 );
294​
295 const requireWritable = (ref: IssueScopeRef, operation: string) =>
296 requireProject(ref).pipe(
297 Effect.filterOrFail(
298 (project) => project.writable,
299 () => readOnly(operation),
300 ),
301 );
302​
303 const list: IssueService["Service"]["list"] = Effect.fn("IssueService.list")(function* (input) {
304 const { supported, unimplemented } = yield* listProjects(input);
305 const limit = input.limit ?? DEFAULT_LIST_LIMIT;
306 // Worktrees of one repository are separate projects, and every repository of an Azure
307 // DevOps project shares its work items; read each scope once.
308 const scopes = new Map<string, SupportedProject>();
309 for (const project of supported) {
310 const key = listCursorKey(project.host, project.scope);
311 if (!scopes.has(key)) scopes.set(key, project);
312 }
313 const continuing = input.cursors;
314 const viewers = new Map<string, string>();
315 const trackers = new Map<string, IssueTrackerSummary>();
316 const entries: IssueListEntry[] = [];
317 const errors: IssueListProjectError[] = [];
318 const nextCursors: Record<string, string> = {};
319​
320 const viewerRequests = new Map<string, Effect.Effect<string, IssueTrackerError>>();
321 for (const project of scopes.values()) {
322 if (viewerRequests.has(project.host)) continue;
323 const request = yield* Effect.cached(
324 project.api
325 .getViewer({ cwd: project.project.workspaceRoot, host: project.host })
326 .pipe(Effect.tap((viewer) => Effect.sync(() => viewers.set(project.host, viewer)))),
327 );
328 viewerRequests.set(project.host, request);
329 }
330​
331 // Every project counts, including worktrees of a scope read once below.
332 for (const project of supported) {
333 const existing = trackers.get(project.host);
334 trackers.set(
335 project.host,
336 existing === undefined
337 ? {
338 tracker: project.tracker,
339 host: project.host,
340 projectCount: 1,
341 capabilities: project.api.capabilities,
342 configured: true,
343 detail: null,
344 }
345 : { ...existing, projectCount: existing.projectCount + 1 },
346 );
347 }
348 const recordFailure = (project: SupportedProject, failure: IssueTrackerError) => {
349 const existing = trackers.get(project.host);
350 if (existing !== undefined && isTrackerUnusable(failure))
351 trackers.set(project.host, {
352 ...existing,
353 configured: false,
354 detail: trackerDetail(failure),
355 });
356 };
357​
358 yield* Effect.forEach(
359 scopes.values(),
360 (project) =>
361 Effect.gen(function* () {
362 const key = listCursorKey(project.host, project.scope);
363 // A continuation names the scopes it wants; one not named has nothing to add.
364 if (continuing !== undefined && continuing[key] === undefined) return;
365 const cursor = continuing?.[key];
366 const page = yield* viewerRequests.get(project.host)!.pipe(
367 Effect.flatMap((viewer) =>
368 project.api.listIssues({
369 cwd: project.project.workspaceRoot,
370 host: project.host,
371 scope: project.scope,
372 state: input.state,
373 involvement: input.involvement ?? "all",
374 viewer,
375 limit,
376 query: input.query,
377 labels: input.labels,
378 assignee: input.assignee,
379 sort: input.sort ?? "updated",
380 cursor,
381 }),
382 ),
383 Effect.result,
384 );
385 if (page._tag === "Failure") {
386 if (cursor !== undefined) nextCursors[key] = cursor;
387 recordFailure(project, page.failure);
388 errors.push({
389 projectId: project.project.id,
390 projectTitle: project.project.title,
391 message: trackerDetail(page.failure),
392 });
393 return;
394 }
395 for (const item of page.success.items) {
396 entries.push({
397 ...item,
398 tracker: project.tracker,
399 host: project.host,
400 scope: project.scope,
401 projectId: project.project.id,
402 projectTitle: project.project.title,
403 });
404 }
405 if (page.success.nextCursor !== null) nextCursors[key] = page.success.nextCursor;
406 }),
407 { concurrency: SCOPE_CONCURRENCY, discard: true },
408 );
409​
410 for (const [host, { tracker, projectCount }] of unimplemented) {
411 trackers.set(host, {
412 tracker,
413 host,
414 projectCount,
415 capabilities: null,
416 configured: false,
417 detail: "Issues cannot be browsed for this host yet.",
418 });
419 }
420 entries.sort((a, b) => b.updatedAt.localeCompare(a.updatedAt));
421 return {
422 viewers: Object.fromEntries(viewers),
423 trackers: [...trackers.values()],
424 entries,
425 errors,
426 nextCursors,
427 scopes: [...scopes.values()].map((project) => ({
428 projectId: project.project.id,
429 tracker: project.tracker,
430 host: project.host,
431 scope: project.scope,
432 })),
433 };
434 });
435​
436 const detail: IssueService["Service"]["detail"] = (input) =>
437 requireProject(input).pipe(
438 Effect.flatMap((project) =>
439 project.api
440 .getIssue({
441 cwd: project.project.workspaceRoot,
442 host: project.host,
443 scope: project.scope,
444 key: input.key,
445 })
446 .pipe(
447 Effect.mapError(toIssueError("detail")),
448 Effect.map((issue): IssueDetail => ({
449 ...issue,
450 tracker: project.tracker,
451 host: project.host,
452 scope: project.scope,
453 projectId: project.project.id,
454 projectTitle: project.project.title,
455 writable: project.writable,
456 capabilities: project.api.capabilities,
457 })),
458 ),
459 ),
460 );
461​
462 const comments: IssueService["Service"]["comments"] = (input) =>
463 requireProject(input).pipe(
464 Effect.flatMap((project) =>
465 project.api
466 .getComments({
467 cwd: project.project.workspaceRoot,
468 host: project.host,
469 scope: project.scope,
470 key: input.key,
471 cursor: input.cursor,
472 })
473 .pipe(Effect.mapError(toIssueError("comments"))),
474 ),
475 );
476​
477 const templates: IssueService["Service"]["templates"] = (input) =>
478 requireProject(input).pipe(
479 Effect.flatMap((project) =>
480 project.api.listTemplates === undefined || !project.api.capabilities.templates
481 ? Effect.fail(unsupported("templates", "issue templates"))
482 : project.api
483 .listTemplates({
484 cwd: project.project.workspaceRoot,
485 host: project.host,
486 scope: project.scope,
487 })
488 .pipe(Effect.mapError(toIssueError("templates"))),
489 ),
490 );
491​
492 const candidates: IssueService["Service"]["candidates"] = (input) =>
493 requireProject(input).pipe(
494 Effect.flatMap((project) =>
495 project.api.listCandidates === undefined ||
496 !(project.api.capabilities.labels || project.api.capabilities.assignees)
497 ? Effect.fail(unsupported("candidates", "labels or assignees"))
498 : project.api
499 .listCandidates({
500 cwd: project.project.workspaceRoot,
501 host: project.host,
502 scope: project.scope,
503 })
504 .pipe(Effect.mapError(toIssueError("candidates"))),
505 ),
506 );
507​
508 const create: IssueService["Service"]["create"] = (input) =>
509 requireWritable(input, "create").pipe(
510 Effect.flatMap((project) =>
511 project.api.create === undefined || !project.api.capabilities.create
512 ? Effect.fail(unsupported("create", "filing issues"))
513 : project.api
514 .create({
515 cwd: project.project.workspaceRoot,
516 host: project.host,
517 scope: project.scope,
518 title: input.title,
519 body: input.body,
520 labels: input.labels,
521 assignees: input.assignees,
522 })
523 .pipe(Effect.mapError(toIssueError("create"))),
524 ),
525 );
526​
527 const comment: IssueService["Service"]["comment"] = (input) =>
528 requireWritable(input, "comment").pipe(
529 Effect.flatMap((project) => {
530 if (input.body.trim().length === 0) {
531 return Effect.fail(
532 new IssueOperationError({ operation: "comment", detail: "A comment needs some text." }),
533 );
534 }
535 return project.api.comment === undefined || !project.api.capabilities.comment
536 ? Effect.fail(unsupported("comment", "comments"))
537 : project.api
538 .comment({
539 cwd: project.project.workspaceRoot,
540 host: project.host,
541 scope: project.scope,
542 key: input.key,
543 body: input.body,
544 })
545 .pipe(Effect.mapError(toIssueError("comment")));
546 }),
547 );
548​
549 const update: IssueService["Service"]["update"] = (input) =>
550 requireWritable(input, "update").pipe(
551 Effect.flatMap((project) => {
552 const { capabilities } = project.api;
553 const wantsWords = input.title !== undefined || input.body !== undefined;
554 if (!wantsWords && input.labels === undefined && input.assignees === undefined) {
555 return Effect.fail(
556 new IssueOperationError({ operation: "update", detail: "Nothing to change." }),
557 );
558 }
559 if (project.api.update === undefined) return Effect.fail(unsupported("update", "edits"));
560 if (wantsWords && !capabilities.edit)
561 return Effect.fail(unsupported("update", "editing the title or body"));
562 if (input.labels !== undefined && !capabilities.labels)
563 return Effect.fail(unsupported("update", "labels"));
564 if (input.assignees !== undefined && !capabilities.assignees)
565 return Effect.fail(unsupported("update", "assignees"));
566 return project.api
567 .update({
568 cwd: project.project.workspaceRoot,
569 host: project.host,
570 scope: project.scope,
571 key: input.key,
572 title: input.title,
573 body: input.body,
574 labels: input.labels,
575 assignees: input.assignees,
576 })
577 .pipe(Effect.mapError(toIssueError("update")));
578 }),
579 );
580​
581 const setState: IssueService["Service"]["setState"] = (input) =>
582 requireWritable(input, "setState").pipe(
583 Effect.flatMap((project) => {
584 if (project.api.setState === undefined)
585 return Effect.fail(unsupported("setState", "changing an issue's state"));
586 return project.api
587 .setState({
588 cwd: project.project.workspaceRoot,
589 host: project.host,
590 scope: project.scope,
591 key: input.key,
592 state: input.state,
593 })
594 .pipe(Effect.mapError(toIssueError("setState")));
595 }),
596 );
597​
598 const react: IssueService["Service"]["react"] = (input) =>
599 requireWritable(input, "react").pipe(
600 Effect.flatMap((project) =>
601 project.api.setReaction === undefined || !project.api.capabilities.reactions
602 ? Effect.fail(unsupported("react", "reactions"))
603 : project.api
604 .setReaction({
605 cwd: project.project.workspaceRoot,
606 host: project.host,
607 scope: project.scope,
608 key: input.key,
609 subjectId: input.subjectId,
610 content: input.content,
611 reacted: input.reacted,
612 })
613 .pipe(Effect.mapError(toIssueError("react"))),
614 ),
615 );
616​
617 const projectScope: IssueService["Service"]["projectScope"] = Effect.fn(
618 "IssueService.projectScope",
619 )(function* (projectId) {
620 const { supported } = yield* listProjects({ projectId });
621 const [own] = supported;
622 if (own === undefined) {
623 return yield* new IssueUnavailableError({ reason: "tracker-unsupported" });
624 }
625 return { projectId, tracker: own.tracker, host: own.host, scope: own.scope };
626 });
627​
628 const resolveUrl: IssueService["Service"]["resolveUrl"] = Effect.fn("IssueService.resolveUrl")(
629 function* (url, preferredProjectId) {
630 const parsed = sourceControlDefinitions.parseIssueUrl(url);
631 if (parsed === null) {
632 return yield* new IssueOperationError({
633 operation: "resolveUrl",
634 reason: "not-found",
635 detail: "This is not a recognised issue URL.",
636 });
637 }
638 const { definition, link } = parsed;
639 // A link names its server's port; a binding does only when its remote or web URL did.
640 const authority = new URL(url).host.toLowerCase();
641 const { supported } = yield* listProjects({ host: link.host, authority });
642 const onHost = supported.filter(
643 (project) => project.tracker === IssueTrackerKind.make(definition.kind),
644 );
645 const onAuthority = onHost.filter((project) => project.host === authority);
646 const onTracker = onAuthority.length > 0 ? onAuthority : onHost;
647 const preferFirst = (projects: ReadonlyArray<SupportedProject>) =>
648 projects.find((project) => project.project.id === preferredProjectId) ?? projects[0];
649 const own = preferFirst(
650 onTracker.filter((project) => project.scope.toLowerCase() === link.scope),
651 );
652 const lender = own ?? preferFirst(onTracker);
653 if (lender === undefined) {
654 return yield* new IssueUnavailableError({ reason: "tracker-unsupported" });
655 }
656 return {
657 projectId: lender.project.id,
658 tracker: lender.tracker,
659 host: lender.host,
660 scope: own === undefined ? link.scope : lender.scope,
661 key: link.key,
662 writable: own !== undefined,
663 };
664 },
665 );
666​
667 return IssueService.of({
668 list,
669 detail: traced("detail", detail),
670 comments: traced("comments", comments),
671 templates: traced("templates", templates),
672 candidates: interactive(traced("candidates", candidates)),
673 create: interactive(traced("create", create)),
674 comment: interactive(traced("comment", comment)),
675 update: interactive(traced("update", update)),
676 setState: interactive(traced("setState", setState)),
677 react: interactive(traced("react", react)),
678 projectScope,
679 resolveUrl,
680 });
681});
682​
683export const layer = Layer.effect(IssueService, make);