-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Interpret paths in diesel.toml as relative to the project root #2069
Conversation
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.
Diesel CLI
test has been failed in this assertion. It seems that the path was changed.
diesel/diesel_cli/tests/migration_run.rs
Lines 502 to 508 in fcf690d
assert!( | |
result | |
.stderr() | |
.contains("Command would result in changes to src/my_schema.rs"), | |
"Unexpected stderr {}", | |
result.stderr() | |
); |
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.
Just a couple of nits.
before looking for `Cargo.toml`. | ||
|
||
* Any relative paths in `diesel.toml` will now be treated as relative to the | ||
project root (the directory containing either `diesel.toml` or `Cargo.toml`). |
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 think that this clarification makes it a little more confusing. It might be more effective to state in the previous paragraph what the project root is, then just reuse the term, especially since there can be multiple Cargo.toml
files (which this PR is trying to fix anyways).
diesel_cli/src/database_error.rs
Outdated
CargoTomlNotFound => { | ||
"Unable to find Cargo.toml in this directory or any parent directories." | ||
ProjectRootNotFound => { | ||
"Unable to find diesel.toml or Cargo.toml in this directory or any parent directories." |
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.
It may be useful to indicate what "this" directory is. I don't know much about efficiency if you include a format!
here, though. That would entail passing in either the url into the error, or something similar, which might cause enum size differences? But I'm not sure.
I was looking on the pipeline to see what failed and Azure says the build wasn't found -- does anybody know why it failed the pipeline? |
954ddd3
to
46fe6dc
Compare
I went ahead and also changed the search for project root to look for `diesel.toml` first, which should improve our behavior in workspaces. Fixes #2057.
46fe6dc
to
7a61a50
Compare
a675d28
to
6a2f074
Compare
I went ahead and also changed the search for project root to look for
diesel.toml
first, which should improve our behavior in workspaces.Fixes #2057.