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

fix: order tasks in order of interest, namely failed, successful, then cached #9353

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

arlyon
Copy link
Contributor

@arlyon arlyon commented Oct 30, 2024

Currently, when running tasks using the new UI, turbo inserts passed / failed tasks below cached tasks (in order of completion) meaning the stuff users probably want to see (failed things) end up at the bottom of the list or off screen. This change attempts to improve that by inserting those items in front of the list of cached tasks. That way cached tasks (likely the least interesting) end up last and preceded by successful tasks and then failed tasks. This assumes that users will more interested in failed tasks than successful ones but I am also open to ordering just the failed / successful task in order of completion instead.

In practice this means if running turbo in a large project with --continue where the majority of tasks are and will remain cached between runs, then the things that are 'interesting' will usually be close to the user's cursor.

It also 'fixes' the case where viewing a task that is completed jumps past the cached tasks and you have to traverse back through them all to get to the top again.

@arlyon arlyon requested a review from a team as a code owner October 30, 2024 15:51
@turbo-orchestrator turbo-orchestrator bot added needs: triage New issues get this label. Remove it after triage owned-by: turborepo labels Oct 30, 2024
Copy link

vercel bot commented Oct 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-nonmonorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 30, 2024 4:01pm
8 Skipped Deployments
Name Status Preview Comments Updated (UTC)
examples-basic-web ⬜️ Ignored (Inspect) Oct 30, 2024 4:01pm
examples-designsystem-docs ⬜️ Ignored (Inspect) Oct 30, 2024 4:01pm
examples-gatsby-web ⬜️ Ignored (Inspect) Oct 30, 2024 4:01pm
examples-kitchensink-blog ⬜️ Ignored (Inspect) Oct 30, 2024 4:01pm
examples-native-web ⬜️ Ignored (Inspect) Oct 30, 2024 4:01pm
examples-svelte-web ⬜️ Ignored (Inspect) Oct 30, 2024 4:01pm
examples-tailwind-web ⬜️ Ignored (Inspect) Oct 30, 2024 4:01pm
examples-vite-web ⬜️ Ignored (Inspect) Oct 30, 2024 4:01pm

Copy link
Contributor Author

arlyon commented Oct 30, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @arlyon and the rest of your teammates on Graphite Graphite

Copy link
Member

@chris-olszewski chris-olszewski left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

.iter()
// note we can't use the default Ord impl because
// we want failed tasks first
.sorted_by_key(|task| match task.result() {
Copy link
Member

Choose a reason for hiding this comment

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

Non blocking TODO for myself (or anyone else), but we should try to insert tasks as they finish in this order instead of sorting it on every render.

@arlyon arlyon merged commit 5a43696 into main Oct 31, 2024
41 checks passed
Copy link
Contributor Author

arlyon commented Oct 31, 2024

Merge activity

  • Oct 31, 9:56 AM EDT: A user merged this pull request with Graphite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: triage New issues get this label. Remove it after triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants