Skip to content

Refactor to use 'workspaceSupported' to determine types supported by workspace containers#84

Open
Copilot wants to merge 3 commits into
mainfrom
copilot/add-dynamic-workspace-types
Open

Refactor to use 'workspaceSupported' to determine types supported by workspace containers#84
Copilot wants to merge 3 commits into
mainfrom
copilot/add-dynamic-workspace-types

Conversation

Copy link
Copy Markdown

Copilot AI commented May 22, 2026

This pull request refactors how workspace-supported resource types are determined and improves maintainability by centralizing this information in metadata. It introduces a workspaceSupported flag to the ResourceTypeMetadata interface and updates the logic and tests to use this metadata instead of a hardcoded list. This makes it easier to manage which resource types are supported at the workspace scope and ensures consistency across the codebase.

Key changes:

Resource type metadata improvements:

  • Added an optional workspaceSupported boolean property to the ResourceTypeMetadata interface and set it to true for all resource types that are supported at the workspace scope in RESOURCE_TYPE_METADATA. [1] [2] [3] [4] [5] [6] [7]

Workspace extractor logic:

  • Replaced the hardcoded WORKSPACE_SUPPORTED_TYPES array with a dynamic filter over RESOURCE_TYPE_METADATA based on the workspaceSupported flag, ensuring deterministic iteration order.

Add `workspaceSupported?: boolean` to ResourceTypeMetadata interface and
mark the 12 workspace-capable types in RESOURCE_TYPE_METADATA. Replace
the hardcoded WORKSPACE_SUPPORTED_TYPES array in workspace-extractor.ts
with a dynamic derivation filtered from RESOURCE_TYPE_METADATA in enum
declaration order. Add tests validating the flag and derived type list."
Copilot AI changed the title Implementing dynamic workspace supported types determination Restore supportsGet coverage and de-duplicate workspace-support tests May 22, 2026
Copilot finished work on behalf of EMaher May 22, 2026 18:45
Copilot AI requested a review from EMaher May 22, 2026 18:45
@EMaher EMaher requested a review from Copilot May 23, 2026 02:32
Copy link
Copy Markdown

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 PR refactors workspace-scoped extraction to derive the set of workspace-capable resource types from RESOURCE_TYPE_METADATA via a new workspaceSupported flag, removing the need for a separate hardcoded list and aiming for deterministic iteration. It also updates unit tests to validate the new metadata and iteration behavior.

Changes:

  • Add optional workspaceSupported?: boolean to ResourceTypeMetadata and mark the workspace-capable resource types in RESOURCE_TYPE_METADATA.
  • Replace the hardcoded WORKSPACE_SUPPORTED_TYPES list with a derived list filtered from ResourceType values using the metadata flag.
  • Update unit tests to cover workspaceSupported and the workspace extractor’s iteration behavior.

Reviewed changes

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

File Description
src/models/resource-types.ts Adds workspaceSupported metadata and sets it to true for workspace-capable resource types.
src/services/workspace-extractor.ts Derives WORKSPACE_SUPPORTED_TYPES dynamically from RESOURCE_TYPE_METADATA instead of maintaining a separate list.
tests/unit/models/resource-types.test.ts Adds tests for the new workspaceSupported flag and expected workspace-capable types.
tests/unit/services/workspace-extractor.test.ts Adds a test intended to verify iteration over workspace-supported types in enum order.

Comment thread tests/unit/services/workspace-extractor.test.ts
Comment thread tests/unit/models/resource-types.test.ts
Copy link
Copy Markdown

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@EMaher EMaher changed the title Restore supportsGet coverage and de-duplicate workspace-support tests Refactor to use 'workspaceSupported' to determine types supported by workspace containers May 23, 2026
@EMaher EMaher marked this pull request as ready for review May 23, 2026 02:48
@EMaher EMaher requested a review from petehauge May 23, 2026 02:49
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.

3 participants