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 Helm Release List Page #3960

Merged

Conversation

rohitkrai03
Copy link
Contributor

@rohitkrai03 rohitkrai03 commented Jan 14, 2020

Related Story - https://issues.redhat.com/browse/ODC-2524

Depends on #3826 for the /helm/list API.

This PR -

  • Adds a new Nav Item for Helm Releases.
  • Adds new components - HelmReleasePage, HelmReleaseList, HelmReleaseHeader and HelmReleaseRow.
  • HelmReleaseList calls /helm/list API based on the namespace and Helm Release secrets fetch by firehose.
  • To minimize the number of API calls due to firehose resources chaning too often, adds a new utility for deep comparisons on dependencies in useEffect hook.
  • Adds custom text based filtering using TextFilter component from console.
  • Adds custom row filtering based on Helm Status using CheckBoxes component from console. The status based filtering also adds capability to filter multiplw statuses based on combined filter Other.

@openshift/team-devconsole-ux

Screencasts -

Helm Release List and Filtering -

Helm Release List - 1

Auto Update List -

Helm Release List - 2

@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 14, 2020
@openshift-ci-robot openshift-ci-robot added component/core Related to console core functionality component/dev-console Related to dev-console labels Jan 14, 2020
@rohitkrai03
Copy link
Contributor Author

/assign @christianvogt

@rohitkrai03 rohitkrai03 changed the title Added Helm Release List Page and Nav Item for it Add Helm Release List Page Jan 14, 2020
@rohitkrai03
Copy link
Contributor Author

Adding hold as it depends on #3826
/hold

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 14, 2020
@rohitkrai03
Copy link
Contributor Author

/test analyze

1 similar comment
@rohitkrai03
Copy link
Contributor Author

/test analyze

@andrewballantyne
Copy link
Contributor

/kind feature

@openshift-ci-robot openshift-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 15, 2020
@rohitkrai03
Copy link
Contributor Author

/test analyze

Copy link
Contributor

@serenamarie125 serenamarie125 left a comment

Choose a reason for hiding this comment

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

@rohitkrai03 nice job on this!

It feels like the page title/header has more white space than other pages, would you check that out, I might be wrong!

@sspeiche @siamaksade @sbose78 let's verify these are the appropriate columns. This is what we noted during our first meeting and is in the design, but we haven't talked much about it!

Can you also verify that these are the columns displayed during Search of a Helm Release?

Thanks!

getQueryArgument('rowFilter-helm-release-status').split(',');

const fetchHelmReleases = async () => {
const res: HelmRelease[] = await coFetchJSON('/api/console/helm/list');
Copy link
Contributor

Choose a reason for hiding this comment

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

@rohitkrai03 we've updated /api/console/helm/list API path to /api/helm/releases, please update here.

Copy link
Contributor

Choose a reason for hiding this comment

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

ref :

handle("/api/helm/releases", authHandlerWithUser(s.handleHelmList))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@akashshinde Sure.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you also update your PR description #3826 with new API endpoints?

@rohitkrai03
Copy link
Contributor Author

@rohitkrai03 nice job on this!

It feels like the page title/header has more white space than other pages, would you check that out, I might be wrong!

Maybe it seems like that because there is no Create button there. I've used same styles and classes from other pages so they should not differ.

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 20, 2020
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 20, 2020
@rohitkrai03 rohitkrai03 force-pushed the list-helm-releases branch 2 times, most recently from bf08afa to 0836298 Compare January 20, 2020 12:10
@divyanshiGupta
Copy link
Contributor

Please add unit tests.

@openshift-ci-robot openshift-ci-robot removed the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 20, 2020
@openshift-ci-robot openshift-ci-robot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jan 23, 2020
@rohitkrai03
Copy link
Contributor Author

/retest

@andrewballantyne
Copy link
Contributor

@rohitkrai03 you have an error that needs to be addressed:

ERROR in /go/src/github.com/openshift/console/frontend/packages/dev-console/src/plugin.tsx
(162,9): Types of property 'componentProps' are incompatible.
  Type '{ name: string; href: string; required: FLAGS; testID: string; }' is not assignable to type '(Pick<NavLinkProps, "startsWith" | "name" | "testID"> & Pick<HrefLinkProps, "href" | "activePath">) | (Pick<NavLinkProps, "startsWith" | ... 1 more ... | "testID"> & Pick<...>) | (Pick<...> & Pick<...>)'.
    Object literal may only specify known properties, and 'required' does not exist in type '(Pick<NavLinkProps, "startsWith" | "name" | "testID"> & Pick<HrefLinkProps, "href" | "activePath">) | (Pick<NavLinkProps, "startsWith" | ... 1 more ... | "testID"> & Pick<...>) | (Pick<...> & Pick<...>)'.

@andrewballantyne
Copy link
Contributor

/hold

Looks like the plugin type changed on you after you started.

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 23, 2020
componentProps: {
name: 'Helm Releases',
href: '/helm-releases',
required: FLAGS.OPENSHIFT,
Copy link
Contributor

Choose a reason for hiding this comment

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

Yup, looks like you need to remove this line.

Suggested change
required: FLAGS.OPENSHIFT,

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Jan 23, 2020
@rohitkrai03
Copy link
Contributor Author

@andrewballantyne Updated the PR. the plugin SDK changes that went in after #3383 got merged was the issue. Missed that in huge CI logs.

@andrewballantyne
Copy link
Contributor

/lgtm
/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 23, 2020
@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 23, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andrewballantyne, christianvogt, divyanshiGupta, rohitkrai03

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

@andrewballantyne
Copy link
Contributor

@andrewballantyne Updated the PR. the plugin SDK changes that went in after #3383 got merged was the issue. Missed that in huge CI logs.

Aritra went to forum-ui and Sam responded... I saw what he looked for and it's just how I look for errors on "Docker Strategy Failed" now 😄

@rohitkrai03
Copy link
Contributor Author

/test analyze

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit ae6ccb5 into openshift:master Jan 24, 2020
@spadgett spadgett added this to the v4.4 milestone Jan 27, 2020
@rohitkrai03
Copy link
Contributor Author

rohitkrai03 commented Feb 7, 2020

Hi, @rohitkrai03. Can you help us understand this change? It seems to be setting a bad filter value in redux and caused

https://bugzilla.redhat.com/show_bug.cgi?id=1798096

Screen Shot 2020-02-07 at 9 59 41 AM

Screen Shot 2020-02-07 at 10 00 23 AM

@spadgett The change was required for Helm List page. Helm Release is not a Kube resource so we needed to have custom filtering logic for the list page, and in order to re-use the CheckBoxes component for rendering RowFilters I needed a way to get the current filters and filter the releases. I figured out that the applyFilter prop can be used to pass a callback to the filtering logic in CheckBoxes component and get back the current filters. I was not aware of this side effect that it caused. Maybe we can change the prop name to applyCustomFilter to avoid the clash? Or if you see a better approach here please let me know. I can raise a PR for the fix.

@spadgett
Copy link
Member

spadgett commented Feb 7, 2020

The one place I know of that used the checkboxes outside of a k8s resource list is the API explorer. It uses the CheckBoxControls component directly if that works here:

https://github.com/spadgett/console/blob/e7694b5cf06cb843ff2778deaea9b30417995bf9/frontend/public/components/api-explorer.tsx#L575-L599

Agree we should definitely avoid a name collision if there is one.

@rohitkrai03
Copy link
Contributor Author

The one place I know of that used the checkboxes outside of a k8s resource list is the API explorer. It uses the CheckBoxControls component directly if that works here:

https://github.com/spadgett/console/blob/e7694b5cf06cb843ff2778deaea9b30417995bf9/frontend/public/components/api-explorer.tsx#L575-L599

Agree we should definitely avoid a name collision if there is one.

Went through the code in API explorer and it seems like some logic is replicated from CheckBoxes component. Also, it doesn't have the ability to save the filter or update the URL params based on filter selection. I would prefer to update the prop name to applyCustomFilter and re-use all the functionalities that we get from CheckBoxes component. What do you think? If you're okay with it, I'll raise a quick PR for the change.

@spadgett
Copy link
Member

spadgett commented Feb 7, 2020

I'm fine with that. Thanks for tracking this down.

@rohitkrai03
Copy link
Contributor Author

I'm fine with that. Thanks for tracking this down.

Great, so I'll raise a PR against this BZ https://bugzilla.redhat.com/show_bug.cgi?id=1798096

@rohitkrai03 rohitkrai03 deleted the list-helm-releases branch March 30, 2020 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. component/core Related to console core functionality component/dev-console Related to dev-console kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. 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.

None yet