-
Notifications
You must be signed in to change notification settings - Fork 52
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
feat: manage default uri plugins for DevWorkspaces #425
Conversation
Can one of the admins verify this patch? |
|
||
workspace.spec.template.components.push({ | ||
name: pluginName, | ||
attributes: { [DEFAULT_PLUGIN_ATTRIBUTE]: true }, |
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.
}); | ||
} | ||
|
||
private isUri(str: string) { |
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.
my understanding is that if the definition of the plugin is not valid (not URI), there will be no error message, and the plugins will not be processed at all. Probably a good idea, but can we possibly at least log it somehow
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.
Yes, that's how it works, and sounds good, I've updated the PR with logging:
Lines 36 to 42 in 6aeacf6
const defaultUriPlugins = new Set(defaultPlugins.filter(plugin => { | |
if (this.isUri(plugin)) { | |
return true; | |
} | |
console.log(`Default plugin ${plugin} is not a uri. Ignoring.`); | |
return false; | |
})); |
import { V1alpha2DevWorkspaceSpecTemplateComponents } from '@devfile/api'; | ||
import * as DwApi from '../../dashboard-backend-client/devWorkspaceApi'; | ||
|
||
const DEFAULT_PLUGIN_ATTRIBUTE = 'default-plugin'; |
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.
@amisevsk wdyt? is it ok to add extra attribute in the plugin definition - https://github.com/eclipse-che/che-dashboard/pull/425/files#r768182143
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.
Yeah, it's not a problem. Attributes are intended to be implementation-dependant additional info, so this field is intended for use by other tools (DWO does this too). The only recommendation I'd have is to use a prefix to scope the attribute to Che itself, e.g. che.eclipse.org/default-plugin
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.
Thanks, updated to use che.eclipse.org/default-plugin
Codecov Report
@@ Coverage Diff @@
## main #425 +/- ##
==========================================
+ Coverage 49.61% 49.81% +0.20%
==========================================
Files 211 213 +2
Lines 7242 7265 +23
Branches 1199 1201 +2
==========================================
+ Hits 3593 3619 +26
+ Misses 3308 3300 -8
- Partials 341 346 +5
Continue to review full report at Codecov.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: amisevsk, dkwon17, ibuziuk The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
I have created a new PR on the original repository: #426 |
Signed-off-by: David Kwon <dakwon@redhat.com>
New changes are detected. LGTM label has been removed. |
[dashboard-ci-test] |
✅ E2E dashboard tests succeed 🎉 See Details
Test product:
Eclipse Che QE channel: https://mattermost.eclipse.org/eclipse/channels/eclipse-che-qe |
@dkwon17: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Closing in favour of #425 |
What does this PR do?
This PR provides support for adding/deleting default plugins for DevWorkspaces. This PR only supports managing plugins specified by url to a v2 devfile / DW / DWT.
Example plugin urls:
Default plugin urls are to be added to the Che CR's
server.workspaceDefaultPlugins
field, which is introduced in this PR: eclipse-che/che-operator#1248.Example:
What issues does this PR fix or reference?
This PR brings support for specifying default plugins by url in the CR for: eclipse-che/che#20090
Is it tested? How?
Start a devworkspace from the che-dashboard. For the screenshot below, I created a Go devworkspace.
Verify that the devworkspace has a plugin component for the default plugin
Remove
server.workspacesDefaultPlugins
from the CheCluster CR.Start the same devworkspace from step 4, and verify that the devworkspace does not have the default plugin anymore
Release Notes
Docs PR
TODO