Skip to content

Conversation

@gnehapk
Copy link
Contributor

@gnehapk gnehapk commented Jul 10, 2019

What is Done?

  • IPI flow i.e create new OCS Service using new nodes
  • Node list table for UPI flow(create new OCS Service using existing nodes)

Integration testing with OCS operator is pending. Will do after the availability of OCS operator.

Screenshots -
ocs-ipi-mode
ocs-upi-mode

@alecmerdler @spadgett @vojtechszocs Please review

@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 10, 2019
@openshift-ci-robot
Copy link
Contributor

Hi @gnehapk. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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.

@openshift-ci-robot openshift-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 10, 2019
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: gnehapk
To complete the pull request process, please assign alecmerdler
You can assign the PR to them by writing /assign @alecmerdler in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details 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

Copy link
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

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

I realize this is WIP and I haven't looked too closely at this, but I wanted to give you some initial comments.

Copy link
Member

Choose a reason for hiding this comment

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

2 spaces indentation, sort declarations

Copy link
Member

Choose a reason for hiding this comment

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

Remove empty line

Copy link
Member

Choose a reason for hiding this comment

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

Add a final newline to the file

Copy link
Member

Choose a reason for hiding this comment

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

Prefer functional components with hooks instead of class components in new code

Copy link
Contributor

Choose a reason for hiding this comment

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

@gnehapk You can still manage state in your component without using the class syntax.

Take public/components/utils/alerts.tsx as an example, it's a functional component (React.FC) that handles its state via React.useState API.

In general, we should prefer multiple smaller functional components over fewer bigger components, favoring composition over extension.

Copy link
Member

Choose a reason for hiding this comment

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

You should use a label selector in the query instead of filtering on the client

Copy link
Member

Choose a reason for hiding this comment

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

Add types when possible throughout

Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, don't we want to use k8sList here to fetch multiple resources of the same kind?

k8sList(ConfigMapModel, {
  labelSelector: { 'rook.io/node': some.metadata.name },
}).then((configMaps) => {
  // ...
});

Copy link
Member

Choose a reason for hiding this comment

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

Need to handle JSON.parse errors if it's invalid JSON (here and below)

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 11, 2019
Copy link
Contributor

@vojtechszocs vojtechszocs left a comment

Choose a reason for hiding this comment

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

I know it's still a WIP, but here are my comments so far.

Copy link
Contributor

Choose a reason for hiding this comment

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

Since the OCS install flow is part of ceph-storage-plugin, and since there's already a style [1] using the ceph prefix, you might want to use ceph prefix here as well, e.g. .ceph-ocs-info__alert.

[1] src/components/dashboard-page/storage-dashboard/data-resiliency/data-resiliency.scss

cc @cloudbehl

Copy link
Contributor

Choose a reason for hiding this comment

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

Modules under packages should use lodash.

See packages/.eslintrc.js:

Use lodash instead. webpack is configured to use lodash-es automatically.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think ESLint will warn about putting each property on a separate line.

Please run yarn lint from the Console monorepo root (frontend directory) and address any code style issues.

#1844 should make it easier to lint a specific package, for example:

yarn eslint packages/ceph-storage-plugin

Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, don't we want to use k8sList here to fetch multiple resources of the same kind?

k8sList(ConfigMapModel, {
  labelSelector: { 'rook.io/node': some.metadata.name },
}).then((configMaps) => {
  // ...
});

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd suggest to use a function to compute derived data, instead of keeping locally cached data in variables:

const deviceCount = getStorageDeviceCount(node);

This is similar in concept to getNodeRoles function in code above.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think devicesCount sounds a bit weird with the plural, I'd use deviceCount instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

@gnehapk You can still manage state in your component without using the class syntax.

Take public/components/utils/alerts.tsx as an example, it's a functional component (React.FC) that handles its state via React.useState API.

In general, we should prefer multiple smaller functional components over fewer bigger components, favoring composition over extension.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: all source files (ts, tsx, scss, etc.) should have a trailing newline.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: I'd suggest adding at least Service to the name of the model, like OCSServiceModel.

Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest using a webpackChunkName value consistent with other loaders above, i.e. ceph-ocs-service.

@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 16, 2019
@openshift-ci-robot openshift-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 17, 2019
@openshift-ci-robot
Copy link
Contributor

@gnehapk: PR needs rebase.

Details

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.

@wking
Copy link
Member

wking commented Aug 1, 2019

nit: "installtion" -> "installation" in the PR topic

@gnehapk
Copy link
Contributor Author

gnehapk commented Aug 15, 2019

Sent out a new PR as there were many conflicts coming after rebasing it with the master.

@gnehapk gnehapk closed this Aug 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants