Skip to content

Add the pull-request check named dependencies, with a committed lockfile and a locked restore #19

Description

@iderex

A dependency graph that resolves freshly on every build is a graph that can
change between a contributor's machine and the gate, and between two gate runs an
hour apart. The repository already runs GitHub's dependency review on pull
requests, which reads the diff against the advisory database. That is a different
question from whether the graph the build actually resolved is the graph that was
committed.

What the check does

Restores in locked mode, so a restore that would rewrite the committed lockfile
fails rather than proceeding quietly.

Scans the resolved graph for known vulnerabilities and fails on a match. The step
uses set -o pipefail where its verdict comes through a pipe, because the
default shell for a bare run: is bash -e without it, and a gate whose exit
status is the last command in a pipe is a gate that passes on everything.

Reports what it examined, including the number of packages, so a scan that
resolved nothing cannot read as a scan that found nothing.

Done when

A workflow exists whose check-run name is exactly dependencies, a
deliberately drifted lockfile fails it, a fixture with a known-vulnerable
dependency fails it, and the lockfile is committed and covered by the build.
Blocked on #11, and on #103 for what is allowed into the graph this check
reads, since a check with no rule behind it can only report the advisories
somebody else published.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions