Refactor to use 'workspaceSupported' to determine types supported by workspace containers#84
Open
Copilot wants to merge 3 commits into
Open
Refactor to use 'workspaceSupported' to determine types supported by workspace containers#84Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
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 created this pull request from a session on behalf of
EMaher
May 22, 2026 18:28
View session
Copilot
AI
changed the title
Implementing dynamic workspace supported types determination
Restore supportsGet coverage and de-duplicate workspace-support tests
May 22, 2026
There was a problem hiding this comment.
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?: booleantoResourceTypeMetadataand mark the workspace-capable resource types inRESOURCE_TYPE_METADATA. - Replace the hardcoded
WORKSPACE_SUPPORTED_TYPESlist with a derived list filtered fromResourceTypevalues using the metadata flag. - Update unit tests to cover
workspaceSupportedand 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. |
EMaher
approved these changes
May 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request refactors how workspace-supported resource types are determined and improves maintainability by centralizing this information in metadata. It introduces a
workspaceSupportedflag to theResourceTypeMetadatainterface 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:
workspaceSupportedboolean property to theResourceTypeMetadatainterface and set it totruefor all resource types that are supported at the workspace scope inRESOURCE_TYPE_METADATA. [1] [2] [3] [4] [5] [6] [7]Workspace extractor logic:
WORKSPACE_SUPPORTED_TYPESarray with a dynamic filter overRESOURCE_TYPE_METADATAbased on theworkspaceSupportedflag, ensuring deterministic iteration order.