Skip to content
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

Cache generated rustdoc for registry baselines #339

Merged
merged 3 commits into from
Feb 2, 2023

Conversation

thomaseizinger
Copy link
Contributor

@thomaseizinger thomaseizinger commented Feb 2, 2023

This implements the suggestion discussion in #214. It turned out surprisingly simple :)

@thomaseizinger
Copy link
Contributor Author

I've tested it locally on the rust-libp2p repository. It works after a cargo clean and cleans up after itself. A subsequent run detects the cached file and reuses it which speeds up things a fair bit.

@obi1kenobi obi1kenobi merged commit cc9e7db into obi1kenobi:main Feb 2, 2023
@obi1kenobi
Copy link
Owner

@thomaseizinger if I were to release 0.18 with this caching change soon, when would be the best time for you? I'd love to have you onboard to test it in "the real world" as soon as it comes out, in case something doesn't behave quite as well as we had hoped.

@thomaseizinger
Copy link
Contributor Author

@thomaseizinger if I were to release 0.18 with this caching change soon, when would be the best time for you? I'd love to have you onboard to test it in "the real world" as soon as it comes out, in case something doesn't behave quite as well as we had hoped.

We can test it as soon as there is a binary. Why don't we release 0.18.0-alpha and we use that in our CI for a bit?

@thomaseizinger
Copy link
Contributor Author

@thomaseizinger if I were to release 0.18 with this caching change soon, when would be the best time for you? I'd love to have you onboard to test it in "the real world" as soon as it comes out, in case something doesn't behave quite as well as we had hoped.

We can test it as soon as there is a binary. Why don't we release 0.18.0-alpha and we use that in our CI for a bit?

I am gonna be on NZ timezone for the next two weeks. With a pre-release, I can adjust our CI to create a cache on master and use that on PR workflow runs and play around what happens when we nuke the cache etc.

@tonowak
Copy link
Collaborator

tonowak commented Feb 2, 2023

@obi1kenobi it would be good to first merge #340 before creating the alpha release, since it touched some of this PR's code.

mergify bot pushed a commit to libp2p/rust-libp2p that referenced this pull request Feb 28, 2023
The latest release (v0.18) of `cargo semver-checks` includes a [feature](obi1kenobi/cargo-semver-checks#339) where the rustdoc JSON files for registry baselines is cached in `target/semver-checks/cache`. The rustdoc JSON files for released crates never changes as the source code on crates.io cannot be changed once a version is published. Thus, it is unnecessary to generate that JSON on every CI run.

We extract a separate action that installs `cargo semver-checks` for us and also sets up a cache. The cache is scoped to released version of the crate, meaning it automatically invalidates once we publish a new version.

This speeds up the `cargo semver-checks` step by 50% which is ~ 1 minute per job.

Pull-Request: #3469.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants