Bug 1890180 - FieldDependency x-descriptor doesn't support non-sibling fields
Summary: FieldDependency x-descriptor doesn't support non-sibling fields
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: 4.5
Hardware: All
OS: All
low
low
Target Milestone: ---
: 4.7.0
Assignee: Jon Jackson
QA Contact: Yadan Pei
URL:
Whiteboard:
: 1926344 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-10-21 15:21 UTC by Marko Luksa
Modified: 2021-02-24 15:27 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Field dependency spec descriptor logic was not designed or tested with non-sibling dependencies. Consequence: Non-sibling dependencies were not guaranteed to behave as expected. Fix: Revised the logic (mainly around sort order) to ensure that non-sibling dependencies behave as expected. Result: Non-sibling field dependencies are now supported.
Clone Of:
: 1926344 (view as bug list)
Environment:
Last Closed: 2021-02-24 15:27:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift console pull 7957 0 None closed Bug 1913969: Fix edge case exception for fieldDependency spec descriptor 2021-02-08 15:51:57 UTC
Red Hat Product Errata RHSA-2020:5633 0 None None None 2021-02-24 15:27:46 UTC

Description Marko Luksa 2020-10-21 15:21:40 UTC
Description of problem:
According to the docs, the urn:alm:descriptor:com.tectonic.ui:fieldDependency is only supported for fields that are siblings. In our (IMHO perfectly valid) use-case, we need to depend on a field that is much further away in the tree:

- displayName: Jaeger Storage Type
  description: Set storage type for Jaeger (applies only when Jaeger is selected as the tracing provider)
  path: addons.jaeger.install.storage.type
  x-descriptors:
    - 'urn:alm:descriptor:com.tectonic.ui:fieldDependency:tracing.type:Jaeger'
    ...


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

How reproducible:
Although this seems to work fine (most of the time?), it's not officially supported, but I don't see why it shouldn't be.

Comment 1 Jon Jackson 2020-10-23 15:11:26 UTC
Came in near the end of the sprint. Will take a look next sprint.

Comment 2 Jon Jackson 2020-11-13 15:54:17 UTC
Still haven't had a chance to get to this.

Comment 3 Jon Jackson 2020-12-04 21:31:38 UTC
This fell low on priority because of other, higher severity bugs. Will address when I don't have higher sev bugs in my queue.

Comment 5 Jon Jackson 2021-02-08 15:54:11 UTC
This bug is fixed by https://github.com/openshift/console/pull/7957. The edge case that this PR fixes also adds support for arbitrary dependency control fields.

Comment 7 Jon Jackson 2021-02-08 17:00:03 UTC
*** Bug 1926344 has been marked as a duplicate of this bug. ***

Comment 8 Jon Jackson 2021-02-08 17:03:10 UTC
Target release set to 4.7 because the PR that fixes this was already merged before the 4.7 release.

Comment 10 Yanping Zhang 2021-02-09 10:26:30 UTC
@Jon, Hi, which operator do you suggest we can use to reproduce/verify this bug? I installed "Red Hat OpenShift Jaeger" operator, could not find snippet for "- displayName: Jaeger Storage Type".

Comment 11 Jon Jackson 2021-02-09 16:21:44 UTC
Hi Yanping,

I've created a gist for that you can use to verify this:

https://gist.github.com/TheRealJon/3680c8a573bde88a974588e269230562

Just create these resources, then navigate to Installed Operators > Mock Operator > Create Mock Resource. On the form, there should be a form field "Nested Field Dependency" that verifies this bug. There is a switch at "Nested Field Dependency > Enabled" which determines the visibility of the "Nested Field Dependency > Settings > Enabled" switch.

Comment 12 Yanping Zhang 2021-02-10 06:15:13 UTC
Thanks very much, Jon!
Checked on ocp 4.7 cluster with payload 4.7.0-0.nightly-2021-02-09-192846.
Created mock crd and csv from file in Comment 11, then on "Installed Operators > Mock Operator > Create Mock Resource" page, in form field "Nested Field Dependency", could choose true or false for enable to control the visibility of the "Nested Field Dependency > Settings > Enabled" switch, after click "Create", could see the related field on instance details page correctly.
The bug is fixed.

Comment 15 errata-xmlrpc 2021-02-24 15:27:22 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.7.0 security, bug fix, and enhancement 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-2020:5633


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