Repository navigation
Pin CI's actions and tools to fixed versions and add grouped, delayed Dependabot updates - #401
Conversation
ooloth/dotfiles#251 CI used actions/checkout, dtolnay/rust-toolchain and Swatinem/rust-cache by floating tag, so a moved tag could change what CI runs, and nothing proposed dependency updates beyond Dependabot's ungrouped security PRs. Each action is now pinned to the full commit SHA its tag points at today, so CI runs the same code as before. dtolnay/rust-toolchain picks the toolchain from its ref, so the pinned SHA comes from master's history, as its README requires, and the workflow passes `toolchain: stable` instead. .github/dependabot.yml covers cargo and github-actions. Version updates arrive monthly for releases at least 7 days old, with minor and patch updates grouped and majors as their own PRs. Security updates get their own group, because they ignore version-update groups and would otherwise open one PR per package. rust-toolchain.toml names the `stable` channel rather than a version, so it has no entry.
ooloth/dotfiles#251 The ci.yml comment said a pinned SHA meant a moved tag could not change what CI runs, but the stable toolchain and the tools cargo install fetches still follow their latest releases. The comment now says so, and dependabot.yml says those tools are outside what Dependabot sees. The dtolnay/rust-toolchain pin's comment named master. The same commit is also the v1 tag, and Dependabot reads a pin's trailing comment as the version it tracks, so the comment now names v1.
ooloth/dotfiles#251 ui/tui/Cargo.toml pins ratatui, tui-textarea, ansi-to-tui and itertools to versions that build together, and deny.toml rejects duplicate versions. With only the catch-all group, Dependabot would propose a major of one of them as its own PR, which cannot build alone, or put a breaking bump in the grouped PR and fail the whole group. A tui group now holds the four, for every update type, ahead of the catch-all, since Dependabot gives a dependency to the first group that matches.
ooloth/dotfiles#251 Dependabot edits the Cargo.toml files without running prek's hooks, and CI did not run taplo, so a PR could pass CI with TOML that fails just check. CI now installs taplo-cli with the other tools and runs taplo fmt --check and taplo check, as prek.toml does. CI also builds only the configuration without hub-private, so AGENTS.md now says a Dependabot PR is merged only after just check passes on its branch locally.
Decision 031 said CI checks every push, but ci.yml runs on pushes to main and on pull requests, so a pushed branch with no PR gets no CI. The record now names those two triggers, as the build invariant already does.
ooloth/dotfiles#251 hub-tui depended on tui-textarea, which no code used, and on itertools for one with_position() call in the vendored markdown renderer. Both pinned ratatui's neighbours to versions chosen for each other, so the Dependabot group meant to move the TUI crates together could never resolve: tui-textarea has no release for ratatui 0.30, and ratatui 0.30 needs itertools 0.14 while hub held 0.13. The renderer only asked whether a line came after the first, so it now uses enumerate() and i > 0. A new parametrized test pins how a fenced block's lines split (one line, two lines, a blank middle line). It passed against the old code and fails when the condition is broken. Run against the same 71 live signals, the old and new binaries drew identical detail panes. ratatui, crossterm and ansi-to-tui are now the only crates that must move together, and the manifest comments say why. The markdown README, the vendored headers and the Textual question file describe the renderer and the dependencies as they now are.
ooloth/dotfiles#251 The tui group listed itertools and tui-textarea, which hub no longer depends on, and left out crossterm, which must match ratatui's copy. It now holds ansi-to-tui, crossterm and ratatui. The header notes that Dependabot counts a 0.x minor bump as a major, as Cargo does. CI installed the toolchain with dtolnay/rust-toolchain, whose only release predates the cooldown and grouping, and compiled cargo-audit, cargo-deny, cargo-nextest and taplo-cli at their latest versions on every run. rustup, already on the runners, now installs the toolchain, and taiki-e/install-action installs prebuilt binaries at exact versions checked against its manifest's checksums. fallback: none makes a missing version fail instead of building. v2.87.32 and nextest 0.9.149 are the newest releases at least 7 days old. Dependabot does not read the tool versions, so they are bumped by hand. The workflow token is limited to reading the repository. The AGENTS.md merge rule now asks for just lint and just test with hub-private linked, since just check rewrites files and runs no tests, and the build invariant lists Dependabot's commits among the gaps its check misses.
ooloth/dotfiles#251 The rule asked for a checkout where just setup-private had linked hub-private. A device without the media module satisfies that but never builds the media configuration, so a dependency bump that breaks it could still be merged. The rule now asks for every module to be linked, and drops a reason for not using just check that was just as true of just lint.
ooloth/dotfiles#251 The invariant said a Dependabot PR is merged after the checks pass in a checkout with hub-private linked. AGENTS.md now asks for every hub-private module to be linked, so the invariant says the same.
ooloth/dotfiles#251 The security groups took every update type, so a security fix that needed a major would land in one PR with every other fix and could hold them all back. cargo-security and actions-security now take minor and patch only, and a security major opens on its own, as version-update majors already do.
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are blocking approval of the CI hardening and dependency-management changes.
No open issues 🎉
What changed in this PR
This PR hardens Hub’s CI dependency handling and introduces scheduled dependency updates, while removing two direct TUI dependencies.
Changes:
- Pins GitHub Actions to commits, restricts token permissions, installs versioned prebuilt tools, and adds TOML checks.
- Configures monthly Dependabot updates with a seven-day cooldown and separate groups for compatible updates, coupled TUI crates, and security updates.
- Removes
tui-textareaand directitertoolsusage, adds markdown regression tests, and documents private-module validation requirements.
| File | Description |
|---|---|
ui/tui/src/markdown/render.rs |
Replaces with_position() with enumerate() and adds multiline rendering tests. |
ui/tui/src/markdown/README.md |
Documents the renderer changes and corrects upstream comparison paths. |
ui/tui/src/markdown/mod.rs |
Adds a comment describing the iterator change. |
ui/tui/Cargo.toml |
Removes two dependencies and documents coupled TUI upgrades. |
docs/questions/should-the-tui-be-rebuilt-in-textual.md |
Updates the dependency comparison and compatibility notes. |
docs/invariants/hub-builds-with-and-without-each-private-module.md |
Records TOML checks and local Dependabot validation requirements. |
docs/decisions/031-hub-builds-and-tests-on-macos-and-linux.md |
Clarifies which pushes and pull requests trigger CI. |
Cargo.lock |
Removes tui-textarea and the TUI’s direct dependency entries. |
AGENTS.md |
Requires lint and tests with all private modules before merging Cargo updates. |
.github/workflows/ci.yml |
Hardens action execution, pins tools, and adds TOML validation. |
.github/dependabot.yml |
Adds monthly, delayed, grouped Cargo and GitHub Actions updates. |
Review effort: Balanced
ooloth/dotfiles#251 Security updates move only the vulnerable crate, so the tui group cannot bring ratatui along with a crossterm fix that needs a newer version than ratatui allows. That PR fails deny, cargo audit fails CI until the advisory is fixed, and the fix is the ratatui upgrade the tui group proposes. The tui group's comment now says so, and the header's sentence on security groups says plainly that they take minor and patch updates and leave a major to its own PR.
Verified after mergeMerged as 5c7dec4. This PR closes no issue, so the report is here. Nothing in hub deploys, so there was no rollout to watch. Claim
1. CI on the merge commit: proven
2. Dependabot reads the config: proven Both "Dependabot Updates" runs on the merge commit (42036741691, 42036741813) succeeded, and they opened these PRs within two minutes:
That is five open Cargo PRs, the configured limit. Each update PR is judged on its own: at the time of this check, CI failed 3. SHA pinning required: proven for CI
Not observed CodeQL and Dependabot Updates run as GitHub-managed workflows, which cannot be rerun on demand, so neither has run yet with the setting on. Their next scheduled or push-triggered run shows whether the setting affects them. |
✅ What
.github/dependabot.ymlproposes updates for the Cargo dependencies and the actions once a monthactions/checkoutv4.4.0,Swatinem/rust-cachev2.9.3 andtaiki-e/install-actionv2.87.32. The Rust toolchain is installed withrustup, which the runners already have, instead of a third-party actioncargo-audit0.22.2,cargo-deny0.20.2,cargo-nextest0.9.149 andtaplo0.10.0 arrive as prebuilt binaries checked against checksums, instead of being compiled at their latest versions on every run. Dependabot can't see these versions, so they are bumped by handtaplo fmt --checkandtaplo check, because Dependabot edits theCargo.tomlfiles without running the local hooks0.xcrate, a bump such as 0.28 to 0.29 counts as a major. Security updates get their own group on the same termsratatui,crosstermandansi-to-tuionly build at matching versions, so they get a group of their own, majors included. To make that group possible,ui/tuidropstui-textarea, which nothing used, and its directitertoolsdependency, whose one call is replaced withenumerate(). The TUI shows the same thing as beforeAGENTS.mdsays a Dependabot PR that changesCargo.tomlorCargo.lockis merged only afterjust lintandjust testpass in a checkout with every hub-private module linked, and the build invariant lists Dependabot's commits among the things its check missesmainand on pull requests, which is whatci.ymldoes🤔 Why
@v4or a "latest" install can change under hub without any commit in hub, so whoever controls an action or a tool's release could change what runs in hub's CI. A commit hash or an exact version can't move👩🔬 How to validate
git fetch origin && git switch dependabot-baselinegrep -n "uses:" .github/workflows/ci.ymlgit ls-remote https://github.com/actions/checkout refs/tags/v4.4.0; git ls-remote https://github.com/Swatinem/rust-cache 'refs/tags/v2.9.3*'; git ls-remote https://github.com/taiki-e/install-action refs/tags/v2.87.32ci.yml.rust-cacheprints two lines because its tag is annotated: the pinned hash is on the line ending^{}uvx check-jsonschema --builtin-schema vendor.dependabot .github/dependabot.ymlok -- validation donecargo tree -p hub-tui --depth 1 | grep -E "itertools|tui-textarea|ratatui|crossterm|ansi-to-tui"ansi-to-tui,crosstermandratatui, and neitheritertoolsnortui-textareajust tui, then select an issue whose body has a code block and press Enter🔖 Related links