shuttle
shuttle copied to clipboard
Add better error handling for shuttle-service version checking + compare version requirement rather than full version #283
Adds better error handling for when checking shuttle-service version to close #283. Removes potential for indexes to panic and adds detailed information for incorrect results.
I haven't tested this update yet. I also didn't quite know how to add testing for this feature sooo 😆
Hmm I guess I am not handling a Value::InlineTable
...
I think I instead need to be looking at parsing a manifest and using the dependency method on that instead of ad hoc dependency parsing as there is a lot of places the version could be in.
Will have a look later
Awesome looks like it is passing all the tests and can be merged! :)
I decided to use the existing toml_edit crate in the end as the cargo crate is quite integrated and getting dependency information requires linking with the filesystem and stuff that seemed unnecessary complicated.
Awesome, yes those changes are good. Have un-nested some of the functions and expanded out the tests a lot more. Now to see if they still pass 😬
Awesome have responded. Yes this is quite critical, don't want to start rejecting all builds because of a error with the version logic 😆. So should rigorous with the tests here
@kaleidawave we have some tests failing to compile :smile:
Ooof that was a silly error on my part. Is fixed now :)
@kaleidawave it seems there is a few extra failing tests in cargo-shuttle/src/lib.rs
:smile:
Ooof another silly error. Also after some local testing I realise Version
is a fully qualified version and that cargo dependencies specify a requirement instead (VersionReq
). So I think I will also add a fix that allows shuttle-service =
to be *
, 0.5
, 0.5.*
and so on to be compatible with the ones Cargo supports.
But VersionReq doesn't have order defined... When I have a bit more time next week I will do some reading on semver and write some custom matching logic
Most of this has been made out of date by #377. Closing for now, but we can open it again for the better error messages