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

[dashboard] Show prebuild status based on prebuild workspace record #8805

Merged
merged 2 commits into from
Mar 29, 2022

Conversation

easyCZ
Copy link
Member

@easyCZ easyCZ commented Mar 14, 2022

Description

Currently, the Prebuild detail view (with logs and status) uses the WorkspaceInstance status. This is inconsistent with respect to the Prebuild List view. This PR uses the prebuild status instead of status from the WorkspaceInstance.

This PR does not remove all instances of this inconcistent usage (another in ConfigureProject.tsx). It will be removed in a subsequent PR.

Related Issue(s)

How to test

  1. Preview env
  2. Add/clone https://gitlab.com/gitpod-milan/gitpod-large-image as a Project
  3. Trigger builds for the following branches:
    • main
    • pass
    • timeout
    • fail-prebuild
  4. Observe various statuses reported
  5. Trigger a new prebuild and cancel it manually - observe cancelled status

Release Notes

Dashboard reports prebuild status consistently between list view and detail view.

Documentation

How it looks

Screenshot 2022-03-15 at 19 41 18

Screenshot 2022-03-15 at 19 41 11

Screenshot 2022-03-15 at 19 41 02

Screenshot 2022-03-15 at 19 42 51

Screenshot 2022-03-15 at 19 42 39

Screenshot 2022-03-15 at 19 45 31

Open questions

  • Designs could be improved with respect to showing the underlying error. I think we can follow-up with a cleanup of the styling to communicate the underlying error message more cleanly

/hold

  • /werft with-clean-slate-deployment

@easyCZ easyCZ changed the title WIP: Normalize usage of prebuild status in dashboard [dashboard] Show prebuild status based on prebuild workspace domain record Mar 15, 2022
@easyCZ easyCZ changed the title [dashboard] Show prebuild status based on prebuild workspace domain record [dashboard] Show prebuild status based on prebuild workspace record Mar 15, 2022
@easyCZ easyCZ marked this pull request as ready for review March 15, 2022 21:50
@easyCZ easyCZ requested a review from a team March 15, 2022 21:50
@github-actions github-actions bot added the team: webapp Issue belongs to the WebApp team label Mar 15, 2022
@easyCZ easyCZ force-pushed the mp/pb-status branch 2 times, most recently from e49a30b to 7ebe21f Compare March 15, 2022 21:52
@easyCZ
Copy link
Member Author

easyCZ commented Mar 16, 2022

/werft run

👍 started the job as gitpod-build-mp-pb-status.7

@easyCZ
Copy link
Member Author

easyCZ commented Mar 16, 2022

@gtsiolis The current way we report the underlying error (next to the status) is a bit ugly. Do you have thoughts on what we could do here? For now, we only have a string as the error but I'm working on making this a bit richer as well.

Co-related: The statuses we have here don't always convey well. For example, we show Failed in red, but it was in a way a "user error" - something defined by the prebuild tasks didn't complete succesfully. I think here it would helpful to better convey that the system is fine, but the task is not.

@gtsiolis gtsiolis requested a review from a team March 16, 2022 12:15
@gtsiolis
Copy link
Contributor

gtsiolis commented Mar 16, 2022

ETA: Adding this to scheduled to take a look later today or tomorrow.

Thanks for the ping @easyCZ! 🏓

@andrew-farries
Copy link
Contributor

Gave this a quick look just now and after triggering prebuilds on all branches, they all failed with:

image

@easyCZ
Copy link
Member Author

easyCZ commented Mar 16, 2022

Ah, good old staging not working again. Will take a look either later or next week (hols Thu /Fri)

@easyCZ
Copy link
Member Author

easyCZ commented Mar 21, 2022

@andrew-farries I've rebased and re-deployed this branch, I've also run the above tests and I've been able to reproduce the desired changes
Screenshot 2022-03-21 at 11 29 18
.

@AlexTugarev
Copy link
Member

AlexTugarev commented Mar 29, 2022

/werft run

👍 started the job as gitpod-build-mp-pb-status.9

}

// Deprecated. Use PrebuildStatus instead.
export function PrebuildInstanceStatus(props: { prebuildInstance?: WorkspaceInstance; prebuild?: PrebuildWithStatus }) {
Copy link
Member

Choose a reason for hiding this comment

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

I see, it's still used in ConfigureProject component. OK

AlexTugarev
AlexTugarev previously approved these changes Mar 29, 2022
Copy link
Member

@AlexTugarev AlexTugarev left a comment

Choose a reason for hiding this comment

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

Works as advertised!

Thanks!

jankeromnes
jankeromnes previously approved these changes Mar 29, 2022
Copy link
Contributor

@jankeromnes jankeromnes left a comment

Choose a reason for hiding this comment

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

This is fantastic, many thanks @easyCZ! 👏

Code changes also look good to me, and the PR seems to work as advertised. 🎯

@gtsiolis Would you like to review the "How it looks" screenshots in the PR description? 😁 (Personally, this looks good to me and is already better than what we have today in production, so we could also merge this and make any adjustments in follow-ups. 💭)

@easyCZ easyCZ dismissed stale reviews from jankeromnes and AlexTugarev via 7581fb2 March 29, 2022 09:17
Copy link
Contributor

@jankeromnes jankeromnes left a comment

Choose a reason for hiding this comment

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

Re-approving post nit-fix ✅

@easyCZ
Copy link
Member Author

easyCZ commented Mar 29, 2022

/unhold

@gtsiolis
Copy link
Contributor

gtsiolis commented Mar 29, 2022

Taking a look now! 👀

But feel free to merge this as is.

@roboquat roboquat merged commit 3d4e0e4 into main Mar 29, 2022
@roboquat roboquat deleted the mp/pb-status branch March 29, 2022 09:28
Copy link
Contributor

@gtsiolis gtsiolis left a comment

Choose a reason for hiding this comment

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

I'm late here but left some comments we could have addressed in this iteration. Posted here in case we'd like to open follow up issues or PRs for these.

Cc @andrew-farries @jankeromnes @AlexTugarev @easyCZ

if (props.prebuild?.error) {
return (
<span>
The tasks executed in the prebuild returned a non-zero exit code. {props.prebuild.error}
Copy link
Contributor

Choose a reason for hiding this comment

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

question: This could be confusing. Could we use simpler words to describe the error. Maybe something like the following?

A task configured to run in the prebuild returned a non-zero exit code.

if (props.prebuild?.error) {
return (
<span>
The tasks executed in the prebuild returned a non-zero exit code. {props.prebuild.error}
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: Also, the error appended there is already included in the log output above, right? If yes, I think we could safely drop it from there. WDYT?

Frame 369

Copy link
Member Author

Choose a reason for hiding this comment

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

Definitely. I'm trying to clean it up incrementally as there's a lot of tech debt with respect where we collect the "truth" from. Unify first, then improve the messaging.

I'll cut a ticket for this concrete case to not show the same error twice.

Copy link
Contributor

Choose a reason for hiding this comment

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

Unify first, then improve the messaging.

💯

I'll cut a ticket for this concrete case to not show the same error twice.

Thanks, @easyCZ! 🏀

Copy link
Contributor

Choose a reason for hiding this comment

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

fyi: I've opened #9111 to keep track of this discussion and the unresolved comments below.

Comment on lines +341 to +342
Prebuild has been cancelled. Either a user cancelled it, or the prebuild rate limit has been
exceeded. {props.prebuild.error}
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: Again, a simpler message here could help while dropping appending information that is already duplicated. WDYT?

Prebuild has been manually cancelled or prebuild rate limit has been reached.

function PrebuildStatusDescription(props: { prebuild: PrebuildWithStatus }) {
switch (props.prebuild.status) {
case "queued":
return <span>Prebuild is queued and will be processed when there is execution capacity.</span>;
Copy link
Contributor

Choose a reason for hiding this comment

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

thought: Sounds accurate but a bit scary for humans, no? Maybe we could use something like the following:

Prebuild is queued and will be processed in a moment.

case "timeout":
return (
<span>
Prebuild timed out. Either the image, or the prebuild tasks took too long. {props.prebuild.error}
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: Maybe the following suffices?

Prebuild timed out because the image or prebuild tasks took too long.

Optiontally, we could append some information about the max prebuild limit.

Prebuild timed out because the image or prebuild tasks took too long. Maximum prebuild duration is 1 hour.

@easyCZ
Copy link
Member Author

easyCZ commented Mar 29, 2022

I'm late here but left some comments we could have addressed in this iteration. Posted here in case we'd like to open follow up issues or PRs for these.

Cc @andrew-farries @jankeromnes @AlexTugarev @easyCZ

Thanks for the feedback. That makes sense. From my perspective, I'd be interested in exposing the full error message but possibly it can be inside (by default) collapsed component. Surfacing the information does allow us to get better feedback on the errors from users and be able to address them. WDYT @gtsiolis?

My intention for follow-up PRs is to clean-up the errors the server provides such that we treat them as "publicly facing errors" and include actionable feedback.

Optiontally, we could append some information about the max prebuild limit.

On the topic of these, the error message should really come directly from the backend. We're entering a world where workspace features can configurable and in that case only the backend will be authoritative over what the timeout (or other properties) actually are. I think we'll see us move away more from the UI having the error text and more it being sourced directly from the DB as a user facing error.

@gtsiolis
Copy link
Contributor

gtsiolis commented Mar 29, 2022

From my perspective, I'd be interested in exposing the full error message but possibly it can be inside (by default) collapsed component. Surfacing the information does allow us to get better feedback on the errors from users and be able to address them. WDYT @gtsiolis?

Fully agree on beng able to see the full error message. However, we can mask the form of the error on the elements that do not scale well with long error messages and use the full error message on areas that scale better like the logs output.

For example, currently the time out error easily breaks out of the one sentence limit and also introduces long message that is hard to parse and includes duplicate information (see 01h00m).

🍊 🍊 🍊 🍊

My intention for follow-up PRs is to clean-up the errors the server provides such that we treat them as "publicly facing errors" and include actionable feedback.

Looking forward for this one, @easyCZ! Feel free to loop me in if you need any more feedback on this.

🍋 🍋 🍋 🍋

On the topic of these, the error message should really come directly from the backend.

Also, fully agree. But still masking the type of the error or including a short version of the error message could help to include in small areas like here or in tooltips could be useful.

I think we'll see us move away more from the UI having the error text and more it being sourced directly from the DB as a user facing error.

Sounds good! 🙏

@roboquat roboquat added the deployed: webapp Meta team change is running in production label Mar 31, 2022
@gtsiolis
Copy link
Contributor

gtsiolis commented Apr 4, 2022

@easyCZ
Copy link
Member Author

easyCZ commented Apr 4, 2022

Thanks for the follow-up @gtsiolis. I believe we can action it as follows:

I'll go and close the first now.

@gtsiolis
Copy link
Contributor

gtsiolis commented Apr 4, 2022

Thanks, @easyCZ! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: webapp Meta team change is running in production release-note size/M team: webapp Issue belongs to the WebApp team
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants