-
Notifications
You must be signed in to change notification settings - Fork 318
feat(integrations): cloud services (AWS/GCP/Azure) as evidence integrations #2985
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
665f454
e84d747
5f6bebc
9df1803
d1c6368
220982b
a467ff9
6ef7ad0
0b8a52d
3ec918a
46c7ff6
239aea4
96e1f04
67a23d8
b1b5579
78e987c
d59e4c7
4a6b64a
63dab6d
cdde662
05d1cce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -305,11 +305,34 @@ export class ConnectionsController { | |
| description: s.description, | ||
| enabledByDefault: s.enabledByDefault ?? true, | ||
| implemented: s.implemented ?? true, | ||
| mappedTasks: this.buildServiceTaskMappings(m.checks, s.id), | ||
| })) ?? [], | ||
| }; | ||
| }); | ||
| } | ||
|
|
||
| /** | ||
| * Evidence tasks a single service's checks satisfy: distinct taskMappings of | ||
| * the manifest checks whose `service` equals serviceId, resolved to names. | ||
| */ | ||
| private buildServiceTaskMappings( | ||
| checks: | ||
| | ReadonlyArray<{ service?: string; taskMapping?: TaskTemplateId }> | ||
| | undefined, | ||
| serviceId: string, | ||
| ): Array<{ id: string; name: string }> { | ||
| const out: Array<{ id: string; name: string }> = []; | ||
| const seen = new Set<string>(); | ||
| for (const check of checks ?? []) { | ||
| if (check.service !== serviceId || !check.taskMapping) continue; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Per-service task mapping now silently excludes checks without a Prompt for AI agents
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Per-service task mapping now silently excludes checks without a Prompt for AI agents |
||
| if (seen.has(check.taskMapping)) continue; | ||
| seen.add(check.taskMapping); | ||
| const info = TASK_TEMPLATE_INFO[check.taskMapping]; | ||
| if (info) out.push({ id: check.taskMapping, name: info.name }); | ||
| } | ||
| return out; | ||
| } | ||
|
|
||
| /** | ||
| * Get a specific provider's details | ||
| */ | ||
|
|
@@ -398,6 +421,7 @@ export class ConnectionsController { | |
| description: s.description, | ||
| enabledByDefault: s.enabledByDefault ?? true, | ||
| implemented: s.implemented ?? true, | ||
| mappedTasks: this.buildServiceTaskMappings(manifest.checks, s.id), | ||
| })) ?? [], | ||
| }; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| 'use client'; | ||
|
|
||
| import { Button } from '@trycompai/design-system'; | ||
| import { ArrowRight } from '@trycompai/design-system/icons'; | ||
| import Link from 'next/link'; | ||
|
|
||
| /** The resolved live task for a mapped template, when it exists in the org. */ | ||
| export interface EvidenceTaskRowTask { | ||
| taskId: string; | ||
| name: string; | ||
| description: string; | ||
| } | ||
|
|
||
| interface EvidenceTaskRowProps { | ||
| /** Name shown when the template has no live task in this org. */ | ||
| fallbackName: string; | ||
| task?: EvidenceTaskRowTask; | ||
| orgId: string; | ||
| /** Action label when the task exists (e.g. 'Open', 'View task'). */ | ||
| buttonLabel?: string; | ||
| /** When the tasks fetch failed, distinguish "couldn't load" from "not added". */ | ||
| tasksErrored?: boolean; | ||
| } | ||
|
|
||
| /** | ||
| * A single evidence-task row: task name + description with an "open" action, or | ||
| * a not-added / load-error fallback. Shared by the integration detail page and | ||
| * the per-service detail page so the row markup has one source of truth. | ||
| */ | ||
| export function EvidenceTaskRow({ | ||
| fallbackName, | ||
| task, | ||
| orgId, | ||
| buttonLabel = 'Open', | ||
| tasksErrored = false, | ||
| }: EvidenceTaskRowProps) { | ||
| return ( | ||
| <div className="flex items-center justify-between gap-4 px-4 py-3"> | ||
| <div className="min-w-0"> | ||
| <p className="truncate text-sm font-medium">{task?.name ?? fallbackName}</p> | ||
| <p className="mt-0.5 line-clamp-2 text-xs text-muted-foreground"> | ||
| {task?.description || | ||
| 'Mapped to this template, but the task is not in this organization yet.'} | ||
| </p> | ||
| </div> | ||
|
|
||
| {task ? ( | ||
| <Button | ||
| size="sm" | ||
| variant="outline" | ||
| render={<Link href={`/${orgId}/tasks/${task.taskId}`} />} | ||
| iconRight={<ArrowRight size={14} />} | ||
| > | ||
| {buttonLabel} | ||
| </Button> | ||
| ) : ( | ||
| <span className="shrink-0 text-xs text-muted-foreground"> | ||
| {tasksErrored ? 'Couldn’t load tasks' : 'Not added'} | ||
| </span> | ||
| )} | ||
| </div> | ||
| ); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: Per-service task mapping now silently excludes checks without a
servicetag, causing empty/incorrect evidence-task counts for cloud providers like Vercel.Prompt for AI agents