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

Add parser for subscription application #1114

Conversation

TimothyAsirJeyasing
Copy link
Contributor

@TimothyAsirJeyasing TimothyAsirJeyasing commented Dec 1, 2023

  1. Create a generic dashboard object. (right now it is appset specific)
  2. Create two parsers one for subscription, and one for ApplicationSet.
  3. dashboard.tsx will call these two parsers and collect the dashboard objects.
  4. Aggregate these dashboard object and pass it to the dashboard context

@TimothyAsirJeyasing TimothyAsirJeyasing changed the title WIP: Add parser for subscription application Add parser for subscription application Dec 4, 2023
@TimothyAsirJeyasing
Copy link
Contributor Author

Screenshot from 2023-12-05 16-20-56

applicationDeploymentInfo.push({
application,
subscriptionGroupInfo,
managedClusters: filerManagedClusterUsingDRClusters(
Copy link
Contributor

Choose a reason for hiding this comment

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

Every subscription will have a different managed cluster, so the managed cluster should be part of subscriptionGroupInfo.

@TimothyAsirJeyasing TimothyAsirJeyasing force-pushed the parser-for-applications branch 2 times, most recently from af9d76c to c3fefff Compare December 12, 2023 09:57
@TimothyAsirJeyasing
Copy link
Contributor Author

image

@@ -108,6 +107,6 @@ export const SnapshotSection: React.FC<CommonProps> = ({ selectedAppSet }) => {
};

type CommonProps = {
selectedAppSet: ProtectedAppSetsMap;
selectedApp: ProtectedAppMap;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
selectedApp: ProtectedAppMap;
selectedApplication: ProtectedApplicationMap;

};

type AppWiseCardProps = {
protectedPVCData: ProtectedPVCData[];
selectedAppSet: ProtectedAppSetsMap;
selectedApp: ProtectedAppMap;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
selectedApp: ProtectedAppMap;
selectedApplication: ProtectedApplicationMap;

packages/mco/types/dashboard.ts Outdated Show resolved Hide resolved
@TimothyAsirJeyasing
Copy link
Contributor Author

TimothyAsirJeyasing commented Dec 12, 2023

Sure i will rename all app into application, There are few merge conflicts, i will fix on the next patch update

const placementInfo: PlacementInfo =
protectedAppSetsMap?.placementInfo?.[0];
protectedAppMap?.placementInfo?.[0];
Copy link
Contributor

Choose a reason for hiding this comment

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

same here, You need to loop through each protectedAppMap?.placementInfo, Fetch syncInterval from each DRPC of the application to find the affected app count. If any one DRPC of application has replication issue then consider the application as affected.

@@ -61,7 +61,7 @@ export const StatusText: React.FC<StatusTextProps> = ({ children }) => {

export const VolumeSummarySection: React.FC<VolumeSummarySectionProps> = ({
protectedPVCData,
selectedAppSet,
selectedApp,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
selectedApp,
selectedApplication,

@@ -153,7 +153,7 @@ const ClusterDropdown: React.FC<Partial<ClusterAppDropdownProps>> = ({
clusterResources,
clusterName,
setCluster,
setAppSet,
setApp,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
setApp,
setApplication,

packages/mco/hooks/subscription.ts Outdated Show resolved Hide resolved
packages/mco/utils/disaster-recovery.tsx Outdated Show resolved Hide resolved
@TimothyAsirJeyasing
Copy link
Contributor Author

image

Comment on lines +82 to +83
loaded: true,
loadError: '',
Copy link
Collaborator

Choose a reason for hiding this comment

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

why are u always assuming it to be true without any error ??

Copy link
Contributor Author

@TimothyAsirJeyasing TimothyAsirJeyasing Dec 18, 2023

Choose a reason for hiding this comment

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

We are not having the appResource load status, Its already loaded this time and i can make this optional param or Shall i pass !!appResource to the loaded, or Could you please give some light / suggestion ?
appResource received from the callback which invoked by useArgoApplicationSetResourceWatch which uses useK8sWatchResources and that does not return the loaded and loadError state.

Copy link
Contributor Author

@TimothyAsirJeyasing TimothyAsirJeyasing Dec 18, 2023

Choose a reason for hiding this comment

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

For this similar thing it's used like this at line 74 at /home/timothyasir/Project/odf-console/packages/mco/components/modals/app-manage-policies/parsers/application-set-parser.tsx So i used the same way.

Copy link
Collaborator

Choose a reason for hiding this comment

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

appResource received from the callback which invoked by useArgoApplicationSetResourceWatch which uses useK8sWatchResources and that does not return the loaded and loadError state. >> I don't think that's the reason why we don't have any loading/error state here...

Copy link
Collaborator

Choose a reason for hiding this comment

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

useK8sWatchResources always returns loading/error state...

Signed-off-by: Timothy Asir Jeyasingh <[email protected]>
@TimothyAsirJeyasing
Copy link
Contributor Author

image

@SanjalKatiyar
Copy link
Collaborator

/approve

@SanjalKatiyar
Copy link
Collaborator

/lgtm

Copy link
Contributor

openshift-ci bot commented Dec 18, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: GowthamShanmugam, SanjalKatiyar, TimothyAsirJeyasing

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

@openshift-merge-bot openshift-merge-bot bot merged commit f7e9a93 into red-hat-storage:master Dec 18, 2023
3 checks passed
@TimothyAsirJeyasing
Copy link
Contributor Author

/cherry-pick release-4.15

@openshift-cherrypick-robot

@TimothyAsirJeyasing: #1114 failed to apply on top of branch "release-4.15":

Applying: Add parser for subscription application
Using index info to reconstruct a base tree...
M	locales/en/plugin__odf-console.json
M	packages/mco/components/mco-dashboard/data-policy/cluster-app-card/cluster.tsx
M	packages/mco/components/mco-dashboard/data-policy/cluster-app-card/common.tsx
M	packages/mco/components/mco-dashboard/data-policy/summary-card/summary-card.tsx
Falling back to patching base and 3-way merge...
Auto-merging packages/mco/components/mco-dashboard/data-policy/summary-card/summary-card.tsx
Auto-merging packages/mco/components/mco-dashboard/data-policy/cluster-app-card/common.tsx
Auto-merging packages/mco/components/mco-dashboard/data-policy/cluster-app-card/cluster.tsx
Auto-merging locales/en/plugin__odf-console.json
CONFLICT (content): Merge conflict in locales/en/plugin__odf-console.json
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Add parser for subscription application
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-4.15

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/test-infra repository.

@GowthamShanmugam
Copy link
Contributor

/cherry-pick release-4.15

@openshift-cherrypick-robot

@GowthamShanmugam: new pull request created: #1135

In response to this:

/cherry-pick release-4.15

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/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants