-
Couldn't load subscription status.
- Fork 11
feat: createDockerFolder & setDockerFolderChildren mutations
#1558
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
Conversation
WalkthroughThis update introduces Docker folder organization features to the API. It adds GraphQL mutations for creating folders and setting folder children, implements corresponding service methods and pure functions, and provides comprehensive unit tests. Related imports are updated, and best practices for testing are documented. Minor adjustments to ignore files and validation logic are also included. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant GraphQL API
participant DockerResolver
participant DockerOrganizerService
participant DockerConfigService
Client->>GraphQL API: Mutation createDockerFolder(name, parentId, childrenIds)
GraphQL API->>DockerResolver: createDockerFolder(...)
DockerResolver->>DockerOrganizerService: createFolder({name, parentId, childrenIds})
DockerOrganizerService->>DockerConfigService: getConfig()
DockerOrganizerService->>DockerConfigService: replaceConfig(newConfig)
DockerOrganizerService-->>DockerResolver: updated OrganizerV1
DockerResolver->>DockerOrganizerService: resolveOrganizer(updated OrganizerV1)
DockerOrganizerService-->>DockerResolver: ResolvedOrganizerV1
DockerResolver-->>GraphQL API: ResolvedOrganizerV1
GraphQL API-->>Client: ResolvedOrganizerV1
sequenceDiagram
participant Client
participant GraphQL API
participant DockerResolver
participant DockerOrganizerService
participant DockerConfigService
Client->>GraphQL API: Mutation setDockerFolderChildren(folderId, childrenIds)
GraphQL API->>DockerResolver: setDockerFolderChildren(...)
DockerResolver->>DockerOrganizerService: setFolderChildren({folderId, childrenIds})
DockerOrganizerService->>DockerConfigService: getConfig()
DockerOrganizerService->>DockerConfigService: replaceConfig(newConfig)
DockerOrganizerService-->>DockerResolver: updated OrganizerV1
DockerResolver->>DockerOrganizerService: resolveOrganizer(updated OrganizerV1)
DockerOrganizerService-->>DockerResolver: ResolvedOrganizerV1
DockerResolver-->>GraphQL API: ResolvedOrganizerV1
GraphQL API-->>Client: ResolvedOrganizerV1
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (13)
✅ Files skipped from review due to trivial changes (5)
🚧 Files skipped from review as they are similar to previous changes (5)
🧰 Additional context used📓 Path-based instructions (4)api/**/*📄 CodeRabbit Inference Engine (.cursor/rules/api-rules.mdc)
Files:
api/src/unraid-api/**/*📄 CodeRabbit Inference Engine (.cursor/rules/api-rules.mdc)
Files:
api/**/*.{test,spec}.{js,ts,tsx}📄 CodeRabbit Inference Engine (.cursor/rules/api-rules.mdc)
Files:
api/**/*.{test,spec}.{ts,js}📄 CodeRabbit Inference Engine (CLAUDE.md)
Files:
🧠 Learnings (39)📓 Common learnings📚 Learning: applies to web/__test__/store/**/*.ts : verify state changes by updating the store in store tests...Applied to files:
📚 Learning: applies to web/__test__/**/*.{test,spec}.{ts,js} : mock external dependencies and services in web/__...Applied to files:
📚 Learning: applies to web/__test__/store/**/*.ts : verify state changes after actions in store tests...Applied to files:
📚 Learning: applies to web/__test__/store/**/*.ts : mock external dependencies appropriately in store tests...Applied to files:
📚 Learning: applies to api/src/unraid-api/**/* : prefer adding new files to the nestjs repository located at api...Applied to files:
📚 Learning: applies to web/__test__/store/**/*.ts : test async operations completely in store tests...Applied to files:
📚 Learning: applies to web/__test__/store/**/*.ts : override specific action implementations when needed in stor...Applied to files:
📚 Learning: applies to web/__test__/store/**/*.ts : test action side effects and state changes in store tests...Applied to files:
📚 Learning: applies to web/__test__/**/*store*.{test,spec}.{ts,js} : use factory functions for module mocks to a...Applied to files:
📚 Learning: applies to web/__test__/{components,store,mocks}/**/*.ts : mock external dependencies and services i...Applied to files:
📚 Learning: applies to web/__test__/store/**/*.ts : verify proper error handling in store tests...Applied to files:
📚 Learning: in `api/src/unraid-api/auth/api-key.service.ts`, when handling read errors in the `findbyid` method,...Applied to files:
📚 Learning: when handling type mismatches between dependencies in typescript (such as between nestjs and fastify...Applied to files:
📚 Learning: in the unraid api project, error handling for mutations is handled at the service level rather than ...Applied to files:
📚 Learning: error handling in mutations like `addroleforuser` in `auth.resolver.ts` is performed at the service ...Applied to files:
📚 Learning: applies to web/__test__/components/**/*.ts : assert on rendered text content with `wrapper.text()`...Applied to files:
📚 Learning: applies to api/**/*.{test,spec}.{ts,js} : test suite is vitest, do not use jest in the api package...Applied to files:
📚 Learning: applies to api/**/*.{test,spec}.{js,ts,tsx} : use vitest as the test suite; do not use jest...Applied to files:
📚 Learning: applies to web/__test__/{components,store,mocks}/**/*.ts : use `vi.mock()` for module-level mocks...Applied to files:
📚 Learning: applies to web/__test__/{components,store,mocks}/**/*.ts : remember that `vi.mock()` calls are hoist...Applied to files:
📚 Learning: applies to web/__test__/{components,store,mocks}/**/*.ts : reset mocks between tests with `vi.cleara...Applied to files:
📚 Learning: applies to web/__test__/{components,store,mocks}/**/*.ts : specify return values for component metho...Applied to files:
📚 Learning: applies to web/__test__/components/**/*.ts : verify element existence with `expect(element.exists())...Applied to files:
📚 Learning: applies to web/__test__/components/**/*.ts : use `mount` from vue test utils for component testing...Applied to files:
📚 Learning: applies to web/__test__/{components,store,mocks}/**/*.ts : use factory functions for module mocks to...Applied to files:
📚 Learning: applies to web/__test__/{components,store,mocks}/**/*.ts : clear mocks between tests to ensure isola...Applied to files:
📚 Learning: applies to web/__test__/mocks/**/*.ts : frequently used mocks are stored under `web/test/mocks`...Applied to files:
📚 Learning: applies to web/__test__/**/*.{test,spec}.{ts,js} : stub complex child components that aren't the foc...Applied to files:
📚 Learning: applies to web/__test__/components/**/*.ts : stub complex child components that aren't the focus of ...Applied to files:
📚 Learning: applies to web/__test__/store/**/*.ts : test getter dependencies are properly mocked in store tests...Applied to files:
📚 Learning: applies to web/__test__/store/**/*.ts : test store interactions with other stores...Applied to files:
📚 Learning: applies to web/__test__/**/*.{test,spec}.{ts,js} : always await async operations before making asser...Applied to files:
📚 Learning: applies to web/__test__/components/**/*.ts : verify that the expected elements are rendered in compo...Applied to files:
📚 Learning: applies to web/__test__/**/*store*.{test,spec}.{ts,js} : clear mocks between tests to ensure isolati...Applied to files:
📚 Learning: in the unraid api project's theme system, exact typescript type definitions are preferred over index...Applied to files:
📚 Learning: for the unraid api project, class-validator should be used for validation to avoid mismatches betwee...Applied to files:
📚 Learning: the project prefers using class-validator decorators directly on entity classes rather than separate...Applied to files:
📚 Learning: the `isdefined` function is autoloaded and placed on `globalthis`; it does not need to be imported o...Applied to files:
🔇 Additional comments (11)
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Claude finished @pujitm's task —— View job Code Review for Docker Folder MutationsI've completed my review of this PR focusing on code quality, potential bugs, performance, security, and test coverage. Review Tasks
🟢 Overall AssessmentThis is a well-implemented feature that adds Docker folder organization capabilities with strong code quality, comprehensive testing, and good architectural design. 📋 Detailed Review✅ Code Quality & Best PracticesExcellent adherence to repository standards:
Key strengths:
✅ SecurityAuthorization properly implemented:
Validation checks:
✅ PerformanceWell-optimized design:
Potential considerations:
✅ Test CoverageComprehensive test suite:
Test quality highlights:
✅ Architecture & DesignExcellent architectural decisions:
Notable design patterns:
🟡 Minor Suggestions
✅ New Files Assessment
Schema changes: Clean addition of two mutations with appropriate nullable parameters 🔍 No Issues Found
🎯 Recommendation: APPROVEThis PR demonstrates excellent software engineering practices with:
The implementation follows all repository guidelines and maintains high code quality standards throughout. |
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.
Actionable comments posted: 5
🧹 Nitpick comments (1)
api/.gitignore (1)
86-88: Broadened ignore may hide canonical config – consider keeping a checked-in template
dev/configs/*now ignores every file in that directory.
If any canonical sample (e.g.docker.organizer.example.json) is meant to live in VCS, it will silently disappear.dev/connectStatus.json -dev/configs/* +# keep a template for onboarding while still ignoring local copies +!dev/configs/*.example.json +dev/configs/*This pattern first un-ignores
*.example.json, then ignores everything else, letting you commit a pristine template while developers keep their own local variants.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (12)
.gitignore(1 hunks)api/.gitignore(1 hunks)api/dev/configs/docker.organizer.json(0 hunks)api/generated-schema.graphql(1 hunks)api/src/unraid-api/graph/resolvers/docker/docker-config.service.ts(3 hunks)api/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.ts(2 hunks)api/src/unraid-api/graph/resolvers/docker/docker-organizer.service.ts(4 hunks)api/src/unraid-api/graph/resolvers/docker/docker.resolver.ts(3 hunks)api/src/unraid-api/organizer/organizer-view.folder.test.ts(1 hunks)api/src/unraid-api/organizer/organizer.dto.ts(1 hunks)api/src/unraid-api/organizer/organizer.resolution.test.ts(2 hunks)api/src/unraid-api/organizer/organizer.ts(2 hunks)
💤 Files with no reviewable changes (1)
- api/dev/configs/docker.organizer.json
🧰 Additional context used
📓 Path-based instructions (4)
api/**/*
📄 CodeRabbit Inference Engine (.cursor/rules/api-rules.mdc)
api/**/*: Use pnpm as the only package manager
Always run scripts from api/package.json unless specifically requested otherwise
Files:
api/src/unraid-api/graph/resolvers/docker/docker-config.service.tsapi/src/unraid-api/organizer/organizer-view.folder.test.tsapi/src/unraid-api/organizer/organizer.dto.tsapi/generated-schema.graphqlapi/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.tsapi/src/unraid-api/graph/resolvers/docker/docker.resolver.tsapi/src/unraid-api/organizer/organizer.resolution.test.tsapi/src/unraid-api/graph/resolvers/docker/docker-organizer.service.tsapi/src/unraid-api/organizer/organizer.ts
api/src/unraid-api/**/*
📄 CodeRabbit Inference Engine (.cursor/rules/api-rules.mdc)
Prefer adding new files to the NestJS repository located at api/src/unraid-api/ instead of the legacy code
Prefer adding new files to the NestJS repo located at api/src/unraid-api/ instead of the legacy code
Files:
api/src/unraid-api/graph/resolvers/docker/docker-config.service.tsapi/src/unraid-api/organizer/organizer-view.folder.test.tsapi/src/unraid-api/organizer/organizer.dto.tsapi/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.tsapi/src/unraid-api/graph/resolvers/docker/docker.resolver.tsapi/src/unraid-api/organizer/organizer.resolution.test.tsapi/src/unraid-api/graph/resolvers/docker/docker-organizer.service.tsapi/src/unraid-api/organizer/organizer.ts
api/**/*.{test,spec}.{js,ts,tsx}
📄 CodeRabbit Inference Engine (.cursor/rules/api-rules.mdc)
api/**/*.{test,spec}.{js,ts,tsx}: Use Vitest as the test suite; do not use Jest
Prefer not to mock simple dependencies in tests
Files:
api/src/unraid-api/organizer/organizer-view.folder.test.tsapi/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.tsapi/src/unraid-api/organizer/organizer.resolution.test.ts
api/**/*.{test,spec}.{ts,js}
📄 CodeRabbit Inference Engine (CLAUDE.md)
Test suite is VITEST, do not use jest in the API package
Files:
api/src/unraid-api/organizer/organizer-view.folder.test.tsapi/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.tsapi/src/unraid-api/organizer/organizer.resolution.test.ts
🧠 Learnings (57)
📓 Common learnings
Learnt from: mdatelle
PR: unraid/api#1533
File: web/components/Docker/Edit.vue:16-32
Timestamp: 2025-07-24T18:48:44.035Z
Learning: In web/components/Docker/Edit.vue, the hardcoded configuration values in the config ref are intentional temporary/dummy data used during initial UI development phase while building out the real Docker components, as clarified by mdatelle in PR #1533.
Learnt from: pujitm
PR: unraid/api#1352
File: packages/unraid-api-plugin-generator/src/create-plugin.ts:91-112
Timestamp: 2025-04-21T18:27:36.482Z
Learning: For utility functions like file operations in api plugin generators, pujitm prefers minimal error handling rather than verbose try/catch blocks for each operation, as errors will propagate properly to higher level error handlers.
📚 Learning: the files in the `api/deploy` directory (including `packed-pnpm-store.txz`) are gitignored build art...
Learnt from: pujitm
PR: unraid/api#1252
File: plugin/docker-compose.yml:15-15
Timestamp: 2025-03-26T15:18:27.452Z
Learning: The files in the `api/deploy` directory (including `packed-pnpm-store.txz`) are gitignored build artifacts that are generated when the API is built. Building the API is a prerequisite before using the plugin builder container, as it needs access to these artifacts.
Applied to files:
api/.gitignore
📚 Learning: applies to api/src/unraid-api/**/* : prefer adding new files to the nestjs repo located at api/src/u...
Learnt from: CR
PR: unraid/api#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-28T15:34:24.715Z
Learning: Applies to api/src/unraid-api/**/* : Prefer adding new files to the NestJS repo located at api/src/unraid-api/ instead of the legacy code
Applied to files:
api/.gitignoreapi/src/unraid-api/graph/resolvers/docker/docker.resolver.tsapi/src/unraid-api/organizer/organizer.ts
📚 Learning: applies to api/src/unraid-api/**/* : prefer adding new files to the nestjs repository located at api...
Learnt from: CR
PR: unraid/api#0
File: .cursor/rules/api-rules.mdc:0-0
Timestamp: 2025-07-21T14:00:06.258Z
Learning: Applies to api/src/unraid-api/**/* : Prefer adding new files to the NestJS repository located at api/src/unraid-api/ instead of the legacy code
Applied to files:
api/.gitignoreapi/src/unraid-api/graph/resolvers/docker/docker-config.service.tsapi/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.tsapi/src/unraid-api/graph/resolvers/docker/docker.resolver.tsapi/src/unraid-api/graph/resolvers/docker/docker-organizer.service.tsapi/src/unraid-api/organizer/organizer.ts
📚 Learning: connect configuration files like api/dev/configs/connect.json use their own naming conventions (e.g....
Learnt from: elibosley
PR: unraid/api#1425
File: api/dev/configs/connect.json:5-13
Timestamp: 2025-06-20T20:50:14.050Z
Learning: Connect configuration files like api/dev/configs/connect.json use their own naming conventions (e.g., apikey, accesstoken, idtoken, refreshtoken) as implementation details, and these should not be changed to follow general camelCase patterns.
Applied to files:
api/.gitignore
📚 Learning: applies to api/**/* : always run scripts from api/package.json unless specifically requested otherwi...
Learnt from: CR
PR: unraid/api#0
File: .cursor/rules/api-rules.mdc:0-0
Timestamp: 2025-07-21T14:00:06.258Z
Learning: Applies to api/**/* : Always run scripts from api/package.json unless specifically requested otherwise
Applied to files:
api/.gitignore
📚 Learning: in web/components/docker/edit.vue, the hardcoded configuration values in the config ref are intentio...
Learnt from: mdatelle
PR: unraid/api#1533
File: web/components/Docker/Edit.vue:16-32
Timestamp: 2025-07-24T18:48:44.035Z
Learning: In web/components/Docker/Edit.vue, the hardcoded configuration values in the config ref are intentional temporary/dummy data used during initial UI development phase while building out the real Docker components, as clarified by mdatelle in PR #1533.
Applied to files:
api/src/unraid-api/graph/resolvers/docker/docker-config.service.tsapi/src/unraid-api/graph/resolvers/docker/docker-organizer.service.ts
📚 Learning: in `api/src/unraid-api/auth/api-key.service.ts`, when handling read errors in the `findbyid` method,...
Learnt from: elibosley
PR: unraid/api#942
File: api/src/unraid-api/auth/api-key.service.ts:62-70
Timestamp: 2024-11-05T14:49:07.308Z
Learning: In `api/src/unraid-api/auth/api-key.service.ts`, when handling read errors in the `findById` method, throw a `GraphQLError` instead of an `InternalServerErrorException`.
Applied to files:
api/src/unraid-api/graph/resolvers/docker/docker-config.service.tsapi/src/unraid-api/organizer/organizer.dto.ts
📚 Learning: the project uses a custom or extended implementation of nestjs configservice that includes a `set()`...
Learnt from: pujitm
PR: unraid/api#1367
File: packages/unraid-api-plugin-connect/src/pubsub/user.service.ts:44-52
Timestamp: 2025-04-23T20:19:42.542Z
Learning: The project uses a custom or extended implementation of NestJS ConfigService that includes a `set()` method for runtime configuration mutation, unlike the standard @nestjs/config package which only provides getter methods.
Applied to files:
api/src/unraid-api/graph/resolvers/docker/docker-config.service.ts
📚 Learning: in the unraid api project, error handling for mutations is handled at the service level rather than ...
Learnt from: mdatelle
PR: unraid/api#942
File: api/src/unraid-api/graph/resolvers/auth/auth.resolver.ts:111-113
Timestamp: 2024-11-06T20:59:25.809Z
Learning: In the Unraid API project, error handling for mutations is handled at the service level rather than in the GraphQL resolvers. Specifically, in `api/src/unraid-api/graph/resolvers/auth/auth.resolver.ts`, methods like `removeRoleFromApiKey` rely on service-level error handling.
Applied to files:
api/src/unraid-api/graph/resolvers/docker/docker-config.service.tsapi/src/unraid-api/organizer/organizer.dto.tsapi/src/unraid-api/graph/resolvers/docker/docker.resolver.tsapi/src/unraid-api/graph/resolvers/docker/docker-organizer.service.ts
📚 Learning: the updateapisettings mutation in api/src/unraid-api/graph/connect/connect.resolver.ts is protected ...
Learnt from: pujitm
PR: unraid/api#1211
File: api/src/graphql/schema/types/connect/connect.graphql:142-146
Timestamp: 2025-03-14T16:10:38.562Z
Learning: The updateApiSettings mutation in api/src/unraid-api/graph/connect/connect.resolver.ts is protected with the @UsePermissions decorator that requires UPDATE permission on the CONFIG resource.
Applied to files:
api/src/unraid-api/graph/resolvers/docker/docker-config.service.tsapi/src/unraid-api/graph/resolvers/docker/docker.resolver.ts
📚 Learning: the project uses a custom configservice implementation that includes a `set()` method for runtime co...
Learnt from: pujitm
PR: unraid/api#1367
File: packages/unraid-api-plugin-connect/src/pubsub/user.service.ts:44-52
Timestamp: 2025-04-23T20:19:42.542Z
Learning: The project uses a custom ConfigService implementation that includes a `set()` method for runtime configuration mutation, unlike the standard @nestjs/config package which only provides getter methods.
Applied to files:
api/src/unraid-api/graph/resolvers/docker/docker-config.service.ts
📚 Learning: validation and error handling for settings and configurations should be handled in the store layer, ...
Learnt from: pujitm
PR: unraid/api#1211
File: api/src/unraid-api/graph/connect/connect-settings.service.ts:0-0
Timestamp: 2025-03-14T16:09:53.997Z
Learning: Validation and error handling for settings and configurations should be handled in the store layer, not in service layers like ConnectSettingsService.
Applied to files:
api/src/unraid-api/graph/resolvers/docker/docker-config.service.ts
📚 Learning: for the unraid api project, class-validator should be used for validation to avoid mismatches betwee...
Learnt from: elibosley
PR: unraid/api#1352
File: packages/unraid-api-plugin-connect/src/config.entity.ts:16-26
Timestamp: 2025-04-21T18:44:15.414Z
Learning: For the Unraid API project, class-validator should be used for validation to avoid mismatches between different validation schemas (like Zod).
Applied to files:
api/src/unraid-api/graph/resolvers/docker/docker-config.service.tsapi/src/unraid-api/organizer/organizer.dto.ts
📚 Learning: applies to web/__test__/store/**/*.ts : verify state changes by updating the store in store tests...
Learnt from: CR
PR: unraid/api#0
File: .cursor/rules/web-testing-rules.mdc:0-0
Timestamp: 2025-07-21T14:01:04.139Z
Learning: Applies to web/__test__/store/**/*.ts : Verify state changes by updating the store in store tests
Applied to files:
api/src/unraid-api/organizer/organizer-view.folder.test.tsapi/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.tsapi/src/unraid-api/organizer/organizer.resolution.test.ts
📚 Learning: applies to web/__test__/store/**/*.ts : verify state changes after actions in store tests...
Learnt from: CR
PR: unraid/api#0
File: .cursor/rules/web-testing-rules.mdc:0-0
Timestamp: 2025-07-21T14:01:04.139Z
Learning: Applies to web/__test__/store/**/*.ts : Verify state changes after actions in store tests
Applied to files:
api/src/unraid-api/organizer/organizer-view.folder.test.tsapi/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.tsapi/src/unraid-api/organizer/organizer.resolution.test.ts
📚 Learning: applies to web/__test__/store/**/*.ts : test action side effects and state changes in store tests...
Learnt from: CR
PR: unraid/api#0
File: .cursor/rules/web-testing-rules.mdc:0-0
Timestamp: 2025-07-21T14:01:04.139Z
Learning: Applies to web/__test__/store/**/*.ts : Test action side effects and state changes in store tests
Applied to files:
api/src/unraid-api/organizer/organizer-view.folder.test.tsapi/src/unraid-api/organizer/organizer.resolution.test.ts
📚 Learning: applies to web/__test__/store/**/*.ts : verify proper error handling in store tests...
Learnt from: CR
PR: unraid/api#0
File: .cursor/rules/web-testing-rules.mdc:0-0
Timestamp: 2025-07-21T14:01:04.139Z
Learning: Applies to web/__test__/store/**/*.ts : Verify proper error handling in store tests
Applied to files:
api/src/unraid-api/organizer/organizer-view.folder.test.tsapi/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.tsapi/src/unraid-api/organizer/organizer.resolution.test.ts
📚 Learning: applies to web/__test__/store/**/*.ts : test async operations completely in store tests...
Learnt from: CR
PR: unraid/api#0
File: .cursor/rules/web-testing-rules.mdc:0-0
Timestamp: 2025-07-21T14:01:04.139Z
Learning: Applies to web/__test__/store/**/*.ts : Test async operations completely in store tests
Applied to files:
api/src/unraid-api/organizer/organizer-view.folder.test.tsapi/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.tsapi/src/unraid-api/organizer/organizer.resolution.test.ts
📚 Learning: applies to web/__test__/store/**/*.ts : override specific action implementations when needed in stor...
Learnt from: CR
PR: unraid/api#0
File: .cursor/rules/web-testing-rules.mdc:0-0
Timestamp: 2025-07-21T14:01:04.139Z
Learning: Applies to web/__test__/store/**/*.ts : Override specific action implementations when needed in store tests
Applied to files:
api/src/unraid-api/organizer/organizer-view.folder.test.tsapi/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.tsapi/src/unraid-api/organizer/organizer.resolution.test.ts
📚 Learning: applies to web/__test__/**/*store*.{test,spec}.{ts,js} : use factory functions for module mocks to a...
Learnt from: CR
PR: unraid/api#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-28T15:34:24.715Z
Learning: Applies to web/__test__/**/*store*.{test,spec}.{ts,js} : Use factory functions for module mocks to avoid hoisting issues in store tests
Applied to files:
api/src/unraid-api/organizer/organizer-view.folder.test.tsapi/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.ts
📚 Learning: applies to web/__test__/store/**/*.ts : test store interactions with other stores...
Learnt from: CR
PR: unraid/api#0
File: .cursor/rules/web-testing-rules.mdc:0-0
Timestamp: 2025-07-21T14:01:04.139Z
Learning: Applies to web/__test__/store/**/*.ts : Test store interactions with other stores
Applied to files:
api/src/unraid-api/organizer/organizer-view.folder.test.tsapi/src/unraid-api/organizer/organizer.resolution.test.ts
📚 Learning: applies to web/__test__/store/**/*.ts : set initial state for focused testing in store tests...
Learnt from: CR
PR: unraid/api#0
File: .cursor/rules/web-testing-rules.mdc:0-0
Timestamp: 2025-07-21T14:01:04.139Z
Learning: Applies to web/__test__/store/**/*.ts : Set initial state for focused testing in store tests
Applied to files:
api/src/unraid-api/organizer/organizer-view.folder.test.ts
📚 Learning: applies to web/__test__/store/**/*.ts : test action side effects if not stubbed in store tests...
Learnt from: CR
PR: unraid/api#0
File: .cursor/rules/web-testing-rules.mdc:0-0
Timestamp: 2025-07-21T14:01:04.139Z
Learning: Applies to web/__test__/store/**/*.ts : Test action side effects if not stubbed in store tests
Applied to files:
api/src/unraid-api/organizer/organizer-view.folder.test.tsapi/src/unraid-api/organizer/organizer.resolution.test.ts
📚 Learning: applies to api/**/*.{test,spec}.{ts,js} : test suite is vitest, do not use jest in the api package...
Learnt from: CR
PR: unraid/api#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-28T15:34:24.715Z
Learning: Applies to api/**/*.{test,spec}.{ts,js} : Test suite is VITEST, do not use jest in the API package
Applied to files:
api/src/unraid-api/organizer/organizer-view.folder.test.tsapi/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.ts
📚 Learning: applies to api/**/*.{test,spec}.{js,ts,tsx} : use vitest as the test suite; do not use jest...
Learnt from: CR
PR: unraid/api#0
File: .cursor/rules/api-rules.mdc:0-0
Timestamp: 2025-07-21T14:00:06.258Z
Learning: Applies to api/**/*.{test,spec}.{js,ts,tsx} : Use Vitest as the test suite; do not use Jest
Applied to files:
api/src/unraid-api/organizer/organizer-view.folder.test.tsapi/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.ts
📚 Learning: applies to web/__test__/**/*.{test,spec}.{ts,js} : stub complex child components that aren't the foc...
Learnt from: CR
PR: unraid/api#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-28T15:34:24.715Z
Learning: Applies to web/__test__/**/*.{test,spec}.{ts,js} : Stub complex child components that aren't the focus of the test in web/__test__
Applied to files:
api/src/unraid-api/organizer/organizer-view.folder.test.tsapi/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.tsapi/src/unraid-api/organizer/organizer.resolution.test.ts
📚 Learning: applies to web/__test__/{components,store,mocks}/**/*.ts : remember that `vi.mock()` calls are hoist...
Learnt from: CR
PR: unraid/api#0
File: .cursor/rules/web-testing-rules.mdc:0-0
Timestamp: 2025-07-21T14:01:04.139Z
Learning: Applies to web/__test__/{components,store,mocks}/**/*.ts : Remember that `vi.mock()` calls are hoisted
Applied to files:
api/src/unraid-api/organizer/organizer-view.folder.test.tsapi/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.ts
📚 Learning: in `web/helpers/apollo-cache/index.ts`, when updating the cache in the `cache.updatequery` function,...
Learnt from: pujitm
PR: unraid/api#978
File: web/helpers/apollo-cache/index.ts:133-157
Timestamp: 2024-12-11T17:20:09.604Z
Learning: In `web/helpers/apollo-cache/index.ts`, when updating the cache in the `cache.updateQuery` function, it's sufficient to check if `data` is present, as type checking inside `data` is handled at the GraphQL layer.
Applied to files:
api/src/unraid-api/organizer/organizer.dto.ts
📚 Learning: in the unraid api project's theme system, exact typescript type definitions are preferred over index...
Learnt from: elibosley
PR: unraid/api#1181
File: web/store/theme.ts:0-0
Timestamp: 2025-02-24T14:51:21.328Z
Learning: In the Unraid API project's theme system, exact TypeScript type definitions are preferred over index signatures for theme variables to ensure better type safety.
Applied to files:
api/src/unraid-api/organizer/organizer.dto.ts
📚 Learning: in the unraid api project, the duplicate graphql query and mutation strings in gql.ts files are inte...
Learnt from: pujitm
PR: unraid/api#1211
File: web/composables/gql/gql.ts:17-18
Timestamp: 2025-03-12T13:48:14.850Z
Learning: In the Unraid API project, the duplicate GraphQL query and mutation strings in gql.ts files are intentionally generated by GraphQL CodeGen tool and are necessary for the type system to function properly.
Applied to files:
api/src/unraid-api/organizer/organizer.dto.tsapi/src/unraid-api/graph/resolvers/docker/docker.resolver.ts
📚 Learning: the project prefers using class-validator decorators directly on entity classes rather than separate...
Learnt from: elibosley
PR: unraid/api#1352
File: packages/unraid-api-plugin-connect/src/config.entity.ts:37-39
Timestamp: 2025-04-21T18:44:24.383Z
Learning: The project prefers using class-validator decorators directly on entity classes rather than separate Zod schemas to maintain type consistency between GraphQL entities and validation rules.
Applied to files:
api/src/unraid-api/organizer/organizer.dto.ts
📚 Learning: input types for graphql mutations can be pulled from the graphql codegen types, as they are generate...
Learnt from: elibosley
PR: unraid/api#942
File: api/src/unraid-api/graph/resolvers/auth/auth.resolver.ts:41-47
Timestamp: 2024-11-05T14:48:56.949Z
Learning: Input types for GraphQL mutations can be pulled from the GraphQL codegen types, as they are generated into the API files. Therefore, explicit typing in the resolver files may be unnecessary.
Applied to files:
api/src/unraid-api/organizer/organizer.dto.tsapi/generated-schema.graphqlapi/src/unraid-api/graph/resolvers/docker/docker.resolver.ts
📚 Learning: error handling in mutations like `addroleforuser` in `auth.resolver.ts` is performed at the service ...
Learnt from: mdatelle
PR: unraid/api#942
File: api/src/unraid-api/graph/resolvers/auth/auth.resolver.ts:87-89
Timestamp: 2024-11-06T20:59:06.096Z
Learning: Error handling in mutations like `addRoleForUser` in `auth.resolver.ts` is performed at the service level, so additional error handling in the resolver is unnecessary.
Applied to files:
api/src/unraid-api/organizer/organizer.dto.tsapi/src/unraid-api/graph/resolvers/docker/docker.resolver.ts
📚 Learning: the json scalar type in web/codegen.ts was temporarily changed from 'string' to 'any' for compatibil...
Learnt from: pujitm
PR: unraid/api#1211
File: web/codegen.ts:14-14
Timestamp: 2025-03-12T13:35:43.900Z
Learning: The JSON scalar type in web/codegen.ts was temporarily changed from 'string' to 'any' for compatibility with JsonForms integration. This change facilitates the implementation of the Connect settings web component.
Applied to files:
api/src/unraid-api/organizer/organizer.dto.ts
📚 Learning: the `isdefined` function is autoloaded and placed on `globalthis`; it does not need to be imported o...
Learnt from: pujitm
PR: unraid/api#975
File: web/helpers/apollo-cache/index.ts:79-82
Timestamp: 2024-12-10T15:57:42.593Z
Learning: The `isDefined` function is autoloaded and placed on `globalThis`; it does not need to be imported or defined explicitly in files.
Applied to files:
api/src/unraid-api/organizer/organizer.dto.ts
📚 Learning: applies to web/**/*.mutation.ts : graphql mutations must be placed in `.mutation.ts` files...
Learnt from: CR
PR: unraid/api#0
File: .cursor/rules/web-graphql.mdc:0-0
Timestamp: 2025-07-21T14:00:25.140Z
Learning: Applies to web/**/*.mutation.ts : GraphQL mutations must be placed in `.mutation.ts` files
Applied to files:
api/generated-schema.graphqlapi/src/unraid-api/graph/resolvers/docker/docker.resolver.ts
📚 Learning: applies to web/__test__/**/*.{test,spec}.{ts,js} : mock external dependencies and services in web/__...
Learnt from: CR
PR: unraid/api#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-28T15:34:24.715Z
Learning: Applies to web/__test__/**/*.{test,spec}.{ts,js} : Mock external dependencies and services in web/__test__
Applied to files:
api/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.ts
📚 Learning: applies to web/__test__/store/**/*.ts : mock external dependencies appropriately in store tests...
Learnt from: CR
PR: unraid/api#0
File: .cursor/rules/web-testing-rules.mdc:0-0
Timestamp: 2025-07-21T14:01:04.139Z
Learning: Applies to web/__test__/store/**/*.ts : Mock external dependencies appropriately in store tests
Applied to files:
api/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.tsapi/src/unraid-api/organizer/organizer.resolution.test.ts
📚 Learning: applies to web/__test__/{components,store,mocks}/**/*.ts : mock external dependencies and services i...
Learnt from: CR
PR: unraid/api#0
File: .cursor/rules/web-testing-rules.mdc:0-0
Timestamp: 2025-07-21T14:01:04.139Z
Learning: Applies to web/__test__/{components,store,mocks}/**/*.ts : Mock external dependencies and services in tests
Applied to files:
api/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.ts
📚 Learning: applies to web/__test__/**/*store*.{test,spec}.{ts,js} : clear mocks between tests to ensure isolati...
Learnt from: CR
PR: unraid/api#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-28T15:34:24.715Z
Learning: Applies to web/__test__/**/*store*.{test,spec}.{ts,js} : Clear mocks between tests to ensure isolation in store tests
Applied to files:
api/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.tsapi/src/unraid-api/organizer/organizer.resolution.test.ts
📚 Learning: applies to web/__test__/{components,store,mocks}/**/*.ts : use `vi.mock()` for module-level mocks...
Learnt from: CR
PR: unraid/api#0
File: .cursor/rules/web-testing-rules.mdc:0-0
Timestamp: 2025-07-21T14:01:04.139Z
Learning: Applies to web/__test__/{components,store,mocks}/**/*.ts : Use `vi.mock()` for module-level mocks
Applied to files:
api/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.ts
📚 Learning: applies to web/__test__/{components,store,mocks}/**/*.ts : reset mocks between tests with `vi.cleara...
Learnt from: CR
PR: unraid/api#0
File: .cursor/rules/web-testing-rules.mdc:0-0
Timestamp: 2025-07-21T14:01:04.139Z
Learning: Applies to web/__test__/{components,store,mocks}/**/*.ts : Reset mocks between tests with `vi.clearAllMocks()`
Applied to files:
api/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.ts
📚 Learning: applies to web/__test__/components/**/*.ts : verify element existence with `expect(element.exists())...
Learnt from: CR
PR: unraid/api#0
File: .cursor/rules/web-testing-rules.mdc:0-0
Timestamp: 2025-07-21T14:01:04.139Z
Learning: Applies to web/__test__/components/**/*.ts : Verify element existence with `expect(element.exists()).toBe(true)`
Applied to files:
api/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.ts
📚 Learning: applies to web/__test__/{components,store,mocks}/**/*.ts : specify return values for component metho...
Learnt from: CR
PR: unraid/api#0
File: .cursor/rules/web-testing-rules.mdc:0-0
Timestamp: 2025-07-21T14:01:04.139Z
Learning: Applies to web/__test__/{components,store,mocks}/**/*.ts : Specify return values for component methods with `vi.spyOn()`
Applied to files:
api/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.ts
📚 Learning: applies to api/**/*.{test,spec}.{js,ts,tsx} : prefer not to mock simple dependencies in tests...
Learnt from: CR
PR: unraid/api#0
File: .cursor/rules/api-rules.mdc:0-0
Timestamp: 2025-07-21T14:00:06.258Z
Learning: Applies to api/**/*.{test,spec}.{js,ts,tsx} : Prefer not to mock simple dependencies in tests
Applied to files:
api/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.ts
📚 Learning: applies to web/__test__/{components,store,mocks}/**/*.ts : use factory functions for module mocks to...
Learnt from: CR
PR: unraid/api#0
File: .cursor/rules/web-testing-rules.mdc:0-0
Timestamp: 2025-07-21T14:01:04.139Z
Learning: Applies to web/__test__/{components,store,mocks}/**/*.ts : Use factory functions for module mocks to avoid hoisting issues
Applied to files:
api/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.ts
📚 Learning: applies to web/__test__/{components,store,mocks}/**/*.ts : clear mocks between tests to ensure isola...
Learnt from: CR
PR: unraid/api#0
File: .cursor/rules/web-testing-rules.mdc:0-0
Timestamp: 2025-07-21T14:01:04.139Z
Learning: Applies to web/__test__/{components,store,mocks}/**/*.ts : Clear mocks between tests to ensure isolation
Applied to files:
api/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.tsapi/src/unraid-api/organizer/organizer.resolution.test.ts
📚 Learning: applies to web/__test__/mocks/**/*.ts : frequently used mocks are stored under `web/test/mocks`...
Learnt from: CR
PR: unraid/api#0
File: .cursor/rules/web-testing-rules.mdc:0-0
Timestamp: 2025-07-21T14:01:04.139Z
Learning: Applies to web/__test__/mocks/**/*.ts : Frequently used mocks are stored under `web/test/mocks`
Applied to files:
api/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.ts
📚 Learning: applies to web/__test__/components/**/*.ts : stub complex child components that aren't the focus of ...
Learnt from: CR
PR: unraid/api#0
File: .cursor/rules/web-testing-rules.mdc:0-0
Timestamp: 2025-07-21T14:01:04.139Z
Learning: Applies to web/__test__/components/**/*.ts : Stub complex child components that aren't the focus of the test
Applied to files:
api/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.ts
📚 Learning: applies to web/**/*.mutation.ts : graphql mutations must be placed in .mutation.ts files under web/...
Learnt from: CR
PR: unraid/api#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-28T15:34:24.715Z
Learning: Applies to web/**/*.mutation.ts : GraphQL mutations must be placed in .mutation.ts files under web/
Applied to files:
api/src/unraid-api/graph/resolvers/docker/docker.resolver.ts
📚 Learning: applies to web/**/*.{query,mutation}.ts : all graphql under `web/` must follow this naming conventio...
Learnt from: CR
PR: unraid/api#0
File: .cursor/rules/web-graphql.mdc:0-0
Timestamp: 2025-07-21T14:00:25.140Z
Learning: Applies to web/**/*.{query,mutation}.ts : All GraphQL under `web/` must follow this naming convention
Applied to files:
api/src/unraid-api/graph/resolvers/docker/docker.resolver.ts
📚 Learning: applies to web/**/*.{query,mutation}.ts : all graphql under web/ must follow this naming convention ...
Learnt from: CR
PR: unraid/api#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-28T15:34:24.715Z
Learning: Applies to web/**/*.{query,mutation}.ts : All GraphQL under web/ must follow this naming convention (.query.ts for queries, .mutation.ts for mutations)
Applied to files:
api/src/unraid-api/graph/resolvers/docker/docker.resolver.ts
📚 Learning: applies to web/**/*.query.ts : graphql queries must be placed in `.query.ts` files...
Learnt from: CR
PR: unraid/api#0
File: .cursor/rules/web-graphql.mdc:0-0
Timestamp: 2025-07-21T14:00:25.140Z
Learning: Applies to web/**/*.query.ts : GraphQL queries must be placed in `.query.ts` files
Applied to files:
api/src/unraid-api/graph/resolvers/docker/docker.resolver.ts
📚 Learning: applies to web/**/*.query.ts : graphql queries must be placed in .query.ts files under web/...
Learnt from: CR
PR: unraid/api#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-28T15:34:24.715Z
Learning: Applies to web/**/*.query.ts : GraphQL queries must be placed in .query.ts files under web/
Applied to files:
api/src/unraid-api/graph/resolvers/docker/docker.resolver.ts
📚 Learning: applies to web/__test__/store/**/*.ts : test getter dependencies are properly mocked in store tests...
Learnt from: CR
PR: unraid/api#0
File: .cursor/rules/web-testing-rules.mdc:0-0
Timestamp: 2025-07-21T14:01:04.139Z
Learning: Applies to web/__test__/store/**/*.ts : Test getter dependencies are properly mocked in store tests
Applied to files:
api/src/unraid-api/organizer/organizer.resolution.test.ts
📚 Learning: applies to web/__test__/components/**/*.ts : verify that the expected elements are rendered in compo...
Learnt from: CR
PR: unraid/api#0
File: .cursor/rules/web-testing-rules.mdc:0-0
Timestamp: 2025-07-21T14:01:04.139Z
Learning: Applies to web/__test__/components/**/*.ts : Verify that the expected elements are rendered in component tests
Applied to files:
api/src/unraid-api/organizer/organizer.resolution.test.ts
🧬 Code Graph Analysis (3)
api/src/unraid-api/graph/resolvers/docker/docker-config.service.ts (2)
api/src/unraid-api/organizer/organizer.ts (2)
DEFAULT_ORGANIZER_VIEW_ID(14-14)DEFAULT_ORGANIZER_ROOT_ID(15-15)api/src/core/errors/app-error.ts (1)
AppError(4-37)
api/src/unraid-api/organizer/organizer.resolution.test.ts (3)
api/src/unraid-api/cli/generated/graphql.ts (3)
OrganizerResource(1140-1146)ResolvedOrganizerV1(1485-1489)ResolvedOrganizerFolder(1477-1483)api/src/unraid-api/organizer/organizer.ts (1)
resolveOrganizer(147-158)api/src/unraid-api/organizer/organizer.dto.ts (1)
ResolvedOrganizerEntryType(212-212)
api/src/unraid-api/graph/resolvers/docker/docker-organizer.service.ts (4)
api/src/unraid-api/organizer/organizer.ts (5)
DEFAULT_ORGANIZER_VIEW_ID(14-14)DEFAULT_ORGANIZER_ROOT_ID(15-15)resolveOrganizer(147-158)createFolderInView(175-195)setFolderChildrenInView(211-233)api/src/unraid-api/graph/resolvers/docker/docker.resolver.ts (1)
organizer(69-71)api/src/unraid-api/cli/generated/graphql.ts (1)
ResolvedOrganizerV1(1485-1489)api/src/core/errors/app-error.ts (1)
AppError(4-37)
🪛 GitHub Check: Test API
api/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.ts
[failure] 347-347: src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.ts > DockerOrganizerService > setFolderChildren > should throw error if child does not exist
AssertionError: expected [Function] to throw error including 'Child nonexistentChild not found in e…' but got 'Child 'nonexistentChild' not found …'
Expected: "Child nonexistentChild not found in entries or resources"
Received: "Child 'nonexistentChild' not found in entries or resources"
❯ src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.ts:347:13
[failure] 341-341: src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.ts > DockerOrganizerService > setFolderChildren > should throw error if target is not a folder
AssertionError: expected [Function] to throw error including 'Folder refEntry not found or is not a…' but got 'Entry 'refEntry' is not a folder'
Expected: "Folder refEntry not found or is not a folder"
Received: "Entry 'refEntry' is not a folder"
❯ src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.ts:341:13
[failure] 327-327: src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.ts > DockerOrganizerService > setFolderChildren > should throw error if folder does not exist
AssertionError: expected [Function] to throw error including 'Folder nonexistent not found or is no…' but got 'Folder 'nonexistent' not found'
Expected: "Folder nonexistent not found or is not a folder"
Received: "Folder 'nonexistent' not found"
❯ src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.ts:327:13
[failure] 271-271: src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.ts > DockerOrganizerService > createFolder > should throw error if parent is not a folder
AssertionError: expected [Function] to throw error including 'Parent refEntry not found or is not a…' but got 'Parent 'refEntry' not found or is n…'
Expected: "Parent refEntry not found or is not a folder"
Received: "Parent 'refEntry' not found or is not a folder"
❯ src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.ts:271:13
[failure] 257-257: src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.ts > DockerOrganizerService > createFolder > should throw error if parent does not exist
AssertionError: expected [Function] to throw error including 'Parent nonexistent not found or is no…' but got 'Parent 'nonexistent' not found or i…'
Expected: "Parent nonexistent not found or is not a folder"
Received: "Parent 'nonexistent' not found or is not a folder"
❯ src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.ts:257:13
🪛 GitHub Actions: CI - Main (API)
api/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.ts
[error] 257-259: Test failure: expected function to throw error including 'Parent nonexistent not found or is not a folder' but got 'Parent 'nonexistent' not found or is not a folder'.
[error] 271-273: Test failure: expected function to throw error including 'Parent refEntry not found or is not a folder' but got 'Parent 'refEntry' not found or is not a folder'.
[error] 327-329: Test failure: expected function to throw error including 'Folder nonexistent not found or is not a folder' but got 'Folder 'nonexistent' not found'.
[error] 341-343: Test failure: expected function to throw error including 'Folder refEntry not found or is not a folder' but got 'Entry 'refEntry' is not a folder'.
[error] 347-349: Test failure: expected function to throw error including 'Child nonexistentChild not found in entries or resources' but got 'Child 'nonexistentChild' not found in entries or resources'.
🔇 Additional comments (18)
.gitignore (1)
116-117: Verify whether.mise.tomlshould be version-controlled
mise(formerly rtx) is typically a developer tool for polyglot runtime management.
If the file pins language versions that must remain consistent across CI/CD or prod images, deleting it from VCS could break reproducible builds. Confirm the intent:
- If the versions are project-wide requirements → keep it.
- If everyone uses their own local runtime versions → ignore as added.
No change required if (2) is true.
api/src/unraid-api/graph/resolvers/docker/docker-config.service.ts (3)
6-6: LGTM! Good standardization with constants.The import of
AppErroraligns with the project's error handling patterns, and using standardized constants from the organizer module improves consistency across the codebase.Also applies to: 9-12
35-35: Excellent use of standardized constants.Replacing hardcoded strings with centralized constants improves maintainability and reduces the risk of inconsistencies across the organizer system.
Also applies to: 37-37, 39-44
55-55: Consistent error handling approach.The change from
ValidationErrortoAppErroraligns with the project's error handling patterns, and including the validation errors in JSON format provides good detail for debugging.api/generated-schema.graphql (1)
1875-1876: LGTM! Schema correctly reflects new Docker folder mutations.The auto-generated GraphQL schema properly defines the new
createDockerFolderandsetDockerFolderChildrenmutations with appropriate parameter types and return values.api/src/unraid-api/organizer/organizer.dto.ts (1)
196-200: Excellent defensive programming improvement.The enhanced validation in
resolveTypeprevents silent failures with malformed organizer entries and provides clear error messages. This improves the robustness of the GraphQL type resolution system.api/src/unraid-api/organizer/organizer.resolution.test.ts (2)
6-6: LGTM! Proper import for type annotations.The
ResolvedOrganizerEntryTypeimport is correctly added to support type annotations in the new test functions.
161-530: Excellent comprehensive test coverage for organizer resolution.The new test cases thoroughly cover empty folder resolution scenarios, including:
- Basic empty folder handling
- Nested empty folders
- Real-world scenarios with complex IDs
- Recursive validation of object structure
- Object identity preservation
These tests provide robust coverage and will prevent regressions in the organizer resolution logic.
api/src/unraid-api/graph/resolvers/docker/docker.resolver.ts (2)
1-1: LGTM! Proper imports and method refactoring.The new imports support the added mutations and constant usage. The method name change from
getResolvedOrganizer()toresolveOrganizer()appears to be part of a service layer refactoring.Also applies to: 17-18, 70-70
73-107: Well-implemented GraphQL mutations with proper permissions.The new
createDockerFolderandsetDockerFolderChildrenmutations follow excellent patterns:
- Appropriate permission decorators requiring UPDATE on DOCKER resource
- Sensible defaults using
DEFAULT_ORGANIZER_ROOT_IDfor optional parameters- Proper delegation to service layer for business logic
- Consistent return of resolved organizer structure
The implementation aligns with the project's architecture and security requirements.
api/src/unraid-api/organizer/organizer-view.folder.test.ts (1)
1-231: Comprehensive test coverage for organizer view functions!The test suite properly uses Vitest and provides excellent coverage for both
createFolderInViewandsetFolderChildrenInViewfunctions, including:
- Basic functionality tests
- Edge cases (nested folders, empty arrays)
- Immutability verification
- Resource reference creation
api/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.ts (1)
139-225: Well-structured service tests with proper NestJS testing utilitiesThe test setup correctly uses NestJS Test module with properly mocked dependencies. Good coverage of both success and error scenarios for the new folder management methods.
api/src/unraid-api/graph/resolvers/docker/docker-organizer.service.ts (3)
89-138: Well-implemented folder creation with comprehensive validationThe method properly validates inputs, uses pure functions for immutable updates, and follows the established error handling pattern with AppError.
140-185: Robust implementation of folder children managementGood validation of folder and children existence, proper use of pure functions, and consistent error handling.
63-66: Good refactoring with constantsReplacing hardcoded strings with
DEFAULT_ORGANIZER_VIEW_IDandDEFAULT_ORGANIZER_ROOT_IDconstants improves maintainability.Also applies to: 94-95, 141-141
api/src/unraid-api/organizer/organizer.ts (3)
14-15: Good practice defining view and root ID constantsThese constants improve code maintainability and prevent magic strings throughout the codebase.
160-195: Well-designed pure function for folder creationThe function properly:
- Maintains immutability with
structuredClone- Has clear parameter interface
- Updates both the entries map and parent's children array
- Includes comprehensive JSDoc documentation
197-233: Excellent implementation of folder children updateThe function correctly:
- Preserves immutability
- Handles automatic ref creation for resources
- Has clear documentation
- Follows single responsibility principle
api/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.ts
Outdated
Show resolved
Hide resolved
api/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.ts
Outdated
Show resolved
Hide resolved
api/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.ts
Outdated
Show resolved
Hide resolved
api/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.ts
Outdated
Show resolved
Hide resolved
api/src/unraid-api/graph/resolvers/docker/docker-organizer.service.spec.ts
Show resolved
Hide resolved
|
Claude finished @pujitm's task —— View job Code Review for Docker Folder MutationsI've completed my review of this PR focusing on code quality, potential bugs, performance, security, and test coverage. Review Tasks
🟢 Overall AssessmentThis is a well-implemented feature that adds Docker folder organization capabilities with strong code quality, comprehensive testing, and good architectural design. 📋 Detailed Review✅ Code Quality & Best PracticesExcellent adherence to repository standards:
Key strengths:
✅ SecurityAuthorization properly implemented:
Validation checks:
✅ PerformanceWell-optimized design:
Potential considerations:
✅ Test CoverageComprehensive test suite:
Test quality highlights:
✅ Architecture & DesignExcellent architectural decisions:
Notable design patterns:
🟡 Minor Suggestions
✅ New Files Assessment
Schema changes: Clean addition of two mutations with appropriate nullable parameters 🔍 No Issues Found
🎯 Recommendation: APPROVEThis PR demonstrates excellent software engineering practices with:
The implementation follows all repository guidelines and maintains high code quality standards throughout. |
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.
Just one comment about naming convention.
|
Claude finished @pujitm's task —— View job Code Review for Docker Folder MutationsI've completed my review of this PR focusing on code quality, potential bugs, performance, security, and test coverage. Review Tasks
🟢 Overall AssessmentThis is a well-implemented feature that adds Docker folder organization capabilities with strong code quality, comprehensive testing, and good architectural design. 📋 Detailed Review✅ Code Quality & Best PracticesExcellent adherence to repository standards:
Key strengths:
✅ SecurityAuthorization properly implemented:
Validation checks:
✅ PerformanceWell-optimized design:
Potential considerations:
✅ Test CoverageComprehensive test suite:
Test quality highlights:
✅ Architecture & DesignExcellent architectural decisions:
Notable design patterns:
🟡 Minor Suggestions
✅ New Files Assessment
Schema changes: Clean addition of two mutations with appropriate nullable parameters 🔍 No Issues Found
🎯 Recommendation: APPROVEThis PR demonstrates excellent software engineering practices with:
The implementation follows all repository guidelines and maintains high code quality standards throughout. |
|
This plugin has been deployed to Cloudflare R2 and is available for testing. |
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Documentation
Chores