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

Bug 1826646: shows alert in eventsources form if knative service is not present in namespace #5144

Merged

Conversation

invincibleJai
Copy link
Member

@invincibleJai invincibleJai commented Apr 22, 2020

Fixes:
https://issues.redhat.com/browse/ODC-3439

Analysis / Root cause:
In Console EventSources form supports only sink to knative Service and in case of no associated service for that form will be never get enabled and user has not much information apart from form field

Solution Description:
Adds an Alert in EventSources form which would be shown if there are no knative service in that namespace

Gif/Image:
Apr-22-2020 13-32-47

Screenshot 2020-04-22 at 1 56 09 PM

Tests:
Screenshot 2020-04-23 at 1 54 00 PM

Browser conformance:

  • Chrome
  • Firefox
  • Safari
  • Edge

@openshift-ci-robot openshift-ci-robot added bugzilla/unspecified bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Apr 22, 2020
@openshift-ci-robot
Copy link
Contributor

@invincibleJai: This pull request references Bugzilla bug 1826646, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1826646: shows alert in eventsources form if knative service is not present in namespace

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 the component/knative Related to knative-plugin label Apr 22, 2020
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 22, 2020
@invincibleJai
Copy link
Member Author

@serenamarie125 PTAL , needed your review

/kind bug

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Apr 22, 2020
Copy link
Contributor

@sahil143 sahil143 left a comment

Choose a reason for hiding this comment

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

/lgtm

verifed changes locally

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 22, 2020
@sahil143
Copy link
Contributor

/lgtm cancel

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

@sahil143 sahil143 left a comment

Choose a reason for hiding this comment

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

@invincibleJai spacing between heading the alert doesn't seem right.
Screenshot from 2020-04-22 17-27-06
UX design
Screenshot from 2020-04-22 17-27-20

Please confirm with UX.

@invincibleJai
Copy link
Member Author

@sahil143 updated , PTAL

Screenshot 2020-04-22 at 5 52 33 PM

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.

Thanks for making these changes & collaborating on the design approach @invincibleJai ! Approved by UX

{...props}
namespace={namespace}
projects={projects}
showSinkAlert={service?.loaded && !service?.data?.length}
Copy link
Contributor

Choose a reason for hiding this comment

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

@invincibleJai Why not render the alert here in this component only? The alert doesn't seem to be related to the form in any way.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

Comment on lines 29 to 33
{showSinkAlert && (
<Alert variant="default" title="Event Source can not be created" isInline>
An event source must sink to Knative Service, but no Knative Service exist in this project
</Alert>
)}
Copy link
Contributor

Choose a reason for hiding this comment

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

Move to separate component and have it do it's own fetching of the knative service to show the alert.

Right now this change is spread across 3 different components when it should be isolated to a single component.

Also try to use the firehose hook.

Copy link
Member Author

Choose a reason for hiding this comment

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

Have fixed it and refactored code Projects are also fetched with useK8sWatchResource

@openshift-ci-robot
Copy link
Contributor

@invincibleJai: This pull request references Bugzilla bug 1826646, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1826646: shows alert in eventsources form if knative service is not present in namespace

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.


type EventSourcePageProps = RouteComponentProps<{ ns?: string }>;

const EventSourcePage: React.FC<EventSourcePageProps> = ({ match, location }) => {
const namespace = match.params.ns;
const searchParams = new URLSearchParams(location.search);
const resources = [{ kind: ProjectModel.kind, prop: ProjectModel.id, isList: true }];
const knServiceResource = { ...knativeServingResourcesServices(namespace)[0], limit: 1 };
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 you should still move this into NoKnativeServiceAlert and pass the namespace as a prop.
There's no need for the parent to have to deal with passing along a firehose query because then there's no constrain on the resource or limit.
If you just pass the namespace, internal to NoKnativeServiceAlert it knows exactly what to look for.

@christianvogt
Copy link
Contributor

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: christianvogt, invincibleJai, serenamarie125

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-robot openshift-merge-robot merged commit 323948e into openshift:master Apr 23, 2020
@openshift-ci-robot
Copy link
Contributor

@invincibleJai: All pull requests linked via external trackers have merged: openshift/console#5144. Bugzilla bug 1826646 has been moved to the MODIFIED state.

In response to this:

Bug 1826646: shows alert in eventsources form if knative service is not present in namespace

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
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/knative Related to knative-plugin kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants