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-6195: Bucket - list page #1598

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

Conversation

GowthamShanmugam
Copy link
Contributor

@GowthamShanmugam GowthamShanmugam commented Sep 26, 2024

https://issues.redhat.com/browse/RHSTOR-6195
ToDo bucket sync button after merging: #1591

@openshift-ci-robot
Copy link

openshift-ci-robot commented Sep 26, 2024

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

In response to this:

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.

Copy link
Contributor

openshift-ci bot commented Sep 26, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: GowthamShanmugam
Once this PR has been reviewed and has the lgtm label, please assign cloudbehl for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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-ci-robot
Copy link

openshift-ci-robot commented Sep 26, 2024

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

In response to this:

https://issues.redhat.com/browse/RHSTOR-6195

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.

@GowthamShanmugam
Copy link
Contributor Author

GowthamShanmugam commented Sep 26, 2024

Screenshot 2024-09-26 at 7 30 03 PM Screenshot 2024-09-26 at 7 34 07 PM Screenshot 2024-09-26 at 7 35 39 PM

Signed-off-by: Gowtham Shanmugasundaram <[email protected]>
@openshift-ci-robot
Copy link

openshift-ci-robot commented Sep 26, 2024

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

In response to this:

https://issues.redhat.com/browse/RHSTOR-6195
ToDo bucket sync button after merging: #1591

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.

Copy link
Contributor

openshift-ci bot commented Sep 26, 2024

@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 8b665ba 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.

"No buckets found": "No buckets found",
"Create bucket": "Create bucket",
"Create and manage your buckets": "Create and manage your buckets",
"Navigate through your buckets effortlessly. View the contents of your S3-managed and Openshift-managed buckets, making it easy to locate and inspect objects. Track and manage object versions and deleted items. View and restore previous versions of objects and access a history of deleted items, ensuring you can recover or review data as needed.": "Navigate through your buckets effortlessly. View the contents of your S3-managed and Openshift-managed buckets, making it easy to locate and inspect objects. Track and manage object versions and deleted items. View and restore previous versions of objects and access a history of deleted items, ensuring you can recover or review data as needed.",
Copy link
Collaborator

Choose a reason for hiding this comment

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

not in phase 1

Suggested change
"Navigate through your buckets effortlessly. View the contents of your S3-managed and Openshift-managed buckets, making it easy to locate and inspect objects. Track and manage object versions and deleted items. View and restore previous versions of objects and access a history of deleted items, ensuring you can recover or review data as needed.": "Navigate through your buckets effortlessly. View the contents of your S3-managed and Openshift-managed buckets, making it easy to locate and inspect objects. Track and manage object versions and deleted items. View and restore previous versions of objects and access a history of deleted items, ensuring you can recover or review data as needed.",
"Navigate through your buckets effortlessly. View the contents of your S3-managed and Openshift-managed buckets, making it easy to locate and inspect objects.": "Navigate through your buckets effortlessly. View the contents of your S3-managed and Openshift-managed buckets, making it easy to locate and inspect objects.",

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ack

@@ -1331,6 +1337,10 @@
"No resources available": "No resources available",
"Select {{resourceLabel}}": "Select {{resourceLabel}}",
"Error Loading": "Error Loading",
"Loading Empty Page": "Loading Empty Page",
Copy link
Collaborator

Choose a reason for hiding this comment

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

or it should be capital only ??

Suggested change
"Loading Empty Page": "Loading Empty Page",
"Loading empty page": "Loading Empty Page",

@SanjalKatiyar
Copy link
Collaborator

SanjalKatiyar commented Sep 30, 2024

no need for extra "bucket" directory here: /s3-browser/bucket/buckets-list-page/bucketsListPage.tsx...
we can directly do packages/odf/components/s3-browser/buckets-list-page/bucketsListPage.tsx

Also, bucketsListPage.tsx should be BucketsListPage.tsx...

IIRC that's what we decided, cc @alfonsomthd to keep me honest.

const [buckets, filteredData, onFilterChange] = useListPageFilter(
convertS3ListBucketOutputToK8sCompatible(data)
);
const [favorites, setFavorites] = useUserSettings<BucketFavoritesType>(
Copy link
Collaborator

Choose a reason for hiding this comment

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

useUserSettings first stores items in a ConfigMap then as a fallback to a local-storage...

for our use case there can be 100s of buckets (probably 1000), so might be too much info for a single CM ??

should we use useUserSettingsLocalStorage only ??

cc @GowthamShanmugam @bipuladh @alfonsomthd wdyt ?

Copy link
Collaborator

@alfonsomthd alfonsomthd Sep 30, 2024

Choose a reason for hiding this comment

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

The data stored in a ConfigMap cannot exceed 1 MiB. Provided that even 1000 buckets (max buckets an accoun can have) do not reach that threshold, then it's a matter of consensus. Otherwise we should definitely not store it in a ConfigMap.

Copy link
Collaborator

Choose a reason for hiding this comment

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

it's a global CM (shared by OCP and all its dynamic plugins), lot other things are stored there...

Copy link
Collaborator

Choose a reason for hiding this comment

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

also, in future when we support more accounts we definitely will have to revert to local storage way only... because CM is still global...

Copy link
Collaborator

Choose a reason for hiding this comment

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

it's a global CM (shared by OCP and all its dynamic plugins), lot other things are stored there...

Then definitely it's not a safe place to store that data.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok! I thought the bucket count wouldn't cross more than 200, so I decided to use the same configMap. And the user won't select all 200 as fav.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But local storage will be a terrible user experience, The user will see different fav in different browsers. And what is they selected 500 buckets as fav and other browser displays nothing

Copy link
Collaborator

Choose a reason for hiding this comment

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

make sense !!
let's confirm with OCP team on what they think.

Also, @GowthamShanmugam just a reminder that on a bucket deletion, we need to update this CM/LocalStorage as well.

noobaaS3.listBuckets()
);
const [buckets, filteredData, onFilterChange] = useListPageFilter(
convertS3ListBucketOutputToK8sCompatible(data)
Copy link
Collaborator

Choose a reason for hiding this comment

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

nits: name too long:P

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ya

Comment on lines +241 to +243
type BucketFavoritesType = {
[key in string]: boolean;
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

better to have a Set with all the buckets which are marked as favourite...

no need to store the once which are false...

true
);

const isLoadeddWOAnyError = !isLoading && !error;
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 isLoadeddWOAnyError = !isLoading && !error;
const isLoadedWOAnyError = !isLoading && !error;

const { Name: name, CreationDate: creationDate } = bucket.apiResponse;
const { favorites, setFavorites }: RowExtraPropsType = extraProps;

const onSetFavorite = React.useCallback(
Copy link
Collaborator

Choose a reason for hiding this comment

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

no need for useCallback...
onFavorite ref below is already changing on re-render, saving onSetFavorite won't do any good...

@@ -67,6 +71,7 @@ export const ComposableTable: ComposableTableProps = <
translate={null}
aria-label="Composable table"
className="pf-v5-u-mt-md"
variant={isCompact ? TableVariant.compact : null}
Copy link
Collaborator

Choose a reason for hiding this comment

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

totally optional comment:

Suggested change
variant={isCompact ? TableVariant.compact : null}
{...(isCompact ? {variant: ableVariant.compact} : {})}

Comment on lines -512 to -514
},
"flags": {
"required": ["MCG"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

no need to remove this IMO...
why are we removing this ??

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok! i accidently removed this

Comment on lines -590 to -605
{
"type": "odf.horizontalNav/tab",
"properties": {
"id": "objectbuckets",
"name": "%plugin__odf-console~Object Buckets%",
"contextId": "odf-object-service",
"after": "namespace-store",
"href": "objectbucket.io~v1alpha1~ObjectBucket",
"component": {
"$codeRef": "ob.ObjectBucketListPage"
}
},
"flags": {
"required": ["MCG"]
}
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

we still need it for non-mcg-standalone deployments...

Copy link
Collaborator

Choose a reason for hiding this comment

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

only time we don't need is for mcg-standalone specifically...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -20,21 +24,66 @@ const COUNT_PER_PAGE_NUMBER = 10;
export type PaginatedListPageProps = {
countPerPage?: number;
filteredData: K8sResourceCommon[];
CreateButton: React.FC<unknown>;
Copy link
Collaborator

Choose a reason for hiding this comment

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

it's a shared component, do we really need to change the name ??
need to check the impact (if any) on Fusion side, if we are planning a rename...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No problem. for now, I will keep the name CreateButton. I renamed this to make this paginated component generic to create any kind of list page between MCO and ODF.

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