Skip to content

Pin CI's actions and tools to fixed versions and add grouped, delayed Dependabot updates - #401

Merged
ooloth merged 12 commits into
mainfrom
dependabot-baseline
Nov 5, 2026
Merged

ooloth merged 12 commits into
mainfrom
dependabot-baseline

Conversation

@ooloth

@ooloth ooloth commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

✅ What

  • CI now runs every third-party action and tool at a version fixed in the repo, and a new .github/dependabot.yml proposes updates for the Cargo dependencies and the actions once a month
  • Each action is pinned to a full commit hash: actions/checkout v4.4.0, Swatinem/rust-cache v2.9.3 and taiki-e/install-action v2.87.32. The Rust toolchain is installed with rustup, which the runners already have, instead of a third-party action
  • cargo-audit 0.22.2, cargo-deny 0.20.2, cargo-nextest 0.9.149 and taplo 0.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 hand
  • CI's token can only read the repository, and CI now runs taplo fmt --check and taplo check, because Dependabot edits the Cargo.toml files without running the local hooks
  • Dependabot waits until a release is 7 days old, groups minor and patch updates into one PR per ecosystem, and opens majors as their own PRs. For a 0.x crate, a bump such as 0.28 to 0.29 counts as a major. Security updates get their own group on the same terms
  • ratatui, crossterm and ansi-to-tui only build at matching versions, so they get a group of their own, majors included. To make that group possible, ui/tui drops tui-textarea, which nothing used, and its direct itertools dependency, whose one call is replaced with enumerate(). The TUI shows the same thing as before
  • AGENTS.md says a Dependabot PR that changes Cargo.toml or Cargo.lock is merged only after just lint and just test pass in a checkout with every hub-private module linked, and the build invariant lists Dependabot's commits among the things its check misses
  • Decision 031 now says CI runs on pushes to main and on pull requests, which is what ci.yml does

🤔 Why

  • A tag such as @v4 or 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
  • Until now hub got no update PRs except one-per-package security PRs, so dependencies only moved when someone remembered to move them
  • The 7-day wait gives a compromised release time to be found and pulled before Dependabot proposes it
  • Dependabot over Renovate: it is built into GitHub and needs no third-party app with write access to the repo. The reasoning is in the linked issue
  • Public CI can't build hub-private, which is why a Dependabot PR still needs the local run before it merges

👩‍🔬 How to validate

  • git fetch origin && git switch dependabot-baseline
  • grep -n "uses:" .github/workflows/ci.yml
  • Expect to see three actions, each followed by a 40-character commit hash and a comment naming its version
  • git 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.32
  • Expect each hash to match the one pinned in ci.yml. rust-cache prints two lines because its tag is annotated: the pinned hash is on the line ending ^{}
  • uvx check-jsonschema --builtin-schema vendor.dependabot .github/dependabot.yml
  • Expect to see ok -- validation done
  • cargo tree -p hub-tui --depth 1 | grep -E "itertools|tui-textarea|ratatui|crossterm|ansi-to-tui"
  • Expect to see ansi-to-tui, crossterm and ratatui, and neither itertools nor tui-textarea
  • just tui, then select an issue whose body has a code block and press Enter
  • Expect the code block in the detail pane to show one line per source line, with no extra blank lines

🔖 Related links

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.
@ooloth
ooloth marked this pull request as ready for review November 5, 2026 12:12
Copilot AI balanced review requested due to automatic review settings November 5, 2026 12:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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-textarea and direct itertools usage, 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.
Copilot AI balanced review requested due to automatic review settings November 5, 2026 12:19
@ooloth ooloth changed the title Pin CI's actions by commit and add grouped, delayed Dependabot updates Pin CI's actions and tools to fixed versions and add grouped, delayed Dependabot updates Nov 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the CI hardening and dependency-management changes.

No open issues 🎉

Review effort: Balanced

@ooloth
ooloth merged commit 5c7dec4 into main Nov 5, 2026
7 checks passed
@ooloth
ooloth deleted the dependabot-baseline branch November 5, 2026 13:32
@ooloth

ooloth commented Nov 5, 2026

Copy link
Copy Markdown
Owner Author

Verified after merge

Merged 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 passes on the merge commit on both platforms (from the PR's own checks)
  2. Dependabot accepts .github/dependabot.yml and opens PRs in the groups it describes (from the PR's description)
  3. With the repository setting that requires actions pinned to a full-length commit SHA turned on, CI still passes (from the plan agreed for this merge)

1. CI on the merge commit: proven

  • CI run 42036732167, attempt 1: check (macos-latest) success, check (ubuntu-latest) success
  • CodeQL run 42036732169: Analyze (actions) success, Analyze (rust) success

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 deny on #407 and #408 and clippy on #409, and #404 and #405 passed.

3. SHA pinning required: proven for CI

  • GET repos/ooloth/hub/actions/permissions before: "sha_pinning_required":false; after the change: "sha_pinning_required":true
  • CI run 42036732167 was rerun after the change. Attempt 2: check (ubuntu-latest) success, check (macos-latest) success

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.

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.

2 participants