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
Bug 1911269: hide "waiting for builds" info message when a build is present #7665
Conversation
/kind bug |
@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
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 kubernetes/test-infra repository. |
/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); |
There was a problem hiding this comment.
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.
@debsmita1: This pull request references Bugzilla bug 1911269, which is valid. 3 validation(s) were run on this bug
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 kubernetes/test-infra repository. |
/retest |
88812ae
to
65280bb
Compare
@@ -68,6 +68,9 @@ const isPodWithoutImageId = (pod: PodKind) => | |||
pod.status?.phase === 'Pending' && | |||
pod.status?.containerStatuses?.some((containerStatus) => !containerStatus.imageID); | |||
|
|||
const isPodWithImageId = (pod: PodKind) => |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^^ @debsmita1
There was a problem hiding this comment.
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
65280bb
to
703e146
Compare
@debsmita1: This pull request references Bugzilla bug 1911269, which is valid. 3 validation(s) were run on this bug
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 kubernetes/test-infra repository. |
{t('public~{{waitingPods}} waiting pods with errors', { | ||
waitingPods: showWaitingPods ? 'Hide' : 'Show', | ||
})} |
There was a problem hiding this comment.
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:
{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')} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
703e146
to
d00cccb
Compare
There was a problem hiding this 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
/assign @rohitkrai03 |
@debsmita1 I see the following issues:
On scaling down to 0 pods |
/lgtm cancel |
d00cccb
to
1c92578
Compare
Fixed ! |
1c92578
to
6371c3e
Compare
const [showWaitingPods, setShowWaitingPods] = React.useState(false); | ||
const showWaitingForBuildAlert = | ||
hasBuildConfig && isDeploymentGeneratedByWebConsole(obj) && pods.some(isPodWithoutImageId); | ||
!buildConfigData?.buildConfigs?.[0].builds.some((build) => isComplete(build)) && |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added check for buildConfigs
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; |
There was a problem hiding this comment.
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.
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; |
6371c3e
to
8955b61
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
const emptyMessage = emptyText || 'No Pods found for this resource.'; | ||
const emptyMessage = emptyText || t('public~No Pods found for this resource.'); | ||
|
||
const PodAlert = showWaitingForBuildAlert ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, small nit
const PodAlert = showWaitingForBuildAlert ? ( | |
const podAlert = showWaitingForBuildAlert ? ( |
"ImagePullBackOff" and "ErrImagePull" errors while waiting. | ||
</Alert> | ||
) : null} | ||
{buildConfigData.loaded && !buildConfigData.loadError && PodAlert} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{buildConfigData.loaded && !buildConfigData.loadError && PodAlert} | |
{buildConfigData.loaded && !buildConfigData.loadError && podAlert} |
"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}}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
/retest |
8955b61
to
8c8e5c2
Compare
There was a problem hiding this 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
[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 |
@debsmita1: All pull requests linked via external trackers have merged: Bugzilla bug 1911269 has been moved to the MODIFIED state. 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 kubernetes/test-infra repository. |
Fixes:
https://issues.redhat.com/browse/ODC-5069
Analysis / Root cause:
It is not being checked if a successful build exists
Solution Description:
GIF:
Browser conformance: