Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: avoid panic on invalid directory filters (#6955)
### Description We had an unwrap on trying to parse user input as a glob. This PR just changes that to a better error message. Current behavior results in a panic: ``` [0 olszewski@chriss-mbp] /Users/olszewski/code/vercel/turborepo $ turbo run dev --filter={cli,docs} Oops! Turbo has crashed. A report has been written to /tmp/report-9c083809-41f9-43bb-86eb-6e7657e0b174.toml Please open an issue at https://github.com/vercel/turbo/issues/new/choose and include this file ... explanation = """ file 'crates/turborepo-lib/src/run/scope/filter.rs' at line 414 """ cause = "called `Result::unwrap()` on an `Err` value: BuildError { kind: Parse(ParseError { expression: \"cli,docs\", locations: [ErrorEntry { fragment: \",web\", location: 5, kind: Nom(Eof) }] }) }" method = "Panic" backtrace = """ 0: 0xf4ce22 - <turborepo_lib[adfb7611b6a9cc2e]::run::scope::filter::FilterResolver<turborepo_lib[adfb7611b6a9cc2e]::run::scope::change_detector::SCMChangeDetector>>::filter_graph_with_selectors ``` ### Testing Instructions Verify that we no longer panic on a bad directory: ``` [0 olszewski@chriss-mbp] /Users/olszewski/code/vercel/turborepo $ turbo_dev build --filter='{cli,docs}' ERROR run failed: 'Invalid directory filter 'cli,docs': failed to parse glob expression ``` Closes TURBO-2010
- Loading branch information
2d5f00c
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.
Successfully deployed to the following URLs:
turbo-site – ./docs
turbo.vercel.sh
turborepo.com
www.turbo.build
turbo.vercel.app
www.turborepo.org
turborepo.org
www.turbopack.org
turbo.build
turbopack.org
www.turborepo.com
turbo-site.vercel.sh
turbo-site-git-main.vercel.sh