Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RHSTOR-6968: Disaster recovery UI for Kubevirt VM - managed application #1856

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GowthamShanmugam
Copy link
Contributor

@GowthamShanmugam GowthamShanmugam commented Feb 12, 2025

ACM custom extension: stolostron/console#4252

Existing Flow:
The parser always triggers the modal, even while the watcher is fetching data, displaying it with a loading: false argument.

Screenshot 2025-02-17 at 6 10 29 PM

Problem in existing flow for VM: (Delay in modal loading)
The application parser is determined only after the VM parser identifies the appropriate parser to call. This causes a delay in modal loading, making the modal appear a few seconds after the user clicks the button.

Screenshot 2025-02-17 at 6 10 43 PM

New Flow:
The modal will always load, while the modal body will be rendered based on the parsers.

Screenshot 2025-02-17 at 6 24 27 PM

Copy link
Contributor

openshift-ci bot commented Feb 12, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: GowthamShanmugam

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:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@GowthamShanmugam GowthamShanmugam force-pushed the RHSTOR-6968 branch 2 times, most recently from b52301d to 963f3ca Compare February 17, 2025 11:32
@GowthamShanmugam
Copy link
Contributor Author

GowthamShanmugam commented Feb 17, 2025

Screenshot 2025-02-17 at 5 03 25 PM Screenshot 2025-02-17 at 5 04 00 PM Screenshot 2025-02-17 at 5 05 07 PM Screenshot 2025-02-17 at 5 03 14 PM Screenshot 2025-02-17 at 5 09 27 PM

@GowthamShanmugam GowthamShanmugam changed the title Disaster recovery UI for Kubevirt VM - managed application RHSTOR-6968: Disaster recovery UI for Kubevirt VM - managed application Feb 17, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Feb 17, 2025

@GowthamShanmugam: This pull request references RHSTOR-6968 which is a valid jira issue.

In response to this:

ACM custom extension: stolostron/console#4252

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid jira ticket of any type label Feb 17, 2025
Copy link
Contributor

openshift-ci bot commented Feb 18, 2025

@GowthamShanmugam: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/odf-console-e2e-aws aec7705 link true /test odf-console-e2e-aws

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.


const getGVK = (resource: K8sResourceCommon) =>
resource?.['apigroup']
? // ACM search API compatibile fields
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
? // ACM search API compatibile fields
? // ACM search API compatible fields

Comment on lines +3 to +13
export const VirtualMachineModel: K8sModel = {
label: 'VirtualMachine',
labelPlural: 'VirtualMachines',
apiVersion: 'v1',
apiGroup: 'kubevirt.io',
plural: 'virtualmachines',
abbr: 'VM',
namespaced: true,
kind: 'VirtualMachine',
crd: true,
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is VM a new CRD, but in ACM it's represented as either AppSet or Subscription ??

isOpen: boolean;
close?: () => void;
close: () => void;
// ACM search API compatibile field
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// ACM search API compatibile field
// ACM search API compatible field

});
return [...acc, ...filteredLabels];
}, []) || [];
searchResult?.data.searchResult?.[0]?.related?.[0]?.items?.reduce(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this related change backward compatible with older version of ACM (as per our support matrix) ??

Meaning, say ODF 4.19 is running on older ACM version which is supported as per our support matrix, but that ACM version do not add/support related to the resultant object.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Feb 24, 2025

@GowthamShanmugam: This pull request references RHSTOR-6968 which is a valid jira issue.

In response to this:

ACM custom extension: stolostron/console#4252

Existing Flow:
The parser always triggers the modal, even while the watcher is fetching data, displaying it with a loading: false argument.

Screenshot 2025-02-17 at 6 10 29 PM

Problem in existing flow for VM: (Delay in modal loading)
The application parser is determined only after the VM parser identifies the appropriate parser to call. This causes a delay in modal loading, making the modal appear a few seconds after the user clicks the button.

Screenshot 2025-02-17 at 6 10 43 PM

New Flow:
The modal will always load, while the modal body will be rendered based on the parsers.

Screenshot 2025-02-17 at 6 24 27 PM

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

[]
);

const applicaiton = applicationInfo as ApplicationType;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const applicaiton = applicationInfo as ApplicationType;
const application = applicationInfo as ApplicationType;

if (state.modalViewContext === ModalViewContext.ASSIGN_POLICY_VIEW) {
return (
<AssignPolicyView
applicaitonInfo={applicaiton}
Copy link
Collaborator

@alfonsomthd alfonsomthd Feb 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
applicaitonInfo={applicaiton}
applicationInfo={application}

isSubscriptionAppType={
applicaiton?.type === DRApplication.SUBSCRIPTION
}
unProtectedPlacementCount={applicaiton?.placements?.length}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
unProtectedPlacementCount={applicaiton?.placements?.length}
unprotectedPlacementCount={application?.placements?.length}

import { ModalViewContext } from './utils/reducer';

const getGVK = (resource: K8sResourceCommon) =>
resource?.['apigroup']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure what you are trying to do here. K8sResourceCommon does not have a apiGroup field. And are you using object notation to skip ts checks?

const getGVK = (resource: K8sResourceCommon) =>
resource?.['apigroup']
? // ACM search API compatibile fields
referenceFor(resource['apigroup'])(resource['apiversion'])(resource.kind)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The usage of this is wrong if the input object is of type K8sResourceCommon. referenceFor will give you a GVK literal with a /.

/>
);
}
// TODO: Add support for discovered application type
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to be addressed in a follow-up PR, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved jira/valid-reference Indicates that this PR references a valid jira ticket of any type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants