Skip to content

Fix virtual fields typed as never when mixed with relation fields in select/include #1012

Fix virtual fields typed as never when mixed with relation fields in select/include

Fix virtual fields typed as never when mixed with relation fields in select/include #1012

Triggered via pull request March 27, 2026 06:20
Status Failure
Total duration 2m 50s
Artifacts 1

test.yml

on: pull_request
Fit to window
Zoom out
Zoom in

Annotations

4 errors, 8 warnings, and 1 notice
test
Process completed with exit code 1.
test
@opensaas/stack-cli#test: command (/home/runner/work/stack/stack/packages/cli) /home/runner/setup-pnpm/node_modules/.bin/pnpm run test exited (1)
src/commands/generate.test.ts > Generate Command Integration > Generator Integration > should handle empty lists config: packages/cli/src/commands/generate.test.ts#L226
Error: Snapshot `Generate Command Integration > Generator Integration > should handle empty lists config > empty-lists-types 1` mismatched - Expected + Received @@ -5,10 +5,18 @@ import type { Session as OpensaasSession, StorageUtils, ServerActionProps, AccessControlledDB, AccessContext } from '@opensaas/stack-core' import type { PrismaClient, Prisma } from './prisma-client/client' import type { PluginServices } from './plugin-types' + // Utility: strips virtual field keys from select/include so Prisma GetPayload never sees them + type StripVirtualFromArgs<T, VirtualKeys extends string> = + T extends { select: infer S extends object } + ? Omit<T, 'select'> & { select: Omit<S, VirtualKeys> } + : T extends { include: infer I extends object } + ? Omit<T, 'include'> & { include: Omit<I, VirtualKeys> } + : T + /** * Custom DB type that uses Prisma's conditional types with virtual and transformed field support * Types change based on select/include - relationships only present when explicitly included * Virtual fields and transformed fields are added to the base model type */ ❯ src/commands/generate.test.ts:226:21
src/commands/generate.test.ts > Generate Command Integration > Generator Integration > should generate all files for a basic config: packages/cli/src/commands/generate.test.ts#L83
Error: Snapshot `Generate Command Integration > Generator Integration > should generate all files for a basic config > types 1` mismatched - Expected + Received @@ -5,10 +5,18 @@ import type { Session as OpensaasSession, StorageUtils, ServerActionProps, AccessControlledDB, AccessContext } from '@opensaas/stack-core' import type { PrismaClient, Prisma } from './prisma-client/client' import type { PluginServices } from './plugin-types' + // Utility: strips virtual field keys from select/include so Prisma GetPayload never sees them + type StripVirtualFromArgs<T, VirtualKeys extends string> = + T extends { select: infer S extends object } + ? Omit<T, 'select'> & { select: Omit<S, VirtualKeys> } + : T extends { include: infer I extends object } + ? Omit<T, 'include'> & { include: Omit<I, VirtualKeys> } + : T + /** * Virtual fields for User - computed fields not in database * These are added to query results via resolveOutput hooks */ export type UserVirtualFields = { ❯ src/commands/generate.test.ts:83:21
test
Node.js 20 actions are deprecated. The following actions are running on Node.js 20 and may not work as expected: pnpm/action-setup@v4. Actions will be forced to run with Node.js 24 by default starting June 2nd, 2026. Please check if updated versions of these actions are available that support Node.js 24. To opt into Node.js 24 now, set the FORCE_JAVASCRIPT_ACTIONS_TO_NODE24=true environment variable on the runner or in your workflow file. Once Node.js 24 becomes the default, you can temporarily opt out by setting ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true. For more information see: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
test: packages/core/src/access/engine.ts#L165
'matchesFilter' is defined but never used. Allowed unused vars must match /^_/u
test: packages/cli/src/migration/generators/migration-generator.ts#L925
'dbProvider' is defined but never used. Allowed unused args must match /^_/u
test: packages/cli/src/generator/types.ts#L254
'getRelatedListName' is defined but never used. Allowed unused vars must match /^_/u
test: examples/blog/test-singleton.ts#L6
'config' is defined but never used. Allowed unused vars must match /^_/u
e2e
Node.js 20 actions are deprecated. The following actions are running on Node.js 20 and may not work as expected: pnpm/action-setup@v4. Actions will be forced to run with Node.js 24 by default starting June 2nd, 2026. Node.js 20 will be removed from the runner on September 16th, 2026. Please check if updated versions of these actions are available that support Node.js 24. To opt into Node.js 24 now, set the FORCE_JAVASCRIPT_ACTIONS_TO_NODE24=true environment variable on the runner or in your workflow file. Once Node.js 24 becomes the default, you can temporarily opt out by setting ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true. For more information see: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
e2e
No files were found with the provided path: test-results/. No artifacts will be uploaded.
e2e
No files were found with the provided path: playwright-report/. No artifacts will be uploaded.
🎭 Playwright Run Summary
42 passed (1.7m)

Artifacts

Produced during runtime
Name Size Digest
browser-test-screenshots Expired
8.48 KB
sha256:9ec5e4618070bf95dcd9c888aaf76d18d10e60744804b3a37a43b2d4fa0e8158