fluvio icon indicating copy to clipboard operation
fluvio copied to clipboard

[CI] Convert crate publish readiness checks to Rust

Open tjtelan opened this issue 2 years ago • 3 comments

These tests together are pretty useful for ensuring release doesn't surprise use with crate version number related noise, but doesn't give enough feedback for new or external contributors.

  • https://github.com/infinyon/fluvio/blob/master/release-scripts/test-crate-version.sh
  • https://github.com/infinyon/fluvio/blob/master/release-scripts/check-publish-crates.sh

For context, my ideal solution is to use something like https://github.com/obi1kenobi/cargo-semver-check, since it provides feedback about what kind of version bump to perform.

After a (very) quick check, I did not find a single tool that handles the edge cases that we look for before during publishing.

Examples of changes

  • Valid, but trivial file changes, such as control flow logic, comments, whitespace, variable renames and no version change
  • Valid, but Cargo.toml only changes, like for updating dependencies and no version change

This conversion will help close the gap for the ability to contribute to a community-supported crate that will handle our edge cases.

tjtelan avatar Aug 25 '22 21:08 tjtelan

So, to be clear, this issue is only proposing to translate the functionality that currently exists in test-crate-version.sh and check-publish-crates.sh into Rust, not to add any additional functionality?

mfdorst avatar Aug 26 '22 06:08 mfdorst

I suppose this is a little open ended, as long as it improves the overall reliability of the automated release process. However, the minimum is to cover the example cases I mentioned, which the scripts currently addresses during CI.

These scripts are admittedly naive, so I'm open to solutions that aren't exact ports, as long as there's justification. If you have other ideas, I'm open to hearing you out.

Ideally, no one should need to think too hard about resolving these issues if they arise. I think this will be addressed by giving clear feedback to contributors.

tjtelan avatar Aug 27 '22 00:08 tjtelan

From what I can tell, test-crate-version.sh downloads https://static.crates.io/db-dump.tar.gz (a fairly large file) for the sole purpose of checking if the crate is published. There is a much faster way - just request https://crates.io/api/v1/crates/{crate_name}/versions and if it returns 404, the crate is not published. I'm using that in my rewrite unless there's some other reason to download the whole db-dump archive.

mfdorst avatar Aug 27 '22 19:08 mfdorst

Stale issue message

github-actions[bot] avatar Oct 27 '22 11:10 github-actions[bot]