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 1911269: hide "waiting for builds" info message when a build is present #7665

Merged
merged 1 commit into from Jan 22, 2021

Conversation

debsmita1
Copy link
Contributor

@debsmita1 debsmita1 commented Dec 28, 2020

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

Analysis / Root cause:
It is not being checked if a successful build exists

Solution Description:

  • Checking if there exist some pod(s) having at least one(or more) container(s) with image id
  • added translation

GIF:
build-info-msg

Browser conformance:

  • Chrome
  • Firefox
  • Safari
  • Edge

@openshift-ci-robot openshift-ci-robot added the component/core Related to console core functionality label Dec 28, 2020
@debsmita1
Copy link
Contributor Author

/kind bug

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Dec 28, 2020
@debsmita1 debsmita1 changed the title hide "waiting for builds" info message when a build is present Bug 1911269: hide "waiting for builds" info message when a build is present Dec 28, 2020
@openshift-ci-robot openshift-ci-robot added bugzilla/severity-low Referenced Bugzilla bug's severity is low for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Dec 28, 2020
@openshift-ci-robot
Copy link
Contributor

@debsmita1: This pull request references Bugzilla bug 1911269, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.7.0) matches configured target release for branch (4.7.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 1911269: hide "waiting for builds" info message when a build is present

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.

@debsmita1
Copy link
Contributor Author

/cc @jerolimov

}) => {
const {
metadata: { name, namespace },
} = obj;

const [showWaitingPods, setShowWaitingPods] = React.useState(false);
const showWaitingForBuildAlert =
hasBuildConfig && isDeploymentGeneratedByWebConsole(obj) && pods.some(isPodWithoutImageId);
!isBuildComplete && isDeploymentGeneratedByWebConsole(obj) && pods.some(isPodWithoutImageId);
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't seem like the right solution as when the build completes this pods.some(isPodWithoutImageId) should return false. I think you should look into fixing this check and see why this isn't returning false when the build completes.

@openshift-ci-robot
Copy link
Contributor

@debsmita1: This pull request references Bugzilla bug 1911269, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.7.0) matches configured target release for branch (4.7.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 1911269: hide "waiting for builds" info message when a build is present

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.

@jerolimov
Copy link
Member

/retest

@@ -68,6 +68,9 @@ const isPodWithoutImageId = (pod: PodKind) =>
pod.status?.phase === 'Pending' &&
pod.status?.containerStatuses?.some((containerStatus) => !containerStatus.imageID);

const isPodWithImageId = (pod: PodKind) =>
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need two different checks here isPodWithoutImageId and isPodWithImageId ? Can we not use just one check for both cases?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed the usage of isPodWithoutImageId

@openshift-ci-robot
Copy link
Contributor

@debsmita1: This pull request references Bugzilla bug 1911269, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.7.0) matches configured target release for branch (4.7.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 1911269: hide "waiting for builds" info message when a build is present

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.

Comment on lines 175 to 177
{t('public~{{waitingPods}} waiting pods with errors', {
waitingPods: showWaitingPods ? 'Hide' : 'Show',
})}
Copy link
Member

Choose a reason for hiding this comment

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

Hi, this doesn't translate Hide and Show, right? So my suggest is:

Suggested change
{t('public~{{waitingPods}} waiting pods with errors', {
waitingPods: showWaitingPods ? 'Hide' : 'Show',
})}
{showWaitingPods ? t('public~Hide waiting pods with errors') : t('public~Show waiting pods with errors')}

Copy link
Member

Choose a reason for hiding this comment

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

I notice that your translation works fine, but its maybe still easier to translate two separate messages.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@openshift-ci-robot openshift-ci-robot added the kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated label Jan 13, 2021
Copy link
Member

@jerolimov jerolimov left a comment

Choose a reason for hiding this comment

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

Tested this locally. Works fine for the initial build and new builds. i18n looks good.

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 13, 2021
@jerolimov
Copy link
Member

/assign @rohitkrai03

@divyanshiGupta
Copy link
Contributor

divyanshiGupta commented Jan 13, 2021

@debsmita1 I see the following issues:
Peek 2021-01-13 17-07

Build Alert is shown first and then the pods every time on going to the resources tab. Ideally we should see the loading component and then the pods like it used to be before.

Peek 2021-01-13 17-05

On scaling down to 0 pods Buid Alert is shown. Ideally only the No pod resources found empty state should be shown like before.

@divyanshiGupta
Copy link
Contributor

/lgtm cancel

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Jan 13, 2021
@openshift-ci-robot openshift-ci-robot added the component/shared Related to console-shared label Jan 15, 2021
@debsmita1
Copy link
Contributor Author

@debsmita1 I see the following issues:
Peek 2021-01-13 17-07

Build Alert is shown first and then the pods every time on going to the resources tab. Ideally we should see the loading component and then the pods like it used to be before.

Peek 2021-01-13 17-05

On scaling down to 0 pods Buid Alert is shown. Ideally only the No pod resources found empty state should be shown like before.

Fixed !

const [showWaitingPods, setShowWaitingPods] = React.useState(false);
const showWaitingForBuildAlert =
hasBuildConfig && isDeploymentGeneratedByWebConsole(obj) && pods.some(isPodWithoutImageId);
!buildConfigData?.buildConfigs?.[0].builds.some((build) => isComplete(build)) &&
Copy link
Contributor

Choose a reason for hiding this comment

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

What if there are no buildConfigs in the returns object?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added check for buildConfigs

Comment on lines 164 to 182
const PodAlert = () =>
showWaitingForBuildAlert ? (
<Alert
isInline
variant="info"
title={t('public~Waiting for the build')}
actionLinks={
<AlertActionLink onClick={() => setShowWaitingPods(!showWaitingPods)}>
{showWaitingPods
? t('public~Hide waiting pods with errors')
: t('public~Show waiting pods with errors')}
</AlertActionLink>
}
>
{t(
'public~Waiting for the first build to run successfully. You may temporarily see "ImagePullBackOff" and "ErrImagePull" errors while waiting.',
)}
</Alert>
) : null;
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to create a function here, you can just write jsx directly.

Suggested change
const PodAlert = () =>
showWaitingForBuildAlert ? (
<Alert
isInline
variant="info"
title={t('public~Waiting for the build')}
actionLinks={
<AlertActionLink onClick={() => setShowWaitingPods(!showWaitingPods)}>
{showWaitingPods
? t('public~Hide waiting pods with errors')
: t('public~Show waiting pods with errors')}
</AlertActionLink>
}
>
{t(
'public~Waiting for the first build to run successfully. You may temporarily see "ImagePullBackOff" and "ErrImagePull" errors while waiting.',
)}
</Alert>
) : null;
const PodAlert = showWaitingForBuildAlert ? (
<Alert
isInline
variant="info"
title={t('public~Waiting for the build')}
actionLinks={
<AlertActionLink onClick={() => setShowWaitingPods(!showWaitingPods)}>
{showWaitingPods
? t('public~Hide waiting pods with errors')
: t('public~Show waiting pods with errors')}
</AlertActionLink>
}
>
{t(
'public~Waiting for the first build to run successfully. You may temporarily see "ImagePullBackOff" and "ErrImagePull" errors while waiting.',
)}
</Alert>
) : null;

Copy link
Contributor

@rohitkrai03 rohitkrai03 left a comment

Choose a reason for hiding this comment

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

/approve

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 22, 2021
Copy link
Contributor

@divyanshiGupta divyanshiGupta left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 22, 2021
const emptyMessage = emptyText || 'No Pods found for this resource.';
const emptyMessage = emptyText || t('public~No Pods found for this resource.');

const PodAlert = showWaitingForBuildAlert ? (
Copy link
Member

Choose a reason for hiding this comment

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

Sorry, small nit

Suggested change
const PodAlert = showWaitingForBuildAlert ? (
const podAlert = showWaitingForBuildAlert ? (

"ImagePullBackOff" and "ErrImagePull" errors while waiting.
</Alert>
) : null}
{buildConfigData.loaded && !buildConfigData.loadError && PodAlert}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
{buildConfigData.loaded && !buildConfigData.loadError && PodAlert}
{buildConfigData.loaded && !buildConfigData.loadError && podAlert}

Comment on lines +387 to +393
"View logs": "View logs",
"No Pods found for this resource.": "No Pods found for this resource.",
"Waiting for the build": "Waiting for the build",
"Hide waiting pods with errors": "Hide waiting pods with errors",
"Show waiting pods with errors": "Show waiting pods with errors",
"Waiting for the first build to run successfully. You may temporarily see \"ImagePullBackOff\" and \"ErrImagePull\" errors while waiting.": "Waiting for the first build to run successfully. You may temporarily see \"ImagePullBackOff\" and \"ErrImagePull\" errors while waiting.",
"View all {{podSize}}": "View all {{podSize}}",
Copy link
Member

Choose a reason for hiding this comment

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

👍

@jerolimov
Copy link
Member

/retest

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Jan 22, 2021
Copy link
Member

@jerolimov jerolimov 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 this quick fix of this nit

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: debsmita1, divyanshiGupta, jerolimov, 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

@openshift-merge-robot openshift-merge-robot merged commit aed8321 into openshift:master Jan 22, 2021
@openshift-ci-robot
Copy link
Contributor

@debsmita1: All pull requests linked via external trackers have merged:

Bugzilla bug 1911269 has been moved to the MODIFIED state.

In response to this:

Bug 1911269: hide "waiting for builds" info message when a build is present

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.

@spadgett spadgett added this to the v4.7 milestone Jan 26, 2021
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/severity-low Referenced Bugzilla bug's severity is low for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/core Related to console core functionality component/shared Related to console-shared kind/bug Categorizes issue or PR as related to a bug. kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated 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

7 participants