Bug 1776069 - Uncaught exception in UI when getting webhooks links for buildconfigs
Summary: Uncaught exception in UI when getting webhooks links for buildconfigs
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: 4.2.z
Hardware: All
OS: Linux
unspecified
high
Target Milestone: ---
: 4.4.0
Assignee: Jakub Hadvig
QA Contact: Yadan Pei
URL:
Whiteboard:
: 1781300 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-11-25 03:58 UTC by Davi Garcia
Modified: 2020-05-04 11:17 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Mozilla Firefox (70.0.1)
Last Closed: 2020-05-04 11:16:28 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Github openshift console pull 3733 None None None 2019-12-11 01:45:54 UTC
Red Hat Product Errata RHBA-2020:0581 None None None 2020-05-04 11:17:26 UTC

Description Davi Garcia 2019-11-25 03:58:36 UTC
> Description of problem:
Using UI (Admin or Dev), on Builds > BuildConfigs, if you click on "Copy URL with Secret" (Generic or Github) nothing happens. If you open browser console, you see "uncaught exception: undefined".

> Version-Release number of selected component (if applicable):
4.2.7

> How reproducible:
Easily.

> Steps to Reproduce:
1. Create a BuildConfi using catalog example
2. Open Builds > BuildConfig and then the bc created
3. Click on "Copy URL with Secret" for Github

> Actual results:
Nothing happens (error on console)

> Expected results:
Get webhook link copied to clipboard.

Comment 1 Davi Garcia 2019-11-26 17:29:29 UTC
After some tests, I found out that this problem happens on Mozilla Firefox (70.0.1) but not on Google Chrome (78.0.3904.87). So maybe there is something happening at JavaScript level which is not supported in all browsers.

Comment 3 Samuel Padgett 2019-12-02 21:26:26 UTC
I suspect we don't have permission to write to the clipboard since we try to do it in response to the XHR:

https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/writeText#Browser_compatibility

> Writing to the clipboard is available without permission in secure contexts and browser extensions, but only from user-initiated event callbacks. 

Even though we're responding to a click, the XHR for the secret takes us out of that context.

Comment 4 Samuel Padgett 2019-12-09 19:25:38 UTC
*** Bug 1781300 has been marked as a duplicate of this bug. ***

Comment 5 Samuel Padgett 2019-12-10 15:26:52 UTC
https://github.com/openshift/console/pull/3733

Comment 7 Yadan Pei 2019-12-18 06:14:37 UTC
1. Create a BuildConfig using catalog example
2. Open Builds > BuildConfig and then the bc created
3. Click on "Copy URL with Secret" for Github or Generic, no errors and content can be copied successfully


Verified on 4.4.0-0.nightly-2019-12-16-124946

Comment 8 Yadan Pei 2019-12-18 06:15:18 UTC
Verified on FF68(reproduced the issue on older builds) & FF71

Comment 10 errata-xmlrpc 2020-05-04 11:16:28 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:0581


Note You need to log in before you can comment on or make changes to this bug.