Skip to content

fix(watchers): stop reporting "up to date" when a check failed - #817

Merged
scttbnsn merged 1 commit into
dev/v1.7from
fix/v1.7-update-status-unknown
Aug 20, 2026
Merged

scttbnsn merged 1 commit into
dev/v1.7from
fix/v1.7-update-status-unknown

Conversation

@ALARGECOMPANY

@ALARGECOMPANY ALARGECOMPANY commented Aug 20, 2026 •

Copy link
Copy Markdown
Member

Drydock told users "Up to date" for containers where it had already found a newer
version and then failed to evaluate it. A failure to determine state was being
collapsed into the negative answer, which is the one answer the product exists to get
right.

Root cause

In findNewVersion, the digest check ran immediately before the line that records the
newer tag:

if (container.image.digest.watch && container.image.digest.repo) {
  await handleDigestWatch(...);   // unguarded
}
if (tagsCandidates && tagsCandidates.length > 0) {
  [result.tag] = tagsCandidates;  // never reached when the above throws
}

The newer tag was already sitting in tagsCandidates, found by semver comparison with
no registry call involved. A throw skipped the single statement that would have kept
it. The generic catch upstream then restored the previous verdict, or none at all on a
container's first watch, so updateAvailable computed false.

Why this is not an #814 edge case

#808 and the status half of #814 are the same defect. They were reported from
completely unrelated symptoms, one a nested OCI index and one a transient registry
blip, and both land on this call. Anything that throws from the registry layer produces
the same false negative: auth failures, 429s, timeouts, manifest-shape errors.

Worth noting withRetry already exists in the registry layer, so #808's suggested
"add retry" wouldn't have fixed it. The HTTP call succeeds. It's the response content
that isn't what the code expects.

The fix, and why it stayed small

Record the tag conclusion before the digest check, and let a digest failure degrade to
an error on the container rather than erasing the tag result.

The UI half needed no new plumbing. Container.error already exists, already
serializes, and container-mapper already derives it as registryError.
deriveUpdateStatus simply never read it, so it could not tell a confirmed "no update"
from a check that never completed. Adding an explicit unknown state closes that.

No schema change, no API break, no DEPRECATIONS.md entry, no store migration.

Deliberate limits

  • The isDigestOnlyTag branch still propagates. For an image running by digest with no
    tag to compare, a digest failure means genuinely zero information, so degrading there
    would invent a verdict rather than preserve one.
  • getTags failures still reject, for the same reason.
  • A known update is never downgraded to unknown. Only the negative claim is
    suppressed. There's a dedicated test for this: hasUpdate: true plus a registry
    error still resolves to ready.
  • When a pin-gate insight and a registry error are both present, the error wins. A
    failed check is more actionable than a routine note.

Known residual, not fixed here

app/triggers/providers/mqtt/Hass.ts publishes a Home Assistant binary sensor for
updateAvailable plus a fleet-wide count. This change repairs the common case, but the
digest-only and total-getTags-failure paths still fall back to the previous verdict
there, so an HA automation gated on that sensor can still sit green through a failed
check. Narrower than what's fixed here and worth its own issue rather than widening
this change.

Tests

Five backend cases and four frontend, plus one existing test updated: it asserted the
old deliberate reject-rather-than-lie behavior, which was a reasonable instinct that
didn't survive the first-ever-watch case. 100% lines and branches on both changed files.

Fixes: #808
Refs: #814

Changelog

  • 🐛 Fixed tag update results being erased when digest evaluation fails.
  • 🔧 Stored digest failures in container.error and logged warnings.
  • ✨ Added explicit unknown frontend status for failed registry checks.
  • 🔧 Prioritized registry errors over pin-gate insights.
  • ✨ Added backend and frontend test coverage.
  • 🔧 Preserved existing digest-only and getTags failure behavior.

Concerns

  • Manifest-fetch retry is not included; transient registry failures remain unresolved until the next scan.
  • Expanded registry error details are not included.
  • Verify all consumers handle the new unknown UpdateStatusState.

findNewVersion called handleDigestWatch unguarded, so a registry error
while resolving a candidate's digest propagated out before the very next
statement, the one recording the newer tag that semver comparison had
already found. The generic catch upstream then restored the previous
verdict, or none at all on a first watch, and updateAvailable computed
false. A container with a known newer version reported as current.

Record the tag conclusion before the digest check, and let a digest
failure degrade to an error on the container instead of erasing the tag
result. The digest-only-tag branch and getTags failures still propagate,
since those genuinely carry no information.

The UI half: deriveUpdateStatus never read container.error, so it could
not tell a confirmed "no update" from a check that never completed. Add
an explicit unknown state for that case. A known update is never
downgraded to unknown; only the negative claim is suppressed.

Fixes: #808
Refs: #814
@vercel

vercel Bot commented Aug 20, 2026

Copy link
Copy Markdown

Deployment failed for project drydock-website with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/codeswhat?upgradeToPro=build-rate-limit

@coderabbitai

coderabbitai Bot commented Aug 20, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9599818a-392f-4565-b43d-2458c46bba9d

📥 Commits

Reviewing files that changed from the base of the PR and between ea11898 and 26c1bf9.

⛔ Files ignored due to path filters (1)
  • CHANGELOG.md is excluded by !CHANGELOG.md
📒 Files selected for processing (5)
  • app/watchers/providers/docker/image-comparison.test.ts
  • app/watchers/providers/docker/image-comparison.ts
  • ui/src/composables/useUpdateStatus.ts
  • ui/src/locales/en/containerComponents.json
  • ui/tests/composables/useUpdateStatus.spec.ts

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

Docker image comparison now preserves the highest discovered tag when digest watching fails and records the failure on container.error. Tests cover tagged and digest-only containers, unchanged tags, newer tags, and tag-list failures. The UI update status model now accepts registry errors and reports an unknown warning state when no actionable update exists. Localization and tests cover precedence against up-to-date, ready, and pin-gate states.

Merge Risk: ⚪ Minimal · up to 26c1b

This localized change preserves confirmed updates and reports failed checks as unknown instead of incorrectly showing containers as up to date; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 1 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR preserves known updates and surfaces digest failures, but it does not implement issue #808's bounded manifest retry or expanded manifest error details. Add bounded retries for transient or 5xx manifest-list failures and include media type, HTTP status, and digest details in manifest-resolution errors.
✅ Passed checks (1 passed)
Check name Status Explanation
Out of Scope Changes check ✅ Passed All reviewed changes support issue #808 by preserving update results, surfacing registry failures, and testing the backend and frontend status behavior.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/v1.7-update-status-unknown

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttbnsn
scttbnsn merged commit 7f2e58b into dev/v1.7 Aug 20, 2026
32 of 36 checks passed
scttbnsn added a commit that referenced this pull request Aug 21, 2026
… v1.6.1 (#822)

* 🐛 fix(registries): resolve nested OCI indexes to the real image manifest (#816)

handleSchemaV2 selected the platform entry from a manifest list but only
handled that entry being a single manifest or a legacy image config. Buildx
with SBOM/provenance attestations emits a per-platform entry that is itself
an OCI index, which fell through to "Unexpected error; no manifest found"
and broke digest watching for the image.

Follow a nested index to the platform's real manifest, bounded to three
levels so a malformed or hostile response cannot walk indefinitely.
Attestation manifests need no special handling: they carry
platform.architecture "unknown", so the existing platform filter already
excludes them.

Also guard filterManifestByPlatform's platform access. The OCI spec does
not require platform on every list entry, and an entry without it threw a
TypeError instead of being skipped.

This lives in the base Registry class, so it applies to all 23 providers.

Fixes: #814

(cherry picked from commit 8cb336f)

* 🐛 fix(watchers): stop reporting "up to date" when a check failed (#817)

findNewVersion called handleDigestWatch unguarded, so a registry error
while resolving a candidate's digest propagated out before the very next
statement, the one recording the newer tag that semver comparison had
already found. The generic catch upstream then restored the previous
verdict, or none at all on a first watch, and updateAvailable computed
false. A container with a known newer version reported as current.

Record the tag conclusion before the digest check, and let a digest
failure degrade to an error on the container instead of erasing the tag
result. The digest-only-tag branch and getTags failures still propagate,
since those genuinely carry no information.

The UI half: deriveUpdateStatus never read container.error, so it could
not tell a confirmed "no update" from a check that never completed. Add
an explicit unknown state for that case. A known update is never
downgraded to unknown; only the negative claim is suppressed.

Fixes: #808
Refs: #814

Co-authored-by: scttbnsn <[email protected]>

(cherry picked from commit 7f2e58b)

* 🐛 fix(agent): isolate per-container failures in full-inventory ingest (#812)

processAuthoritativeContainers() had no per-container try/catch, so one
container that threw while building its report (e.g. during controller-side
SBOM document offload) aborted the whole batch before any container reached
the store. This drives both the standard-mode handshake and edge-mode
container_sync full-inventory paths; the sibling SSE watcher-snapshot path
already had this isolation. Mirror that pattern here, plus a single
proportionate warning when an entire batch fails.

Investigated for #802, but Portwing's current wire format never sends
security.sbom, so this closes the isolation gap without confirming #802's
actual trigger.

(cherry picked from commit e3dc4f9)

* 🔧 chore(security): cover the v1.6 docs snapshot in the gitleaks baseline

The secrets scan reads --log-opts=--all against a full-fetch checkout, so
a PR into dev/v1.6 also scans v1.7-line commits, including the two that
snapshot content/docs/v1.6/ with its placeholder credentials. Those 18
fingerprints were only ever added to the v1.7 line's .gitleaksignore, so
the first dev/v1.6 PR since the snapshot failed with 36 findings none of
which touch this branch. Port the entries as-is; every one is a doc
example value.

* 🔧 chore(ci): backport the v1.7 CI pipeline so dev/v1.6 PRs can satisfy the ruleset

Ruleset 20957219 requires 11 status contexts by the v1.7 job names (e.g.
"Quality: Lint", "Security: Actions / Workflow Security", "🐳 Security:
Grype Image"). dev/v1.6's ci-verify.yml and e2e-playwright.yml still
produced the pre-rename names ("🧹 Quality: Lint", "🔐 Security: Actions",
...) and had no Grype Image job at all, so every required context read
MISSING on green runs and a dev/v1.6 PR could never satisfy the ruleset.

PR workflows run from the merge ref, so landing this backport on the PR
branch itself is what unblocks the PR.

Backported from origin/dev/v1.7:
- ci-verify.yml: renamed zizmor -> security-actions, now calling the
  reusable CodesWhat/.github go-ci.yml workflow (run-workflow-security
  only) to produce the composite "Security: Actions / Workflow Security"
  context; dropped emoji from the lint/test/build/e2e job names; added
  the grype-image job (scans the same QA image `build` already produces);
  switched the coverage upload from Qlty to Codecov.
- e2e-playwright.yml: dropped emoji from the playwright job name.
- .grype.yaml: picked up the CVE-2026-14456 openssl/libssl3/libcrypto3
  triage entries -- this branch's Dockerfile pins the same vulnerable
  openssl=3.5.7-r0, so the new grype-image job (severity-cutoff: high,
  fail-build: true) would otherwise fail on a real, currently-unpatched
  Alpine CVE that isn't this branch's to fix.
- .github/filters/runtime.yml: added .grype.yaml so an ignore-rule edit
  re-runs the scan that reads it.
- .github/tests/: updated ci-verify-workflow.test.ts,
  e2e-playwright-workflow.test.ts, and harden-runner-workflow.test.ts to
  match, trimmed to what this branch actually changed (dropped
  assertions tied to lefthook's knip integration and to other workflows
  -- quality-mutation-monthly.yml, quality-portwing-fleet-soak.yml,
  security-grype.yml -- that stay out of scope here).

Not backported: security-grype.yml (no required context depends on it,
and its jobs already skip on this PR since it's still main-only
triggered), lefthook.yml/knip lefthook wiring, and the action-pin
bumps for actions/checkout and actions/setup-node (reverted back to
this branch's existing pins so the repo-wide pin-consistency test
doesn't need every other workflow file touched too).

* 🔧 chore(ci): drop two v1.7-only controls that don't hold on the v1.6 line

PR #822's first CI run under the backported pipeline surfaced two
over-backports:

- "Security: Secrets" failed on the same 36 findings this branch already
  cleared (d6c9fcf). v1.7's secrets job pins scripts/scan-secrets.sh,
  .gitleaks.toml, and .gitleaksignore to the PR's base ref before scanning,
  so a PR can't weaken the gate that scans it. scan-secrets.sh runs
  `gitleaks git --log-opts="--all"`, which walks every ref reachable from
  the fetch, including v1.7-line commits (a70d406/cbc87588) merged into
  shared history. dev/v1.6's own .gitleaksignore baseline predates those
  commits, and since the restore step always pins the base ref's copy,
  every PR against dev/v1.6 would be judged against a baseline that
  predates the findings and could never be updated to fix it -- an
  unbreakable bootstrap deadlock specific to this maintenance line. Removed
  the restore step; left a comment explaining why in both the workflow and
  its test.

- "Quality: Lint" failed on "Knip (app)". v1.7's lint job runs `npm run
  knip` in app/ and ui/, but this branch's app/ui code was never cleaned up
  against it. Knip enforcement is a v1.7-line goal. Removed the Knip steps
  and the install steps that existed only to feed them; Biome and Qlty stay
  as backported.

Both required context names ("🔑 Security: Secrets", "Quality: Lint") are
unchanged.

Audited every other job in ci-verify.yml and e2e-playwright.yml against
this branch's actual scripts, npm scripts, and config files: the only new
references the backport introduced are .grype.yaml (grype-image job,
already present) and the CodesWhat/.github go-ci.yml reusable-workflow call
(security-actions job, already exercised by the real PR run since codeql
and fuzz both `needs: [security-actions]`). Every other run:/uses: line in
both files is byte-identical to what dev/v1.6 already had before this
backport, including in the jobs that skipped on this run (web, fuzz,
dast-zap-baseline, load-test-*) -- so none of them can explode on a future
v1.6 PR that does exercise their path filters.
@scttbnsn
scttbnsn deleted the fix/v1.7-update-status-unknown branch August 27, 2026 23:56
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