Repository navigation
fix(watchers): stop reporting "up to date" when a check failed - #817
Conversation
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
|
Deployment failed for project drydock-website with the following error: |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughDocker image comparison now preserves the highest discovered tag when digest watching fails and records the failure on Merge Risk: ⚪ Minimal · up to 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)
✅ Passed checks (1 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
… 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.
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 thenewer tag:
The newer tag was already sitting in
tagsCandidates, found by semver comparison withno 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
updateAvailablecomputed 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
withRetryalready 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.erroralready exists, alreadyserializes, and
container-mapperalready derives it asregistryError.deriveUpdateStatussimply 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.mdentry, no store migration.Deliberate limits
isDigestOnlyTagbranch still propagates. For an image running by digest with notag to compare, a digest failure means genuinely zero information, so degrading there
would invent a verdict rather than preserve one.
getTagsfailures still reject, for the same reason.suppressed. There's a dedicated test for this:
hasUpdate: trueplus a registryerror still resolves to
ready.failed check is more actionable than a routine note.
Known residual, not fixed here
app/triggers/providers/mqtt/Hass.tspublishes a Home Assistant binary sensor forupdateAvailableplus a fleet-wide count. This change repairs the common case, but thedigest-only and total-
getTags-failure paths still fall back to the previous verdictthere, 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
container.errorand logged warnings.unknownfrontend status for failed registry checks.getTagsfailure behavior.Concerns
unknownUpdateStatusState.