openshift-pipelines / console-plugin

OpenShift Pipelines (and Tekton) OpenShift console dynamic plugin
Apache License 2.0
2 stars 16 forks source link

SRVKP-6343: Console crashes when ssh is selected in add secret for starting a pipeline run #155

Closed lokanandaprabhu closed 2 months ago

lokanandaprabhu commented 2 months ago

Fixes: https://issues.redhat.com/browse/SRVKP-6343

Analysis / Root cause: withDragDropContext is not exposed to dynamic plugins. In start pipeline form, user can create secret, there again, another HTML5Backend was getting created and this lead to "Cannot have two HTML5 backends at the same time." error.

Ideally DroppableFileInput and TextColumnField should be exposed to dynamic plugins which internally uses DND but since these components are not exposed, this change is required to set the context to window.

Solution Description: HTML5Backend is passed directly as backend prop to DndProvider instead of manager prop and the context is set to window

Screen shots / Gifs for design review:

----BEFORE---

https://github.com/user-attachments/assets/7b9a2efd-9c97-48d2-835a-7d222e605018

---AFTER----

https://github.com/user-attachments/assets/9b3094bc-7969-459d-ab19-a401e0892faa

Unit test coverage report: NA

Test setup:

NOTE: To test this PR, console PR - https://github.com/openshift/console/pull/14282 to be merged 1st.

1. Install pipelines operator and enable dynamic plugin
2. Create a pipeline through add flow and open start pipeline page in developer perspective
3. Under show credentials select add secret
4. In the secret form select `Access to ` as Git server and `Authentication type` as SSH key

Browser conformance:

openshift-ci-robot commented 2 months ago

@lokanandaprabhu: This pull request references SRVKP-6343 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target either version "4.18." or "openshift-4.18.", but it targets "Pipelines 1.16.0" instead.

In response to [this](https://github.com/openshift-pipelines/console-plugin/pull/155): >**Fixes**: >https://issues.redhat.com/browse/SRVKP-6343 > >**Analysis / Root cause**: >`withDragDropContext` is not exposed to dynamic plugins. In start pipeline form, user can create secret, there again, another HTML5Backend was getting created and this lead to "Cannot have two HTML5 backends at the same time." error. > >Ideally `DroppableFileInput` and `TextColumnField` should be exposed to dynamic plugins which internally uses DND but since these components are not exposed, this change is required to set the context to window. > >**Solution Description**: >`HTML5Backend` is passed directly as `backend` prop to `DndProvider` instead of `manager` prop and the `context` is set to `window` > >**Screen shots / Gifs for design review**: > >----BEFORE--- > > >https://github.com/user-attachments/assets/7b9a2efd-9c97-48d2-835a-7d222e605018 > > > >---AFTER---- > > > > >https://github.com/user-attachments/assets/9b3094bc-7969-459d-ab19-a401e0892faa > > > > > > >**Unit test coverage report**: >NA > >**Test setup:** > >NOTE: To test this PR, console PR - https://github.com/openshift/console/pull/14282 to be merged 1st. > > 1. Install pipelines operator and enable dynamic plugin > 2. Create a pipeline through add flow and open start pipeline page in developer perspective > 3. Under show credentials select add secret > 4. In the secret form select `Access to ` as Git server and `Authentication type` as SSH key > > >**Browser conformance**: > >- [x] Chrome >- [ ] Firefox >- [ ] Safari >- [ ] Edge > > > > > Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift-pipelines%2Fconsole-plugin). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
openshift-ci[bot] commented 2 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lokanandaprabhu

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/openshift-pipelines/console-plugin/blob/main/OWNERS)~~ [lokanandaprabhu] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
lokanandaprabhu commented 2 months ago

/cc @vikram-raj

vikram-raj commented 2 months ago

/cherry-pick release-v1.15.x

openshift-cherrypick-robot commented 2 months ago

@vikram-raj: once the present PR merges, I will cherry-pick it on top of release-v1.15.x in a new PR and assign it to you.

In response to [this](https://github.com/openshift-pipelines/console-plugin/pull/155#issuecomment-2348931277): >/cherry-pick release-v1.15.x Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.