Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,33 @@ permissions:
jobs:
rust:
runs-on: ubuntu-latest
env:
CARGO_VET_VERSION: 0.10.3
CARGO_VET_SHA256: e83878b80913fbe43629c28768e14ab51f4e86a4ba8f9dd08cc25b8dbc503c19
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- name: Install Rust
run: rustup toolchain install stable --profile minimal --component clippy,rustfmt
- name: Install cargo-vet
run: |
set -euo pipefail
archive="${RUNNER_TEMP}/cargo-vet.tar.xz"
release="cargo-vet-x86_64-unknown-linux-gnu"
curl \
--fail \
--location \
--proto '=https' \
--retry 3 \
--tlsv1.2 \
--output "${archive}" \
"https://github.com/mozilla/cargo-vet/releases/download/v${CARGO_VET_VERSION}/${release}.tar.xz"
echo "${CARGO_VET_SHA256} ${archive}" | sha256sum --check -
tar --extract --xz --file "${archive}" --directory "${RUNNER_TEMP}"
install -m 0755 "${RUNNER_TEMP}/${release}/cargo-vet" "${HOME}/.cargo/bin/cargo-vet"
- name: Verify dependency audit coverage
run: cargo vet --locked
- name: Check formatting
run: cargo fmt --check
- name: Clippy
Expand Down
23 changes: 23 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,36 @@ Run the same checks used by CI before opening a pull request:
cargo fmt --check
cargo clippy --all-targets -- -D warnings
cargo test --locked
cargo vet --locked
git diff --check
```

For documentation-only changes, `git diff --check` is normally sufficient.
Also run the relevant config tests when examples change. For workflow changes,
run `actionlint` when it is available locally.

### Dependency vetting

The `supply-chain` directory is the committed cargo-vet policy. CI uses the
checksummed cargo-vet 0.10.3 release and runs `cargo vet --locked`, so a
dependency update must be covered by a local or imported audit, or by an
explicit exemption.

After changing `Cargo.lock`, run `cargo vet` to see the missing coverage.
Prefer a reviewed audit or an established peer import. When an audit is not yet
practical, `cargo vet regenerate exemptions` records the minimal current
baseline; review that diff as a security decision before committing it.

Refresh peer audit data deliberately with:

```bash
cargo vet regenerate imports
cargo vet --locked
```

Commit `supply-chain/imports.lock` with the reviewed refresh. Initial
exemptions are bootstrap debt and should shrink as audits become available.

Container changes should also keep this passing:

```bash
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1088,8 +1088,14 @@ it through the unit's `Restart=on-failure` policy.
cargo fmt --check
cargo test --locked
cargo clippy --all-targets -- -D warnings
cargo vet --locked
```

The committed `supply-chain` policy makes dependency review coverage part of
the pull-request gate. See [CONTRIBUTING.md](CONTRIBUTING.md) for how to update
the cargo-vet imports or deliberately record a new exemption when the locked
dependency graph changes.

Black-box tests also exercise the compiled production process and container over
real HTTP/HTTPS sockets. Run the binary suite with:

Expand Down
4 changes: 4 additions & 0 deletions supply-chain/audits.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

# cargo-vet audits file

[audits]
Loading