shuttle icon indicating copy to clipboard operation
shuttle copied to clipboard

check_lib_version can panic on deploy without informative message

Open kaleidawave opened this issue 1 year ago • 1 comments

The current method uses indexing to pull out the version of Cargo.toml. This can panic if the key is not present:

https://github.com/shuttle-hq/shuttle/blob/d4af3674de5f77477eda7febbbd7935add7f1672/cargo-shuttle/src/lib.rs#L257

If the Cargo.toml does not have a dependencies table or shuttle-service is not present then this expression panics. It would better to catch these and produce a readable error. Can use Document::get to do that.

The second question is whether shuttle-service = "0.4.0" is an error because there are no features specified. While adding this change should shuttle suggest that a feature needs to present?

I am happy to add this change ;)

kaleidawave avatar Jul 26 '22 11:07 kaleidawave

I think shuttle-service = "0.4.0" should be correct, because that's how I think a user implemented service would specify the shuttle_service dependency.

@kaleidawave sure, you can make the change :smile:

chesedo avatar Jul 27 '22 11:07 chesedo

We removed this check in 0.12, so closing this.

oddgrd avatar Mar 22 '23 12:03 oddgrd