-
Notifications
You must be signed in to change notification settings - Fork 135
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
Upgrade to tracing
and color-eyre
#602
Conversation
Heyo, First of all thanks for the contribution! Second thing: When doing such large scale refactorings, please talk with maintainers first. Especially when introducing architectural changes such as a That being said, I'll try to review this soonish, there's a lot of stuff going on right now so I'm not sure when I'll make it :) |
All good, I'm using my version in production already, hopefully the colourful error messages can get to everybody :) Also, one thing, I'm connecting over TCP/TLS to my remote server, but its erroring because the |
About the prelude, its completely private and only an internal module (note the |
Regarding the first issue of the CWD. If the CWD on the local isn't being used, what CWD should then be used instead. The only reasonable thing I can come up with is Regarding the prelude: |
Yeah all good, specifically for error handling I also like to have an (internal in this case) crate called pub(crate) mod prelude {
pub(crate) use whatever_global_lib::prelude::*;
pub(crate) use crate::errors::*;
}
pub(crate) mod errors {
pub type Result<T> = color_eyre::Result<T>;
pub type Error = color_eyre::Report;
} These internal patterns I have devised and used because they have proven their worth to me over many wildly varying projects, from |
About the |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #602 +/- ##
==========================================
- Coverage 80.89% 80.41% -0.49%
==========================================
Files 75 76 +1
Lines 5942 5959 +17
==========================================
- Hits 4807 4792 -15
- Misses 1135 1167 +32 ☔ View full report in Codecov by Sentry. |
Test Results 2 files - 1 14 suites - 5 3m 29s ⏱️ +4s Results for commit f41b295. ± Comparison against base commit 30359aa. This pull request removes 1 test.
♻️ This comment has been updated with latest results. |
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.
Nice.
Generally, the logs look much more neat and I really appreciate the work :)
There're a few general issues:
- You drive-by bumped the dependencies of the project in a completely unrelated commit. Please do that in a separate commit or even in a separate MR, it makes it easier to review, dissect, debug and revert.
If rebasing the history is too annoying for you, I would be ok with squashing everything into a single commit to make this easier. - FYI The import formatting isn't really to my liking. We now have a
crate
import at the very top, followed bystd
imports, external lib imports,pueue_lib
imports, followed bycrate
imports again.
That being said, I'll run acargo fmt
with some nightly options as soon as this is merged, so this will be fixed later on by me. Just wanted to give you a heads-up that this will change in the future. - I'll try to be open-minded and see how the
prelude
works out :D
One easy-to-fix thing though, please renameprelude
tointernal_prelude
to prevent confusion. Theprelude
pattern is widely known and the expectations to new developers will be that it exposes stuff to library users (which was my first expectation as well). Having a different name should prevent this.
Good catch thx Co-authored-by: Arne Christian Beer <privat@arne.beer>
Ok I've committed my changes for everything bar the unresolved requested changes above, tbh I'm not to confident with git and don't know how to rebase the |
Yeah rebasing into sensible commits would be annoying :D One easy way to do this would be the following: git reset --soft main
git checkout main Cargo.lock
cargo build
# Do a new commit That should squash the changes and only introduce the Cargo.lock changes of your remove/added dependencies |
I just noticed that you don't work on a feature branch. Well, this complicates things. Please reset to the latest branch point (which would be In case you're interested, here's my usual Git Workflow Your |
Also check the Github Action pipelines. The Windows code breaks as you didn't adjust the code over there. Over here you have to wait for me to approve the pipeline first. |
These changes make errors go from this:
![image](https://private-user-images.githubusercontent.com/105958073/410412845-a6b91b40-edb9-42ad-a799-4437a01ea3b0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0NTU2NzAsIm5iZiI6MTczOTQ1NTM3MCwicGF0aCI6Ii8xMDU5NTgwNzMvNDEwNDEyODQ1LWE2YjkxYjQwLWVkYjktNDJhZC1hNzk5LTQ0MzdhMDFlYTNiMC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxM1QxNDAyNTBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1kNWQ1ZmQ4M2ZkNDUwNmZlZmU2MjYwMDFjOTMxNzlhNGU2ZTBhMDM1MmE1YTk1YzE0OGI5NThjYTM0YzkxYzM4JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.UGLUugfkPOSYHG1E6Wzsw6uC4AoB4BREit94ofQ_CGE)
![image](https://private-user-images.githubusercontent.com/105958073/410412971-a9d1804d-6807-4eb6-bf5e-1cd0cfa9377b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0NTU2NzAsIm5iZiI6MTczOTQ1NTM3MCwicGF0aCI6Ii8xMDU5NTgwNzMvNDEwNDEyOTcxLWE5ZDE4MDRkLTY4MDctNGViNi1iZjVlLTFjZDBjZmE5Mzc3Yi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxM1QxNDAyNTBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0wZjFhMmQwM2M5NjZjMTE0ZmM2NTMyZmM1MDVhZjk4YTlhNTZiZjgzMDc4NjUxZDhkNDAxMTcyZjlhZTA2N2YzJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.m-HK3DL1XqsbuTnB44EOUNzdGmc2_OOI2qhK1DkEfeE)
To this:
And logs from this:
![image](https://private-user-images.githubusercontent.com/105958073/410413153-f60be018-6c35-4503-a6c2-3360b722e693.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0NTU2NzAsIm5iZiI6MTczOTQ1NTM3MCwicGF0aCI6Ii8xMDU5NTgwNzMvNDEwNDEzMTUzLWY2MGJlMDE4LTZjMzUtNDUwMy1hNmMyLTMzNjBiNzIyZTY5My5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxM1QxNDAyNTBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT00YzAzNTU4ODEyODc5NmM5MWIwYzAwMzg0ZmMwMzUwZDgxYmM3YTg3N2UwY2RiYzUzOTMyMmUzZDQxNjFkZDg3JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.B59EQoEWD8mYvgXtUlFqM9w2UqJXumeUWOaHPK12fVo)
![image](https://private-user-images.githubusercontent.com/105958073/410413394-7c359671-9cc6-4f52-9317-11d6488711c8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0NTU2NzAsIm5iZiI6MTczOTQ1NTM3MCwicGF0aCI6Ii8xMDU5NTgwNzMvNDEwNDEzMzk0LTdjMzU5NjcxLTljYzYtNGY1Mi05MzE3LTExZDY0ODg3MTFjOC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxM1QxNDAyNTBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mMzRmYzNhNTkwOTQ4NWIwYTZiMWMzOGM2OGIxNDE2MTNlYWRjYWFkNGYyMTEwZDFmNTVmMWYwYTAxOWUxMmM4JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.t7rKAXUUaXWM91Ltu4wFExoLObuXY8ItJJpx2Jbr8MI)
To this:
Breaking changes:
Maybe
anyhow
was accidentally exposed somewhere?color-eyre
was not exposed anywhere thatanyhow
wasn't, so for library usage this is a breaking changeThe time format for local offsets doesn't cleanly continue and instead errors on unable to find local UtcOffset
Also, the default logging implementation used only logs to stderr, I don't know if there was some logic in the old implementation to send some logs to stdout and some to stderr, but its now all consistent to stderr
Checklist
Please make sure the PR adheres to this project's standards:
CHANGELOG.md
.cargo clippy
andcargo fmt
. The CI will fail otherwise anyway.