Skip to content

Github CI and Cargo.lock get out of sync #2620

Open
@michael-kerscher

Description

The Github CI workflows use specific versions for mdbook tools that are different from what developers are using. E.g. mdbook is currently using 0.4.37:

run: cargo install mdbook --locked --version 0.4.37

but Cargo.lock would use 0.4.44 - this is regularly bumped via dependabot like in 010bd29

comprehensive-rust/Cargo.lock

Lines 1640 to 1641 in 4218c95

name = "mdbook"
version = "0.4.44"

and the developers are even instructed to use a completely different version that might not be one of those as it is not even locked (other tools are locked and might not be compatible with the "random" (most up-to-date) version of mdbook

cargo install mdbook
cargo install --locked mdbook-svgbob
cargo install --locked mdbook-i18n-helpers
cargo install --locked i18n-report
cargo install --locked mdbook-linkcheck
cargo install --locked --path mdbook-exerciser
cargo install --locked --path mdbook-course

We should use the same versions for developers and what the CI uses.

This is especially interesting for people developing javascript/theme code as mdbook generates/copies lots of files into the target folder if they are not overriden by us.

For example our book.js is copied but https://google.github.io/comprehensive-rust/css/general.css is not in our repository not existing general.css

Two options (second is my prefered proposal)

  • Keep manual overrides for the Github CI: Dev and CI are not in sync and might cause issues when someone changes the javascript code or relies on its functionality (when using mdbook serve - as in Incorrect behavior with mdbook serve compared to published version. #2588
  • Fix the instruction to install the --locked version of mdbook and use this version in the Github CI as well. Caveat: Dependabot updates need to be reviewed carefully and as we override some things (e.g. index.hbs) we need to carefully track updates to the official files with each update.
    • To make this update process reliable, write tests for the things we rely on in tests/src so things like missing theme buttons or search buttons are visible immediately.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions