vscode-tekton icon indicating copy to clipboard operation
vscode-tekton copied to clipboard

implementing bundle feature

Open sudhirverma opened this issue 2 years ago • 5 comments

Fix: #695

sudhirverma avatar Oct 04 '22 07:10 sudhirverma

Codecov Report

Base: 67.92% // Head: 67.17% // Decreases project coverage by -0.75% :warning:

Coverage data is based on head (00ddcd1) compared to base (ee598cb). Patch coverage: 40.22% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #694      +/-   ##
==========================================
- Coverage   67.92%   67.17%   -0.76%     
==========================================
  Files         114      117       +3     
  Lines        6619     6790     +171     
  Branches     1157     1179      +22     
==========================================
+ Hits         4496     4561      +65     
- Misses       2123     2229     +106     
Impacted Files Coverage Δ
src/cluster-version.ts 53.84% <ø> (ø)
src/pipeline/preview.ts 19.53% <ø> (ø)
src/pipeline/wizard.ts 68.81% <ø> (ø)
src/tekton/restartpipelinerundata.ts 39.06% <ø> (ø)
src/tkn.ts 77.97% <ø> (ø)
src/yaml-support/tkn-code-actions.ts 93.45% <ø> (ø)
src/yaml-support/tkn-definition-providers.ts 96.66% <ø> (ø)
src/yaml-support/tkn-yaml-scheme-generator.ts 93.54% <ø> (ø)
src/pipeline/bundle.ts 18.98% <18.98%> (ø)
src/util/watchResources.ts 72.97% <33.33%> (-0.64%) :arrow_down:
... and 8 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov-commenter avatar Oct 04 '22 07:10 codecov-commenter

@sudhirverma which issue this PR is related to?

mohitsuman avatar Oct 15 '22 14:10 mohitsuman

@sudhirverma which issue this PR is related to?

this PR will fix #695

sudhirverma avatar Oct 15 '22 15:10 sudhirverma

@sudhirverma is the PR ready for review or you need to add some more features to it ?

mohitsuman avatar Oct 15 '22 16:10 mohitsuman

@sudhirverma is the PR ready for review or you need to add some more features to it ?

I am still working on it. I will add you as a reviewer when this PR is ready.

sudhirverma avatar Oct 15 '22 16:10 sudhirverma

Step to test this PR, enable enable-tekton-oci-bundles is set to "true" in the feature-flags configmap in tekton-pipelines namespace.

https://user-images.githubusercontent.com/9924513/199078989-8368ad8a-85c8-46d1-a82d-aebc0ead43d8.mov

sudhirverma avatar Oct 31 '22 18:10 sudhirverma

@sudhirverma Provide the registry username/password also in the same form. User need not go to switch the workflow. All Qs should be in the same form and once user clicks Submit, it should perform the required step.

mohitsuman avatar Nov 01 '22 09:11 mohitsuman

Started playing with it.

  1. I faced this error when clicking on submit. image The other annoying part is that the webview closes and when i reopen it the form is blank so i need to re-fill it to re-try deploying it. An idea could be to close the webview only if the deploy is successful
  2. If i click on the bundle action multiple time the webview gets opened in multiple tabs. Wouldn't it be enough to only have one webview opened? I don't think anybody is going to create 2 bundles at the same time.
  3. (person taste) isn't the webview too white compared to the vscode theme? The first time I opened it i got blind 😆
  4. The autocomplete item (= tekton resources) has one subtle issue. If you have two resources of different type with the same name you cannot add both of them.
  5. It would be good if, once you choose a resource in the autocomplete list, this gets removed from the list. autocomplete
  6. We should enable the submit button only if the image name has a valid format image

done

sudhirverma avatar Nov 09 '22 11:11 sudhirverma

I assume this PR is just for creating a new bundle and you're going to add the feature to download a bundle and allow users to import one or more resources contained in it in a new PR, right?

Yes I will create a new PR.

As a future enhancement, if it's possible to add multiple selection for the tekton resource dropdownlist would be great. When adding 10 resources it's an annoying process otherwise

Multiple selection is there when you press Ctrl and click on resources I will check if we can select multiple resource without pressing the ctrl key.

sudhirverma avatar Nov 09 '22 17:11 sudhirverma

@sudhirverma for multi-select chip selection, this should work https://mui.com/material-ui/react-select/#chip. This should be quick to do.

mohitsuman avatar Nov 11 '22 11:11 mohitsuman

@sudhirverma for multi-select chip selection, this should work https://mui.com/material-ui/react-select/#chip. This should be quick to do.

done

sudhirverma avatar Nov 11 '22 19:11 sudhirverma

@sudhirverma please add a gif of how the select chips look after the changes are done. And also how the submit button looks like.

mohitsuman avatar Nov 15 '22 21:11 mohitsuman

@mohitsuman attaching video

https://user-images.githubusercontent.com/9924513/202256183-ea46e687-68a4-44f6-a6f3-046b707a321c.mp4

sudhirverma avatar Nov 16 '22 17:11 sudhirverma

@sudhirverma There are multiple CSS stuff which needs to be improved here.

  • The submit button text colour.
  • The input boxes width (we need to keep it small, not so big)
  • Tekton resources layout breaks, as in overlaps with the Tekton Resources field name(at 0:22 in the video shared)

For input box layout, refer to how we do in the OpenShift extension https://github.com/redhat-developer/vscode-openshift-tools/blob/main/src/webview/git-import/app/gitImport.tsx#L322 . This will help you to improve the CSS also.

mohitsuman avatar Nov 17 '22 11:11 mohitsuman

@mohitsuman Updated the PR adding gif also

bundle

sudhirverma avatar Nov 18 '22 16:11 sudhirverma

@mohitsuman done can you check

sudhirverma avatar Nov 24 '22 09:11 sudhirverma

@sudhirverma This PR fails if we try to run this on a connected OpenShift cluster. It asks for namespaces "tekton-pipelines". For OpenShift it should be the openshift-pipelines namespace. And please also mention the detail step to configure the features to true to run bundles.

mohitsuman avatar Nov 25 '22 20:11 mohitsuman

Ideally this is the place to update the feature flag: $CLUSTER_URL/k8s/ns/openshift-pipelines/configmaps/feature-flags/yaml

mohitsuman avatar Nov 25 '22 20:11 mohitsuman

@sudhirverma looks good to me. Just resolve the conflicts and we should be good to merge.

@lstocchi can you please look at the bundle logic and approve?

mohitsuman avatar Nov 29 '22 19:11 mohitsuman