Skip to content

feat(security): mark image rebuilds that fix OS advisories - #76

Merged
sweepies merged 2 commits into
mainfrom
feat/image-advisories
Oct 30, 2026
Merged

sweepies merged 2 commits into
mainfrom
feat/image-advisories

Conversation

@sweepies

@sweepies sweepies commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

When a pinned image's digest is replaced, the Count now compares the OS packages in the old and new digests' SBOMs through OSV.dev. If OSV reports an advisory for the old image and not for the new one, the update is marked as a security fix. When the Count can't tell, the PR and the dashboard say so. Revision 3 of the design was approved; this PR builds it and turns the design into an internals page.

Reading SBOMs (crates/datasource/src/images.rs). The Count reads by digest, anonymously:

  • the BuildKit attestation in the image index;
  • otherwise a cosign sha256-<digest>.att, whose in-toto subject must match the digest, or .sbom, trying the platform digest before the index digest.

Every manifest and blob is checked against its SHA-256. Docker official images are read from mirror.gcr.io first, with Docker Hub as the fallback. The SBOM blob is reduced once to the generator, the distro and the source packages (sbom-os-v1); file entries are never stored.

Source packages. A binary package that is GENERATED_FROM a Docker Scout source entry is covered by that entry. syft's upstream qualifier names the source. When neither is present, the package is queried under its own name. The kernel source linux is left out. Debian, Ubuntu, Alpine, Wolfi and Chainguard are covered. RPM distributions are reported as os-not-covered in this PR, because their source-RPM versions haven't been measured against OSV yet.

Outcomes. The states are checked, partial-sources, no-os-packages, no-sbom, sbom-without-os, previous-unavailable, os-not-covered and unreadable; the worst platform decides. A fix:

  • sets fixes;
  • applies security.apply and security.label;
  • adds [security] to the commit;
  • leads the PR with an advisory table (old version, new version or "removed", platforms) for the five most severe fixes, then the rest as linked IDs with a count; what the rebuild "also brings in" is listed the same way.

Only an OSV match can set the security mark. A test pins this with image annotations that claim a security fix.

Which records are read. Which advisories a rebuild leaves behind comes from the IDs in OSV's batch answer. Only a record the Count has read in full, and that isn't withdrawn, marks the rebuild as a security fix. He reads the records for the five most severe advisories each image update fixes and the five most severe it brings in. If every fix he reads turns out to be withdrawn, he reads the next five in rank order, and keeps going until one holds or none are left; if none hold, the rebuild is not a security fix. A withdrawn record takes its ID out of the comparison. The remaining IDs stay in the list and the count, as links "listed by OSV". The PR says that only the rows in its table were read. OSV's batch answer carries no severity, so "most severe" is judged from the ID: a distro's own notice (DSA, DLA, USN and the like) ranks above a per-CVE tracker entry such as DEBIAN-CVE-…, and a newer number ranks above an older one. The full records of these OS advisories rarely carry a severity anyway: none of the records read in the earlier measurement had one. Engine tests cover three cases: one withdrawn record among the five read, the first five all withdrawn with the next one holding, and every fix withdrawn, which gives no label and no fix.

Report, PR and dashboard.

  • The report gains Update.image and metadata.image, both optional, so the schema version is unchanged.
  • PR bodies get one callout per kind, with one line per image.
  • A new dashboard section, "Images the Count can't vouch for", follows Known vulnerabilities.
  • security.images, security.imagePlatforms and security.quietImages (pattern to required reason) are new config fields. Silenced images still appear on the dashboard, under "Silenced".

HTTP cache and fixtures.

  • Registry manifests and blobs addressed by digest are kept as immutable, even when a registry sends no-store, as quay.io does.
  • A registry 404 for a digest or a cosign tag is kept for a day.
  • The recorder keeps a body byte for byte when its SHA-256 is a digest it was asked for, and the redactor no longer rewrites URLs it has nothing to redact in. Both keep recorded SBOMs digest-valid.

Platforms. security.imagePlatforms defaults to linux/amd64 alone; users add linux/arm64 or others in config. An image with none of the listed platforms (an arm64-only build, say) is compared on the first platform its index lists, skipping attestation entries, on both digests. The engine test for the OSV-only mark now runs on the default config with one amd64 and one arm64-only image, and checks which platform each was compared on.

Cost. Measured on five pinned images (debian:bookworm, ubuntu:24.04 and alpine:3.20 at older digests, node:22.11.0-bookworm-slim, and a quay.io image whose old digest is gone), with a cold cache. The first three rows compared linux/amd64 and linux/arm64, the old default:

First run, check on Requests Wall time
Reading every record (before) 522, 521 8.0 s, 9.9 s
Five most severe per side 207, 207 6.2 s, 6.7 s
Re-run on this head, both platforms set in config 207, 207, 208 7.0 s, 7.0 s, 6.4 s
This PR, default linux/amd64 only 165, 165, 165 5.8 s, 5.9 s, 5.4 s
Check off, for reference 76 2.6 s
Warm run, either platform setting 16 1.2 s

Dropping arm64 saves 42 cold requests (its manifest, attestation, SBOM and cosign reads) and about a second. On these five images every count is the same on amd64 alone as on both platforms: debian 71, ubuntu 166/173/205, alpine 29, node 78. OSV has added one Ubuntu advisory since the earlier rows, which read 172/204. The measurement predates the read-on step, which costs more only when all five records read for a rebuild are withdrawn. On the earlier two-platform run, of the 131 cold requests the check added, about 20 are OSV records, at most ten per image update. The rest are 85 digest and cosign reads, 24 redirected blob downloads and one OSV batch, and all but the batch are cached after the first run. Most of the remaining cold time goes on downloading SBOM blobs (an Ubuntu SBOM is 2.4 MB, a Debian one 4.8 MB).

Warm, the extra requests are one OSV batch (about 0.8 s) and three quay.io cosign HEADs. I removed two warm costs before opening this PR: quay's digest manifests were re-read on every run, and missing cosign tags were re-checked on every run. The tests corpus has no pinned images the Count extracts, so its cost is unchanged.

Not in this PR:

  • An image fix inside a tag update that is held back by its release-age wait doesn't skip that wait.
  • There is no fallback to the signed package index.
  • Tooling warnings come in the follow-up PR.

Rebased onto the hard fork (#77): the conformance changes are gone, and the one departure entry, image rebuild advisories, uses the new short format. The compatibility table, the guide pages (security, dashboard, pull-requests), the configuration and report references, and the new internals page are updated.

Open in Capy

@deepsource-io

deepsource-io Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in 2b5240b...468f9cd on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

Important

Some issues found as part of this review are outside of the diff in this pull request and aren't shown in the inline review comments due to GitHub's API limitations. You can see those issues on the DeepSource dashboard.

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
Rust Oct 30, 2026 5:21p.m. Review ↗
JavaScript Oct 30, 2026 5:21p.m. Review ↗
Shell Oct 30, 2026 5:21p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.


/// A registry read whose blob body is derived by "derived" instead of
/// the default source-label compaction.
pub(crate) async fn registry_with(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

`fn registry_with` has a cyclomatic complexity of 46 with "very-high" risk


A function with high cyclomatic complexity can be hard to understand and
maintain. Cyclomatic complexity is a software metric that measures the number of
independent paths through a function. A higher cyclomatic complexity indicates
that the function has more decision points and is more complex.

self.read_sbom(&host, &path, digest, platform).await
}

async fn read_sbom(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

`fn read_sbom` has a cyclomatic complexity of 40 with "very-high" risk


A function with high cyclomatic complexity can be hard to understand and
maintain. Cyclomatic complexity is a software metric that measures the number of
independent paths through a function. A higher cyclomatic complexity indicates
that the function has more decision points and is more complex.

Comment thread crates/engine/src/lib.rs
.map(|(_, reason)| reason.clone());
let silence = |mut check: patchula_report::ImageCheck| {
if patchula_lookup::images::warns(&check.state) {
check.silenced = silenced.clone();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Calling `.clone()` for assignment to variable


Consider using .clone_from() instead of assigning the result of .clone().

clone_from() may perform better in some cases because some structs may have custom implementations of clone_from(), which improve performance by avoiding needless allocations.

method: "GET".into(),
url: format!("https://ghcr.io/v2/{repository}/{path}"),
headers: BTreeMap::from([("accept".into(), vec![accept.into()])]),
body: Body::Text(String::new()),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Empty call to `new()`


The new() function is used to initialise an object with specific data.
If no arguments are passed, the behaviour is identical to default().

"GET",
&format!("https://ghcr.io/v2/{repository}/tags/list?n=1000"),
&[("accept", "application/json")],
Body::Text(String::new()),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Empty call to `new()`


The new() function is used to initialise an object with specific data.
If no arguments are passed, the behaviour is identical to default().

let github = patchula_github::Client::with_transport(
"offline",
cache.clone(),
Default::default(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Prefer using `T::default`, over trait function `Default::default()`


Calls to Default::default() are less readable than T::default().
Using the name of the type makes it easier for the reader to discern which type is being used.

fn advisory(id: &str) -> Arc<Advisory> {
Arc::new(Advisory {
id: id.into(),
modified: String::new(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Empty call to `new()`


The new() function is used to initialise an object with specific data.
If no arguments are passed, the behaviour is identical to default().

"{image} is built on {}, and OSV.dev has no advisories for it.",
cell(check.os.as_deref().unwrap_or("an OS"))
),
_ => String::new(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Empty call to `new()`


The new() function is used to initialise an object with specific data.
If no arguments are passed, the behaviour is identical to default().

"The Count couldn't read {image}'s SBOM on this run ({}). He'll try again on the next run.",
cell(check.detail.as_deref().unwrap_or("no answer"))
),
_ if !check.fixed.is_empty() => String::new(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Empty call to `new()`


The new() function is used to initialise an object with specific data.
If no arguments are passed, the behaviour is identical to default().

));
}
}
let mut text = String::new();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Empty call to `new()`


The new() function is used to initialise an object with specific data.
If no arguments are passed, the behaviour is identical to default().

@context7

context7 Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Docs7 for sweepies/count-patchula

Result Status Action
Deployment ➖ Not used —
Content review ➖ Did not run. This site has no agent runs available this month. Wait for the monthly reset or check your Docs7 plan. —

Commit 468f9cd

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
count-patchula 468f9cd Commit Preview URL

Branch Preview URL
Oct 30 2026, 05:21 PM

@capy-ai

capy-ai Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Triaged DeepSource's 21 inline findings. All are minor style or antipattern notes: T::default over Default::default(), an empty new(), a .clone() in an assignment, and the cyclomatic complexity of read_sbom and of the existing registry auth path, which this PR only renamed to registry_with. None of them changes behaviour, and per the repo's review rules they don't block, so I'm leaving them as they are.

@sweepies
sweepies force-pushed the feat/image-advisories branch from fb84a38 to 3501938 Compare October 29, 2026 23:41
Comment thread crates/engine/src/lib.rs
Ok::<_, patchula_datasource::Error>((listing, found))
};
let ((image_listing, image_found), osv_failure) = if image_queries.is_empty() {
(Default::default(), None)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Prefer using `T::default`, over trait function `Default::default()`


Calls to Default::default() are less readable than T::default().
Using the name of the type makes it easier for the reader to discern which type is being used.

Comment thread crates/engine/src/lib.rs
} else {
match read.await {
Ok(read) => (read, None),
Err(error) => (Default::default(), Some(format!("OSV.dev failed: {error}"))),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Prefer using `T::default`, over trait function `Default::default()`


Calls to Default::default() are less readable than T::default().
Using the name of the type makes it easier for the reader to discern which type is being used.

Comment thread crates/engine/src/lib.rs
.map(|(_, reason)| reason.clone());
let silence = |mut check: patchula_report::ImageCheck| {
if patchula_lookup::images::warns(&check.state) {
check.silenced = silenced.clone();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Calling `.clone()` for assignment to variable


Consider using .clone_from() instead of assigning the result of .clone().

clone_from() may perform better in some cases because some structs may have custom implementations of clone_from(), which improve performance by avoiding needless allocations.

"GET",
"https://ghcr.io/v2/spec/many/tags/list?n=1000",
&[("accept", "application/json")],
Body::Text(String::new()),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Empty call to `new()`


The new() function is used to initialise an object with specific data.
If no arguments are passed, the behaviour is identical to default().

"accept",
"application/vnd.oci.image.index.v1+json, application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.oci.image.manifest.v1+json, application/vnd.docker.distribution.manifest.v2+json",
)],
Body::Text(String::new()),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Empty call to `new()`


The new() function is used to initialise an object with specific data.
If no arguments are passed, the behaviour is identical to default().

fn advisory(id: &str) -> Arc<Advisory> {
Arc::new(Advisory {
id: id.into(),
modified: String::new(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Empty call to `new()`


The new() function is used to initialise an object with specific data.
If no arguments are passed, the behaviour is identical to default().

/// What the Count found comparing each rebuilt image's old and new SBOMs:
/// the advisories fixed, then one line per image he can't vouch for, then
/// plain notes.
fn image_section(changes: &[crate::Change]) -> String {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

`fn image_section` has a cyclomatic complexity of 32 with "very-high" risk


A function with high cyclomatic complexity can be hard to understand and
maintain. Cyclomatic complexity is a software metric that measures the number of
independent paths through a function. A higher cyclomatic complexity indicates
that the function has more decision points and is more complex.

"{image} is built on {}, and OSV.dev has no advisories for it.",
cell(check.os.as_deref().unwrap_or("an OS"))
),
_ => String::new(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Empty call to `new()`


The new() function is used to initialise an object with specific data.
If no arguments are passed, the behaviour is identical to default().

"The Count couldn't read {image}'s SBOM on this run ({}). He'll try again on the next run.",
cell(check.detail.as_deref().unwrap_or("no answer"))
),
_ if !check.fixed.is_empty() => String::new(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Empty call to `new()`


The new() function is used to initialise an object with specific data.
If no arguments are passed, the behaviour is identical to default().

));
}
}
let mut text = String::new();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Empty call to `new()`


The new() function is used to initialise an object with specific data.
If no arguments are passed, the behaviour is identical to default().

Comment thread crates/engine/src/lib.rs
Ok::<_, patchula_datasource::Error>((listing, found))
};
let ((image_listing, image_found), osv_failure) = if image_queries.is_empty() {
(Default::default(), None)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Prefer using `T::default`, over trait function `Default::default()`


Calls to Default::default() are less readable than T::default().
Using the name of the type makes it easier for the reader to discern which type is being used.

Comment thread crates/engine/src/lib.rs
} else {
match read.await {
Ok(read) => (read, None),
Err(error) => (Default::default(), Some(format!("OSV.dev failed: {error}"))),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Prefer using `T::default`, over trait function `Default::default()`


Calls to Default::default() are less readable than T::default().
Using the name of the type makes it easier for the reader to discern which type is being used.

Comment thread crates/engine/src/lib.rs
.map(|(_, reason)| reason.clone());
let silence = |mut check: patchula_report::ImageCheck| {
if patchula_lookup::images::warns(&check.state) {
check.silenced = silenced.clone();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Calling `.clone()` for assignment to variable


Consider using .clone_from() instead of assigning the result of .clone().

clone_from() may perform better in some cases because some structs may have custom implementations of clone_from(), which improve performance by avoiding needless allocations.

"GET",
"https://ghcr.io/v2/spec/many/tags/list?n=1000",
&[("accept", "application/json")],
Body::Text(String::new()),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Empty call to `new()`


The new() function is used to initialise an object with specific data.
If no arguments are passed, the behaviour is identical to default().

"accept",
"application/vnd.oci.image.index.v1+json, application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.oci.image.manifest.v1+json, application/vnd.docker.distribution.manifest.v2+json",
)],
Body::Text(String::new()),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Empty call to `new()`


The new() function is used to initialise an object with specific data.
If no arguments are passed, the behaviour is identical to default().

Value::Null,
None,
);
head.response.body = Body::Text(String::new());

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Empty call to `new()`


The new() function is used to initialise an object with specific data.
If no arguments are passed, the behaviour is identical to default().

.into(),
interactions,
};
patchula_testkit::save(&path, &cassette, &Default::default()).unwrap();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Prefer using `T::default`, over trait function `Default::default()`


Calls to Default::default() are less readable than T::default().
Using the name of the type makes it easier for the reader to discern which type is being used.

interactions,
};
patchula_testkit::save(&path, &cassette, &Default::default()).unwrap();
let replay = Arc::new(Replay::open(&path, Default::default()).unwrap());

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Prefer using `T::default`, over trait function `Default::default()`


Calls to Default::default() are less readable than T::default().
Using the name of the type makes it easier for the reader to discern which type is being used.

};
patchula_testkit::save(&path, &cassette, &Default::default()).unwrap();
let replay = Arc::new(Replay::open(&path, Default::default()).unwrap());
let cache = Cache::open(dir.path().join("cache.sqlite"), Default::default())

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Prefer using `T::default`, over trait function `Default::default()`


Calls to Default::default() are less readable than T::default().
Using the name of the type makes it easier for the reader to discern which type is being used.

When a pinned image's digest is replaced, read the SBOMs of the old and new
digests (BuildKit attestation, or cosign .att/.sbom), ask OSV.dev about the
OS source packages each lists, and mark the update as a security fix only for
an advisory OSV reports for the old image and not the new one. PRs and the
dashboard say when the Count can't tell. Docker official images are read from
mirror.gcr.io first, with Docker Hub as the fallback.

Which advisories a rebuild leaves behind comes from the IDs in OSV's batch
answer, but only a record the Count has read and that isn't withdrawn marks it
a security fix. Records are read for the five most severe advisories each
rebuild fixes and the five most severe it brings in, ranked from the ID since
the batch carries no severity; when every fix read is withdrawn, the next ones
are read in rank order until one holds. The PR lists the rest as links "listed
by OSV", with a count.

Images are compared on linux/amd64 by default; security.imagePlatforms adds
more. An image with none of the listed platforms is compared on the first
platform its index lists.

Digest-addressed registry reads are cached as immutable, and 404s for digests
and cosign tags are kept for a day.
@sweepies
sweepies force-pushed the feat/image-advisories branch from 18a6bc3 to c1d8463 Compare October 30, 2026 15:48
self.read_sbom(&host, &path, digest, platform).await
}

async fn read_sbom(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

`fn read_sbom` has a cyclomatic complexity of 43 with "very-high" risk


A function with high cyclomatic complexity can be hard to understand and
maintain. Cyclomatic complexity is a software metric that measures the number of
independent paths through a function. A higher cyclomatic complexity indicates
that the function has more decision points and is more complex.

Comment thread crates/engine/src/lib.rs
Ok::<_, patchula_datasource::Error>((listing, found))
};
let ((image_listing, image_found), osv_failure) = if image_queries.is_empty() {
(Default::default(), None)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Prefer using `T::default`, over trait function `Default::default()`


Calls to Default::default() are less readable than T::default().
Using the name of the type makes it easier for the reader to discern which type is being used.

Comment thread crates/engine/src/lib.rs
} else {
match read.await {
Ok(read) => (read, None),
Err(error) => (Default::default(), Some(format!("OSV.dev failed: {error}"))),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Prefer using `T::default`, over trait function `Default::default()`


Calls to Default::default() are less readable than T::default().
Using the name of the type makes it easier for the reader to discern which type is being used.

Comment thread crates/engine/src/lib.rs
.map(|(_, reason)| reason.clone());
let silence = |mut check: patchula_report::ImageCheck| {
if patchula_lookup::images::warns(&check.state) {
check.silenced = silenced.clone();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Calling `.clone()` for assignment to variable


Consider using .clone_from() instead of assigning the result of .clone().

clone_from() may perform better in some cases because some structs may have custom implementations of clone_from(), which improve performance by avoiding needless allocations.

method: "GET".into(),
url: format!("https://ghcr.io/v2/{repository}/{path}"),
headers: BTreeMap::from([("accept".into(), vec![accept.into()])]),
body: Body::Text(String::new()),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Empty call to `new()`


The new() function is used to initialise an object with specific data.
If no arguments are passed, the behaviour is identical to default().

Value::Null,
None,
);
head.response.body = Body::Text(String::new());

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Empty call to `new()`


The new() function is used to initialise an object with specific data.
If no arguments are passed, the behaviour is identical to default().

.into(),
interactions,
};
patchula_testkit::save(&path, &cassette, &Default::default()).unwrap();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Prefer using `T::default`, over trait function `Default::default()`


Calls to Default::default() are less readable than T::default().
Using the name of the type makes it easier for the reader to discern which type is being used.

interactions,
};
patchula_testkit::save(&path, &cassette, &Default::default()).unwrap();
let replay = Arc::new(Replay::open(&path, Default::default()).unwrap());

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Prefer using `T::default`, over trait function `Default::default()`


Calls to Default::default() are less readable than T::default().
Using the name of the type makes it easier for the reader to discern which type is being used.

};
patchula_testkit::save(&path, &cassette, &Default::default()).unwrap();
let replay = Arc::new(Replay::open(&path, Default::default()).unwrap());
let cache = Cache::open(dir.path().join("cache.sqlite"), Default::default())

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Prefer using `T::default`, over trait function `Default::default()`


Calls to Default::default() are less readable than T::default().
Using the name of the type makes it easier for the reader to discern which type is being used.

fn advisory(id: &str) -> Arc<Advisory> {
Arc::new(Advisory {
id: id.into(),
modified: String::new(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Empty call to `new()`


The new() function is used to initialise an object with specific data.
If no arguments are passed, the behaviour is identical to default().

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 36 files

Tip: Get a Slack DM when cubic finishes reviewing your PRs. Connect Slack

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread crates/datasource/src/images.rs Resolved
Comment thread crates/http/src/cached.rs Resolved
Comment thread crates/report/src/lib.rs Resolved
Comment thread crates/update/tests/dashboard.rs Resolved
Comment thread docs/src/content/docs/guide/security.md Resolved
- Report schema is now 3: v2 shipped, and the new `image` fields would break
  strict v2 readers.
- A single-image manifest is matched to the platform its config names, an
  image's attestations are all tried, and a cosign tag manifest is read only
  by a verified digest.
- Digest-addressed 404s keep their one-day expiry instead of the ten-year
  floor, and a read made with a Docker Hub account token follows the
  registry's no-store.
- Image rebuilds honour the `active`, `digest` and `permitted` gates of
  `security.apply` like a package fix, and an advisory OSV lists for several
  source packages is a fix for each.
- Replacements are ranked on their own repository's platforms, batched image
  updates keep their SBOM comparison, and introduced advisories show without
  fixes.
- `security.imagePlatforms` may not be empty while `images` is on.
- The recorder's redactor leaves unchanged URLs alone however they serialize.
- Dashboard rows name the pinned digest; generator names can't break out of
  their code span.
self.read_sbom(&host, &path, digest, platform).await
}

async fn read_sbom(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

`fn read_sbom` has a cyclomatic complexity of 48 with "very-high" risk


A function with high cyclomatic complexity can be hard to understand and
maintain. Cyclomatic complexity is a software metric that measures the number of
independent paths through a function. A higher cyclomatic complexity indicates
that the function has more decision points and is more complex.

Comment thread crates/http/src/cached.rs
#[tokio::test]
async fn a_digest_is_cached_despite_no_store_unless_an_account_read_it() {
for (account, stored) in [(false, true), (true, false)] {
let cache = Cache::open(":memory:", Default::default()).await.unwrap();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Prefer using `T::default`, over trait function `Default::default()`


Calls to Default::default() are less readable than T::default().
Using the name of the type makes it easier for the reader to discern which type is being used.

Comment thread crates/http/src/cached.rs
for (account, stored) in [(false, true), (true, false)] {
let cache = Cache::open(":memory:", Default::default()).await.unwrap();
let client =
Cached::with_options(cache.clone(), Arc::new(NoStore), Default::default()).unwrap();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Prefer using `T::default`, over trait function `Default::default()`


Calls to Default::default() are less readable than T::default().
Using the name of the type makes it easier for the reader to discern which type is being used.

Comment thread crates/http/src/cached.rs
}
#[tokio::test]
async fn a_missing_digest_is_asked_about_again_once_its_day_is_up() {
let cache = Cache::open(":memory:", Default::default()).await.unwrap();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Prefer using `T::default`, over trait function `Default::default()`


Calls to Default::default() are less readable than T::default().
Using the name of the type makes it easier for the reader to discern which type is being used.

Comment thread crates/http/src/cached.rs
.await
.unwrap();
let transport = Arc::new(Count(std::sync::atomic::AtomicUsize::new(0)));
let client = Cached::with_options(cache, transport.clone(), Default::default()).unwrap();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Prefer using `T::default`, over trait function `Default::default()`


Calls to Default::default() are less readable than T::default().
Using the name of the type makes it easier for the reader to discern which type is being used.

@sweepies
sweepies marked this pull request as ready for review October 30, 2026 17:53
@sweepies
sweepies merged commit 293fff0 into main Oct 30, 2026
16 checks passed
@sweepies
sweepies deleted the feat/image-advisories branch October 30, 2026 17:53
@sweepies
sweepies restored the feat/image-advisories branch October 30, 2026 17:53
@sweepies
sweepies deleted the feat/image-advisories branch October 30, 2026 17:54
@sweepies sweepies mentioned this pull request Oct 30, 2026
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.

1 participant