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

Add errors-only output mode #2588

Closed
wants to merge 13 commits into from
Closed

Conversation

dobesv
Copy link
Contributor

@dobesv dobesv commented Nov 3, 2022

For users that are not that interested in all the output related cache hits/misses and the cached output of prior builds or even the new output from a new build step that's just print a count of files or something boring like that, this trims the output down to just the task that failed, if any.

Partial solution for #993

@dobesv dobesv requested review from a team as code owners November 3, 2022 23:48
@vercel
Copy link

vercel bot commented Nov 3, 2022

@dobesv is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Nov 3, 2022

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

Name Status Preview Comments Updated
examples-nonmonorepo ✅ Ready (Inspect) Visit Preview Nov 10, 2022 at 10:45PM (UTC)
examples-svelte-web 🔄 Building (Inspect) Nov 10, 2022 at 10:45PM (UTC)
turbo-site ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Nov 10, 2022 at 10:45PM (UTC)
4 Ignored Deployments
Name Status Preview Comments Updated
examples-basic-web ⬜️ Ignored (Inspect) Visit Preview Nov 10, 2022 at 10:45PM (UTC)
examples-designsystem-docs ⬜️ Ignored (Inspect) Nov 10, 2022 at 10:45PM (UTC)
examples-kitchensink-blog ⬜️ Ignored (Inspect) Nov 10, 2022 at 10:45PM (UTC)
examples-native-web ⬜️ Ignored (Inspect) Nov 10, 2022 at 10:45PM (UTC)

Copy link
Contributor

@mehulkar mehulkar left a comment

Choose a reason for hiding this comment

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

This looks good to me. An integration test under cli/integration-tests that checks log output would be a good addition here.

cli/internal/runcache/runcache.go Outdated Show resolved Hide resolved
| hash-only | Show only the hashes of the tasks |
| new-only | Only show output from cache misses |
| errors-only | Only show output from task failures |
| none | Hides all task output |
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you move docs to a separate PR? Since the feature won't be out until the next release, we'll hold onto the docs PR until then.

@mehulkar mehulkar removed the needs: team input Filter for core team meetings label Nov 8, 2022
Co-authored-by: Mehul Kar <[email protected]>
@dobesv
Copy link
Contributor Author

dobesv commented Nov 8, 2022

Thanks for the review!

I rolled back the docs changes and added a couple of tests. I'm not too familiar with the testing system and philosophy here so do let me know how to do the tests properly if I didn't do them right.

Copy link
Contributor

@mehulkar mehulkar left a comment

Choose a reason for hiding this comment

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

Almost there, thanks for the quick turnaround and working with me on this!

@dobesv
Copy link
Contributor Author

dobesv commented Nov 9, 2022

I updated the test so it also has a task whose output is not shown except in the count of tasks run.

Copy link
Contributor

@mehulkar mehulkar 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 the quick update and apologies for not getting this merged yesterday. One more comment about the test case and merge conflict needs resolved. 🤞🏾 we can get this in today! (I'll watch for updates here)

// OnError
// If output-mode is set to "errors-only", we'll have buffered output
// to disk without logging it. Now we can log that here.
func (tc TaskCache) OnError(terminal *cli.PrefixedUi, logger hclog.Logger) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is annoying, but lint requires the code comment to be a whole line starting with OnError. You can still break it up into multiple lines, but I guess specifically what you have here is not acceptable 🤦🏾 ...

@mehulkar
Copy link
Contributor

Merged in #2672. Thanks @dobesv !

@mehulkar mehulkar closed this Nov 11, 2022
@dobesv
Copy link
Contributor Author

dobesv commented Nov 11, 2022

Merged in #2672

Oh, uh thanks! I hadn't fixed the linter error, thanks for cleaning that up for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants