Skip to content
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

supports configure workspace features with wildcard #96

Merged
merged 4 commits into from
Aug 22, 2023

Conversation

ruanyl
Copy link
Owner

@ruanyl ruanyl commented Aug 21, 2023

Description

This PR adds support to configure workspace features with wildcard.

Supported rules with examples:

  1. * matches all features
  2. @management(with @ prefix) matches management category
  3. regular string like discover matches feature id
  4. use ! prefix to exclude category or feature, such as !@management and !discover will exclude management category and discover feature

Issues Resolved

Screenshot

Testing the changes

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
    • yarn test:ftr
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
@codecov-commenter
Copy link

codecov-commenter commented Aug 21, 2023

Codecov Report

Merging #96 (0a17104) into workspace (64bcc8b) will increase coverage by 0.00%.
Report is 5 commits behind head on workspace.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           workspace      #96   +/-   ##
==========================================
  Coverage      65.81%   65.81%           
==========================================
  Files           3334     3335    +1     
  Lines          64404    64428   +24     
  Branches       10248    10257    +9     
==========================================
+ Hits           42385    42401   +16     
- Misses         19451    19459    +8     
  Partials        2568     2568           
Flag Coverage Δ
Linux_1 34.75% <100.00%> (+0.02%) ⬆️
Linux_3 42.70% <ø> (ø)
Windows_1 34.76% <100.00%> (+0.02%) ⬆️
Windows_2 54.74% <ø> (ø)
Windows_3 42.70% <ø> (ø)
Windows_4 34.79% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
...c/core/public/workspace/workspaces_service.mock.ts 100.00% <ø> (ø)
src/core/public/workspace/workspaces_service.ts 47.05% <ø> (ø)
src/core/server/index.ts 100.00% <ø> (ø)
src/plugins/workspace/public/utils.ts 66.66% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
@@ -140,6 +142,7 @@ export class WorkspacePlugin implements Plugin<{}, {}> {
name: i18n.translate('workspaces.management.workspace.default.name', {
defaultMessage: 'Management',
}),
features: [`@${DEFAULT_APP_CATEGORIES.management.id}`],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we add features when creating public workspace?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Good question, do we have a conclusion already of what features to show in a public workspace?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think one thing for sure is that management category should not be displayed in public workspace.

}

// If a config starts with `!`, such feature or category will be excluded
if (featureConfig.startsWith('!')) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

For featureConfigs that only have one config like "!dev_tools", the result would be false when validate match({ id: 'integrations', category: { id: 'management', label: 'Management' } }). Is this by intention?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Yes, my thinking was, if user wants to match everything but not dev_tools, then the config should look like this: ['*', '!dev_tools']

@ruanyl ruanyl merged commit c83393b into workspace Aug 22, 2023
87 of 92 checks passed
@ruanyl ruanyl deleted the workspace-feature-list-support-wildcard branch August 25, 2023 02:50
SuZhou-Joe pushed a commit that referenced this pull request Aug 31, 2023
supports configure workspace features with wildcard

---------

Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
SuZhou-Joe pushed a commit that referenced this pull request Aug 31, 2023
supports configure workspace features with wildcard

---------

Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
ruanyl added a commit that referenced this pull request Sep 15, 2023
supports configure workspace features with wildcard

---------

Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants