Skip to content

Conversation

@ycdzj
Copy link
Contributor

@ycdzj ycdzj commented Oct 13, 2025

  • refactor(resources): rename methods
  • refactor(resources): detect cycles

Copilot AI review requested due to automatic review settings October 13, 2025 10:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This refactor adds cycle detection capabilities to the resources service and standardizes method names across processors and controllers. The changes introduce safer resource operations by preventing circular parent-child relationships and consolidate resource retrieval logic.

  • Add cycle detection in resource operations to prevent circular parent-child relationships
  • Rename getPath method to getResource for better clarity
  • Replace direct resource access with centralized getResourceOrFail method

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/resources/resources.service.ts Adds cycle detection logic and new getResourceOrFail method
src/namespace-resources/namespace-resources.service.ts Removes direct resource access, adopts getResourceOrFail, renames getPath to getResource
src/namespace-resources/namespace-resources.controller.ts Updates method calls to use renamed getResource method
src/namespace-resources/file-resources.controller.ts Updates method calls to use renamed getResource method
src/wizard/wizard.service.ts Injects ResourcesService into processor constructors
src/wizard/processors/collect.processor.ts Replaces direct namespace resource access with ResourcesService
src/wizard/processors/collect.processor.spec.ts Updates tests to mock ResourcesService instead of NamespaceResourcesService
src/wizard/processors/reader.processor.spec.ts Updates tests to mock ResourcesService instead of NamespaceResourcesService

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@ycdzj ycdzj force-pushed the refactor/resources branch from 98096e6 to 947f1cd Compare October 15, 2025 04:21
@ycdzj ycdzj merged commit 8b45b90 into main Oct 15, 2025
4 checks passed
@ycdzj ycdzj deleted the refactor/resources branch October 15, 2025 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants