bevy icon indicating copy to clipboard operation
bevy copied to clipboard

Check docs.rs metadata in CI

Open BD103 opened this issue 9 months ago • 4 comments

Objective

  • I have a list of unstable rustdoc features that I play to start enabling.
  • These features need to be enabled in the [package.metadata.docs.rs] table of all crates that use them, as well as in CI (see #13173 for related work).
  • CI can be used to ensure that these fields are consistent for all crates.

Solution

  • Create check_docsrs_metadata.sh, which verifies that all public crates have the correct metadata using cargo metadata.
  • Run this script in CI.
  • Make all crates scrape examples, to be consistent with the main bevy crate.
    • This isn't fantastic because most crates don't have their own examples, but I find this preferable over excluding the main bevy crate from checks.

Testing

  • Run ./tools/check_docsrs_metadata.sh locally. It should either pass or give an error message for all invalid crates.
  • The CI check should pass.

Further Questions

  • Should this check be always run, only run when Cargo.toml is modified (think dependencies.yml), or only in the merge queue?

Changelog

  • [package.metadata.docs.rs] for all public crates is now verified in CI.

BD103 avatar May 07 '24 17:05 BD103

We re trying to avoid shellscripts to be cross platform. Could you add it to the ci rust script?

mockersf avatar May 07 '24 17:05 mockersf

Example error output (source):

image

BD103 avatar May 07 '24 17:05 BD103

We re trying to avoid shellscripts to be cross platform. Could you add it to the ci rust script?

Not easily right now. Our current ci structure does not support running generic functions, but instead requires everything to be an xshell::Cmd. @Brezak and I are both working on improving this, but that's a few steps away.

When we do finish it, this will be one of the first things ported. (publish.sh is another potential candidate.)

BD103 avatar May 07 '24 17:05 BD103

Speaking of which: #13279.

BD103 avatar May 07 '24 23:05 BD103