Skip to content

Components View first iteration#2012

Merged
dgolovin merged 6 commits intoredhat-developer:masterfrom
dgolovin:i2008
Mar 12, 2021
Merged

Components View first iteration#2012
dgolovin merged 6 commits intoredhat-developer:masterfrom
dgolovin:i2008

Conversation

@dgolovin
Copy link
Copy Markdown
Collaborator

@dgolovin dgolovin commented Mar 9, 2021

This PR fixes #2008.

This fix adds:

  1. Components View (View) under Application Explorer
  2. View shows components discovered in workspace root folders
  3. Detection for devfile components based on odo env view, which works
    when cluster is not accessible or user is logged off from cluster
  4. Detection for s2i components based on parsing .odo/config.yaml
    (forkaround for odo env view not working for s2i components)
  5. Refresh for View based after event about new folder added to
    workspace
  6. Refrehs for View after component created form existing workspace
    folder (to avoid using watch for every folder in workspace)
  7. Reveal in Explorer for components to activate Explorer view and
    select context folder (not always working correctly first time, have
    no idea why)
  8. No support to create component when there is no accessible cluster or
    user is logged off (there should be quick input requests for project
    and application names, there should be qiuickpiks provided that allow
    to select existing and not existing projects/applications)

Not implemented yet:

  1. Show folders/files under component node (requires some work to
    incorporate filesystem watching with exlusion for folders like
    'node_modules'
  2. Watching for filesystem changes or focus ganed event to detect
    changes done in vscode terminal or external terminal
  3. Showing hierarchy Project/Application/Component rather than flat list
  4. Support pushing components to cluster from the view, especially for
    components with project that does not exist or currently not active
  5. Showing state Pushed/Not pushed for components pushed to current
    cluster/namespace (or current context)
  6. No icons yet
  7. No view Welcome page with 'Create Component' button

image

Signed-off-by: Denis Golovin dgolovin@redhat.com

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 9, 2021

Codecov Report

Merging #2012 (b8fb11e) into master (ba60970) will decrease coverage by 1.12%.
The diff coverage is 55.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2012      +/-   ##
==========================================
- Coverage   77.13%   76.01%   -1.13%     
==========================================
  Files          45       47       +2     
  Lines        3026     3143     +117     
  Branches      579      603      +24     
==========================================
+ Hits         2334     2389      +55     
- Misses        692      754      +62     
Impacted Files Coverage Δ
src/componentTypesView.ts 29.92% <ø> (ø)
src/odo/command.ts 87.50% <0.00%> (-1.31%) ⬇️
src/util/workspace.ts 100.00% <ø> (ø)
src/odo.ts 73.48% <33.33%> (-0.25%) ⬇️
src/componentsView.ts 38.46% <38.46%> (ø)
src/base/baseTreeDataProvider.ts 50.00% <50.00%> (ø)
src/openshift/openshiftItem.ts 81.02% <68.88%> (-6.48%) ⬇️
src/openshift/component.ts 83.42% <83.33%> (-0.04%) ⬇️
src/extension.ts 82.81% <100.00%> (+0.27%) ⬆️
src/oc.ts 100.00% <100.00%> (ø)
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ba60970...b8fb11e. Read the comment docs.

@jrichter1
Copy link
Copy Markdown
Member

Works in general, there are a few things I think should be improved:

  • deleting a project leaves all associated context folders open, the components won't be removed from the view unless the user manually closes the folders
  • no auto refresh after deleting a component, manual refresh works fine
  • I'd like to see more info about the components, like what template/devfile they are built on, or what state they are in
  • the OpenShift view is getting a bit packed with all the new sections, maybe some of them could be at least collapsed by default? Watch or debug session sections look like they are not really needed until somebody creates such a session.
  • reveal in explorer indeed doesn't work on the first try, it seems to focus the currently opened file instead

@dgolovin
Copy link
Copy Markdown
Collaborator Author

dgolovin commented Mar 9, 2021

* deleting a project leaves all associated context folders open, the components won't be removed from the view unless the user manually closes the folders

That is intentional. Imagine you have a project and want to try to deploy it to cluster. Then you delete component and your working project is gone from workspace as well.

* no auto refresh after deleting a component, manual refresh works fine

That is a good catch.

  • I'd like to see more info about the components, like what template/devfile they are built on, or what state they are in

We will get to it, for now the purpose is to let to see components without being connected/loggedin to cluster

  • the OpenShift view is getting a bit packed with all the new sections, maybe some of them could be at least collapsed by default? Watch or debug session sections look like they are not really needed until somebody creates such a session.

Not sure if that is possible, will check

  • reveal in explorer indeed doesn't work on the first try, it seems to focus the currently opened file instead

I noticed that to, but the same command is used in git sidebar for staged resources, that how I found it accidentally. Will check if calling it twice, solves the problem.

@dgolovin
Copy link
Copy Markdown
Collaborator Author

dgolovin commented Mar 9, 2021

Added refresh after deleting and reveal in explorer.

@jrichter1
Copy link
Copy Markdown
Member

* deleting a project leaves all associated context folders open, the components won't be removed from the view unless the user manually closes the folders

That is intentional. Imagine you have a project and want to try to deploy it to cluster. Then you delete component and your working project is gone from workspace as well.

I understand the need to keep the folders open. But the way this is currently implemented, I can delete a project with X components and still be left with those X components in the view, because their folders still contain the .odo subfolder. Ideally, the user should be left with the workspace folders open, but no components from a non existent project.

@dgolovin dgolovin force-pushed the i2008 branch 3 times, most recently from df55116 to 67e8ff3 Compare March 11, 2021 03:16
This PR fixes redhat-developer#2008.

This fix adds:
1. Components View (View)  under Application Explorer
2. View shows components discovered in workspace root folders
3. Detection for devfile components based on odo env view, which works
   when cluster is not accessible or user is logged off from cluster
4. Detection for s2i components based on parsing .odo/config.yaml
   (forkaround for odo env view not working for s2i components)
5. Refresh for View based after event about new folder added to
   workspace
6. Refrehs for View after component created form existing workspace
   folder (to avoid using watch for every folder in workspace)
7. Reveal in Explorer for components to activate Explorer view and
   select context folder (not always working correctly first time, have
   no idea why)

Not implemented yet:
1. Show folders/files under component node (requires some work to
   incorporate filesystem watching with exlusion for folders like
   'node_modules'
2. Watching for filesystem changes or focus ganed event to detect
   changes done in vscode terminal or external terminal
3. Showing hierarchy Project/Application/Component rather than flat list
4. Support pushing components to cluster from the view, especially for
   components with project that does not exist or currently not active
5. Showing state Pushed/Not pushed for components pushed to current
   cluster/namespace (or current context)
6. No icons yet
7. No view Welcome page with 'Create Component' button
8. No support to create component when there is no accessible cluster or
   user is logged off (there should be quick input requests for project
   and application names, there should be qiuickpiks provided that allow
   to select existing and not existing projects/applications)

Signed-off-by: Denis Golovin dgolovin@redhat.com
Signed-off-by: Denis Golovin dgolovin@redhat.com
Signed-off-by: Denis Golovin dgolovin@redhat.com
Signed-off-by: Denis Golovin dgolovin@redhat.com
Signed-off-by: Denis Golovin dgolovin@redhat.com
Signed-off-by: Denis Golovin dgolovin@redhat.com
@dgolovin dgolovin merged commit 5ed1e8c into redhat-developer:master Mar 12, 2021
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.

'Components View' to show components in current workspace

2 participants