Bug 1932472

Summary: Edit Form/YAML switchers cause weird collapsing/code-folding issue
Product: OpenShift Container Platform Reporter: Andrew Ballantyne <aballant>
Component: Dev ConsoleAssignee: Andrew Ballantyne <aballant>
Status: CLOSED ERRATA QA Contact: Gajanan More <gamore>
Severity: medium Docs Contact: Srivaralakshmi Ramani <srr>
Priority: low    
Version: 4.7CC: aballant, aos-bugs, dsantra, hmishra, nmukherj, srr
Target Milestone: ---   
Target Release: 4.8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Previously, when selecting the *YAML* tab, the `metadata.managedFields` section did not collapse immediately. This was due to an issue with the *Form* or *YAML* switcher for pages such as *Pipeline Builder* and *Edit HorizontalPodAutoscaler* (HPA). As a result, the part of the document where you tried to type collapsed. The `metadata.managedFields` section remained as is, and the cursor was reset to the starting position to the top left of the *YAML* editor. The current release fixes this issue. Now, upon loading the *YAML*, the `metadata.managedFields` section collapses immediately.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-07-27 22:48:13 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 Andrew Ballantyne 2021-02-24 16:50:36 UTC
Description of problem:

When editing a resource through a form/yaml switcher AND it has a managedFields property under metadata, the first characters you type into the editor cause that section of the YAML to collapse/code-fold.

How reproducible:
Always but only on an edit operation AND when managedFields exists (which I think is always?).

Steps to Reproduce:

Could only find two places this impacted, but we should look for more to verify we fix all locations.

Pipeline Builder (Pipeline Screen):
1. Create/have a Pipeline
2. Use the kebab option "Edit Pipeline"
3. Switch to the YAML view
4. Edit any section in `spec`

HPA (Topology Screen):
1. Create a Deployment resource with CPU limits (ie, via the add flow)
2. Using the Kebab on the Topology screen, select Add HPA
3. Add a CPU HPA % and save the form
4. Edit the HPA you created
5. Switch to the YAML view
6. Edit any section in `spec`

Actual results:
The section you edited collapses as soon as you type anything

Expected results:

- The managedFields field to be collapsed on load (like the YAML tab on details pages)
- There to be no auto-collapse of the section as you are typing

Additional info:

As far as I know this is only impacting DevConsole Form/Yaml switcher but as a result of changes to the YAML component to collapse managedFields on selection of the YAML tab on details pages of resources.

Comment 1 Andrew Ballantyne 2021-05-18 14:21:11 UTC
Sorry, actually a medium severity, it collapses the edited group so it impacts the user's ability to modify the YAML.

Comment 3 Debsmita Santra 2021-05-21 16:23:36 UTC
verified on 4.8.0-0.nightly-2021-05-21-101954

Comment 10 errata-xmlrpc 2021-07-27 22:48:13 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 (Moderate: OpenShift Container Platform 4.8.2 bug fix and security update), 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/RHSA-2021:2438