Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1776069

Summary: Uncaught exception in UI when getting webhooks links for buildconfigs
Product: OpenShift Container Platform Reporter: Davi Garcia <dvercill>
Component: Management ConsoleAssignee: Jakub Hadvig <jhadvig>
Status: CLOSED ERRATA QA Contact: Yadan Pei <yapei>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.2.zCC: aos-bugs, bparees, jhadvig, jokerman, nmukherj, spadgett, yapei
Target Milestone: ---   
Target Release: 4.4.0   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Mozilla Firefox (70.0.1)
Last Closed: 2020-05-04 11:16:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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