Skip to content

feat(apollo-vertex): add Solution Tests data layer (collection-backed hooks)#790

Draft
frankkluijtmans wants to merge 1 commit into
mainfrom
frankkluijtmans/solution-tests-hooks
Draft

feat(apollo-vertex): add Solution Tests data layer (collection-backed hooks)#790
frankkluijtmans wants to merge 1 commit into
mainfrom
frankkluijtmans/solution-tests-hooks

Conversation

@frankkluijtmans

Copy link
Copy Markdown
Contributor

Summary

The data layer for the Solution Tests component, split out of #782 so it can land and be reviewed ahead of the UI. The view components depend on this, so the components PR is stacked on this branch and merges after it.

Contents (all under registry/solution-tests/, plus the en.json keys):

  • adapter.tsSolutionTestsAdapter interface + MutationResult / ResultAttachmentField
  • data-fabric-adapter.tscreateDataFabricAdapter (entity/trigger-name-driven, generic UiPathST* defaults) over a small SolutionTestsDataPort
  • context.tsxSolutionTestsProvider + context hooks; config.ts (subjectColumns, subjectNoun, statusLabels, thresholds)
  • use-solution-tests-data.ts — TanStack Query reads/mutations + active-run polling
  • hooks.tsstub of the planned vs-core collection-backed hook API (not wired; documents the future swap)
  • types.ts, status-maps.ts, utils.ts, user-messages.ts, and the en.json translation keys

Not included here: the rendered components, the registry.json entry, and the demo/docs — those are in the stacked components PR (solution-tests only becomes an installable registry item once both land).

Testing

pnpm typecheck and pnpm lint pass.

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings June 8, 2026 12:51
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (PT)
apollo-design 🟢 Ready Preview, Logs Jun 08, 2026, 07:40:10 AM
apollo-docs 🟢 Ready Preview, Logs Jun 08, 2026, 07:40:10 AM
apollo-landing 🟢 Ready Preview, Logs Jun 08, 2026, 07:40:10 AM
apollo-ui-react 🟢 Ready Preview, Logs Jun 08, 2026, 07:40:10 AM
apollo-vertex 🟢 Ready Preview, Logs Jun 08, 2026, 07:40:10 AM

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Dependency License Review

  • 1902 package(s) scanned
  • ✅ No license issues found
  • ⚠️ 2 package(s) excluded (see details below)
License distribution
License Packages
MIT 1672
ISC 89
Apache-2.0 55
BSD-3-Clause 27
BSD-2-Clause 23
BlueOak-1.0.0 8
MPL-2.0 4
MIT-0 3
CC0-1.0 3
MIT OR Apache-2.0 2
(MIT OR Apache-2.0) 2
Unlicense 2
LGPL-3.0-or-later 1
Python-2.0 1
CC-BY-4.0 1
(MPL-2.0 OR Apache-2.0) 1
Unknown 1
Artistic-2.0 1
(WTFPL OR MIT) 1
(BSD-2-Clause OR MIT OR Apache-2.0) 1
CC-BY-3.0 1
0BSD 1
(MIT OR CC0-1.0) 1
MIT AND ISC 1
Excluded packages
Package Version License Reason
@img/sharp-libvips-linux-x64 1.2.4 LGPL-3.0-or-later LGPL pre-built binary, not linked
khroma 2.1.0 Unknown MIT per GitHub repo, missing license field in package.json

frankkluijtmans added a commit that referenced this pull request Jun 8, 2026
The UI + registry wiring for the Solution Tests component. Stacked on the data
layer PR (#790) — the view consumes the adapter/context/config/hooks from there.

- SolutionTestsView + KPI bar, tabs, expandable rows, run-details dialog,
  evaluator results, JSON viewer, delete confirm, user-message popover
- index.ts barrel; registry.json entry (installable as @uipath/solution-tests);
  tsconfig path alias
- SolutionTestsTemplate demo (in-memory mock) + Templates docs page and nav

Merge after #790.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces the initial data-layer foundation for the Solution Tests registry item in Apollo Vertex (adapter contract, DataFabric-backed default adapter, context/config wiring, and TanStack Query hook), plus supporting types/utilities and new English i18n keys needed by the upcoming UI.

Changes:

  • Added SolutionTestsAdapter contract and a default DataFabric/Orchestrator-backed adapter factory (createDataFabricAdapter).
  • Added provider/context + resolved presentation config, and a TanStack Query-based hook for reads/mutations with polling support.
  • Added shared view-model types, status-to-badge maps, user-message parsing helpers, and new en.json translation keys.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
apps/apollo-vertex/registry/solution-tests/adapter.ts Defines the adapter interface + mutation/attachment types used by the Solution Tests view.
apps/apollo-vertex/registry/solution-tests/config.ts Defines per-vertical presentation configuration and default resolution.
apps/apollo-vertex/registry/solution-tests/context.tsx Provides adapter/config via React context for deep component access.
apps/apollo-vertex/registry/solution-tests/data-fabric-adapter.ts Implements a default adapter over a minimal “data port” for DataFabric queries + triggers/functions.
apps/apollo-vertex/registry/solution-tests/hooks.ts Documents a future vs-core collection-backed hook API (stubbed, not wired).
apps/apollo-vertex/registry/solution-tests/status-maps.ts Maps numeric statuses to badge variants / classes for display.
apps/apollo-vertex/registry/solution-tests/types.ts Declares domain-neutral Solution Tests view model types + default label maps.
apps/apollo-vertex/registry/solution-tests/use-solution-tests-data.ts Adds TanStack Query reads/mutations and run polling behavior for the view.
apps/apollo-vertex/registry/solution-tests/user-messages.ts Adds parsing + severity helpers for user-messages payloads.
apps/apollo-vertex/registry/solution-tests/utils.ts Adds formatting helpers and small run/result utilities.
apps/apollo-vertex/locales/en.json Adds new English translation keys required by the Solution Tests feature.

Comment on lines +30 to +48
const { data, isLoading, error } = useQuery({
queryKey: QUERY_KEY,
queryFn: () => fetchData(adapter),
});

const tests = data?.tests ?? [];
const batchRuns = data?.batchRuns ?? [];

const hasActiveRuns = batchRuns.some(
(r) => r.Status === RunStatus.Pending || r.Status === RunStatus.Running,
);

// Poll while runs are active (syncing with an external timer).
useQuery({
queryKey: [...QUERY_KEY, "polling"],
queryFn: () => fetchData(adapter),
refetchInterval: config.pollIntervalMs,
enabled: hasActiveRuns,
});
Comment on lines +77 to +85
const runAllMutation = useMutation({
mutationFn: () => adapter.runTests(),
onSuccess: (result) => {
assertOk(result, t("failed_to_run_tests"));
toast.success(t("all_tests_triggered"));
invalidate();
},
onError: onMutationError(),
});
Comment on lines +87 to +95
const runTestMutation = useMutation({
mutationFn: (testId: string) => adapter.runTests([testId]),
onSuccess: (result) => {
assertOk(result, t("failed_to_run_test"));
toast.success(t("test_triggered"));
invalidate();
},
onError: onMutationError(),
});
Comment on lines +107 to +115
const forceStopBatchMutation = useMutation({
mutationFn: (batchId: string) => adapter.forceStopBatch(batchId),
onSuccess: (result) => {
assertOk(result, t("failed_to_force_stop_batch"));
toast.success(t("force_stop_initiated"));
invalidate();
},
onError: onMutationError(),
});
Comment on lines +117 to +126
const deleteMutation = useMutation({
mutationFn: (testId: string) => adapter.deleteTest(testId),
onSuccess: (result) => {
assertOk(result, t("failed_to_delete_test"));
toast.success(t("test_deleted"));
invalidate();
},
onError: onMutationError(),
onSettled: () => setDeleteConfirmId(null),
});
Comment on lines +13 to +16
export function formatJson(data: unknown): string {
if (data == null) return "No data available";
if (typeof data === "string") return data;
return JSON.stringify(data, null, 2);
Comment on lines +3 to +6
export function formatDate(value?: string): string {
if (!value) return "-";
return new Date(value).toLocaleString();
}
@frankkluijtmans frankkluijtmans force-pushed the frankkluijtmans/solution-tests-hooks branch from 1258a4c to e3b6b1c Compare June 8, 2026 13:26
@github-actions github-actions Bot added size:XL 500-999 changed lines. and removed size:XXL 1,000+ changed lines. labels Jun 8, 2026
frankkluijtmans added a commit that referenced this pull request Jun 8, 2026
The UI + registry wiring for the Solution Tests component. Stacked on the data
layer PR (#790) — the view consumes the adapter/context/config/hooks from there.

- SolutionTestsView + KPI bar, tabs, expandable rows, run-details dialog,
  evaluator results, JSON viewer, delete confirm, user-message popover
- index.ts barrel; registry.json entry (installable as @uipath/solution-tests);
  tsconfig path alias
- SolutionTestsTemplate demo (in-memory mock) + Templates docs page and nav

Merge after #790.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 8, 2026 13:34
@frankkluijtmans frankkluijtmans force-pushed the frankkluijtmans/solution-tests-hooks branch from e3b6b1c to b9d2ae2 Compare June 8, 2026 13:34
frankkluijtmans added a commit that referenced this pull request Jun 8, 2026
The UI + registry wiring for the Solution Tests component. Stacked on the data
layer PR (#790) — the view consumes the adapter/context/config/hooks from there.

- SolutionTestsView + KPI bar, tabs, expandable rows, run-details dialog,
  evaluator results, JSON viewer, delete confirm, user-message popover
- index.ts barrel; registry.json entry (installable as @uipath/solution-tests);
  tsconfig path alias
- SolutionTestsTemplate demo (in-memory mock) + Templates docs page and nav

Merge after #790.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.

Comment on lines +30 to +48
const { data, isLoading, error } = useQuery({
queryKey: QUERY_KEY,
queryFn: () => fetchData(adapter),
});

const tests = data?.tests ?? [];
const batchRuns = data?.batchRuns ?? [];

const hasActiveRuns = batchRuns.some(
(r) => r.Status === RunStatus.Pending || r.Status === RunStatus.Running,
);

// Poll while runs are active (syncing with an external timer).
useQuery({
queryKey: [...QUERY_KEY, "polling"],
queryFn: () => fetchData(adapter),
refetchInterval: config.pollIntervalMs,
enabled: hasActiveRuns,
});
Comment on lines +3 to +6
export function formatDate(value?: string): string {
if (!value) return "-";
return new Date(value).toLocaleString();
}
Comment on lines +32 to +33
if (typeof parsed !== "object" || parsed === null) return false;
return "auto_pass" in parsed;
Comment on lines +21 to +24
[RunResultStatus.Passed]: "success",
[RunResultStatus.Failed]: "error",
[RunResultStatus.Error]: "warning",
[RunResultStatus.NoBaseline]: "info",
Comment on lines +137 to +139
togglingTestId: toggleActiveMutation.isPending
? (toggleActiveMutation.variables as { testId: string }).testId
: null,
@frankkluijtmans frankkluijtmans force-pushed the frankkluijtmans/solution-tests-hooks branch from b9d2ae2 to cf96c5b Compare June 8, 2026 14:35
frankkluijtmans added a commit that referenced this pull request Jun 8, 2026
The UI + registry wiring for the Solution Tests component, stacked on the data
layer PR (#790). The view is presentational (dumb): data + handlers arrive via
props/render-props from a smart container that calls the collection hooks. The
demo renders the dumb view with in-memory mock data (no vs-core), mirroring the
GroupMembershipGuard demo.
Copilot AI review requested due to automatic review settings June 10, 2026 15:57
@frankkluijtmans frankkluijtmans force-pushed the frankkluijtmans/solution-tests-hooks branch from cf96c5b to 7992e7f Compare June 10, 2026 15:57
frankkluijtmans added a commit that referenced this pull request Jun 10, 2026
The UI + registry wiring for the Solution Tests component, stacked on the data
layer PR (#790). The view is presentational (dumb): data + handlers arrive via
props/render-props from a smart container that calls the collection hooks. The
demo renders the dumb view with in-memory mock data (no vs-core), mirroring the
GroupMembershipGuard demo.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 19 changed files in this pull request and generated 7 comments.

Comment on lines +7 to +23
function isUserMessageItem(value: unknown): value is UserMessageItem {
if (typeof value !== "object" || value === null) return false;
return (
"key" in value &&
typeof value.key === "string" &&
"category" in value &&
typeof value.category === "string" &&
MESSAGE_CATEGORIES.has(value.category) &&
"message" in value &&
typeof value.message === "string" &&
"timestamp" in value &&
typeof value.timestamp === "string" &&
"details" in value &&
typeof value.details === "object" &&
value.details !== null
);
}
export function useSolutionTests(): UseSolutionTestsResult {
const solution = useSolution();
const { data, isLoading } = useLiveQuery<SolutionTest>((q) =>
q.from({ tests: solution?.api.collections.solutionTests[ENTITY.tests] }),
export function useSolutionTestRuns(): UseSolutionTestRunsResult {
const solution = useSolution();
const { data, isLoading } = useLiveQuery<SolutionTestRun>((q) =>
q.from({ runs: solution?.api.collections.solutionTests[ENTITY.runs] }),
const solution = useSolution();
const { data, isLoading } = useLiveQuery<SolutionTestBatchRun>((q) =>
q.from({
batchRuns: solution?.api.collections.solutionTests[ENTITY.batchRuns],
const solution = useSolution();
const { data, isLoading } = useLiveQuery<SolutionTestRunResult>((q) =>
q.from({
runResults: solution?.api.collections.solutionTests[ENTITY.runResults],
export function useBaselineJobs(testId: string): UseBaselineJobsResult {
const solution = useSolution();
const { data, isLoading } = useLiveQuery<SolutionTestJob>((q) =>
q.from({ jobs: solution?.api.collections.solutionTests[ENTITY.jobs] }),
Comment on lines +137 to +143
} catch {
// Network/timeout — the job was likely started; treat as fire-and-forget.
return {
success: true,
message: "Request sent (response timed out — job may still be running)",
};
}
@frankkluijtmans frankkluijtmans force-pushed the frankkluijtmans/solution-tests-hooks branch from 7992e7f to fde61bb Compare June 11, 2026 11:40
frankkluijtmans added a commit that referenced this pull request Jun 11, 2026
The UI + registry wiring for the Solution Tests component, stacked on the data
layer PR (#790). The view is presentational (dumb): data + handlers arrive via
props/render-props from a smart container that calls the collection hooks. The
demo renders the dumb view with in-memory mock data (no vs-core), mirroring the
GroupMembershipGuard demo.
@frankkluijtmans frankkluijtmans changed the title feat(apollo-vertex): Solution Tests data layer (adapter + hooks) feat(apollo-vertex): add Solution Tests data layer (collection-backed hooks) Jun 11, 2026
Copilot AI review requested due to automatic review settings June 11, 2026 13:47
@frankkluijtmans frankkluijtmans force-pushed the frankkluijtmans/solution-tests-hooks branch from fde61bb to d9b3be3 Compare June 11, 2026 13:47
frankkluijtmans added a commit that referenced this pull request Jun 11, 2026
The UI + registry wiring for the Solution Tests component, stacked on the data
layer PR (#790). The view is presentational (dumb): data + handlers arrive via
props/render-props from a smart container that calls the collection hooks. The
demo renders the dumb view with in-memory mock data (no vs-core), mirroring the
GroupMembershipGuard demo.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 19 changed files in this pull request and generated 7 comments.

Comment on lines +137 to +143
} catch {
// Network/timeout — the job was likely started; treat as fire-and-forget.
return {
success: true,
message: "Request sent (response timed out — job may still be running)",
};
}
Comment on lines +52 to +56
return {
mutate: (testId: string, isActive: boolean) =>
actions.toggleTestActive(testId, isActive),
isPending: false,
};
Comment on lines +55 to +60
export function useJobExpectedOutput(): AttachmentFetcher<[jobId: string]> {
const actions = useSolutionTestsActions();
return {
fetch: (jobId: string) => actions.getJobExpectedOutput(jobId),
};
}
Comment on lines +85 to +89
const actions = useSolutionTestsActions();
return {
fetch: (resultId: string, field: ResultAttachmentField) =>
actions.getResultAttachment(resultId, field),
};
Comment on lines +19 to +21
"details" in value &&
typeof value.details === "object" &&
value.details !== null
Comment on lines +1 to +5
/**
* Collection-backed data layer for the Solution Tests view — one module per
* query entity, each owning its live read plus the writes that act on it:
* - `use-solution-tests` — tests list + run / toggle-active / delete
* - `use-solution-test-batch-runs` — batch-run list
Comment on lines +20 to +27
export const runResultStatusBadgeMap: Record<number, BadgeStatus> = {
[RunResultStatus.Passed]: "success",
[RunResultStatus.Failed]: "error",
[RunResultStatus.Error]: "warning",
[RunResultStatus.NoBaseline]: "info",
[RunResultStatus.Pending]: "info",
[RunResultStatus.Aborted]: "warning",
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app:apollo-vertex size:XL 500-999 changed lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants