Skip to content

πŸ› fix(audit): record update-available audits on change, not on a timer - #642

Merged
scttbnsn merged 1 commit into
dev/v1.6from
fix/v1.6-audit-churn
Jul 31, 2026
Merged

πŸ› fix(audit): record update-available audits on change, not on a timer#642
scttbnsn merged 1 commit into
dev/v1.6from
fix/v1.6-audit-churn

Conversation

@scttbnsn

@scttbnsn scttbnsn commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

What

The rc.9 24-hour store-size acceptance failed on auditGrowthStayedBounded: 140 audit rows of growth in 24h against the 50-row bound. 380 of 464 rows in the store were the same update-available fact (identical from→to digest pair) re-recorded over and over.

Root cause: shouldRecordUpdateAvailableAudit deduped by signature only within a time window (DD_AUDIT_UPDATE_AVAILABLE_DEDUPE_MS, default 1h). Every time the window lapsed, the unchanged update was re-recorded β€” ~14 identical rows/day/container for any long-pending update, bounded only by 30-day retention (~420 rows/month per stale update).

Fix

  • update-available audit rows are recorded on first detection or signature change (kind/localValue/remoteValue) only β€” never because time elapsed. State map is now Map<identity, signature> with no timestamps.
  • The signature is cached after insertAudit succeeds, so a failed insert can't permanently suppress that update (mattered once expiry was removed).
  • registerContainerRemoved now also clears update-available state (same identity derivation as the report path), so remove/recreate records a fresh detection. Existing clear-on-resolve behavior is unchanged.
  • DD_AUDIT_UPDATE_AVAILABLE_DEDUPE_MS is removed β€” it shipped only in v1.6.0 RCs, never in a GA, and no schema rejects a stale env var at startup. Docs rows updated.

Known residuals (out of scope, deliberate)

Restart behavior: in-memory state means at most one duplicate row per still-pending update per process restart β€” accepted; seeding from the store isn't worth the complexity.

Verification

  • Full app suite: 394 files, 12,431 tests, 100% statements/branches/functions/lines.
  • New tests: no-re-record-after-elapsed-time (direct regression for the acceptance failure), persistence-failure retry, forget-on-removal, restart-dup documentation test, 10k-container fleet-scale churn test.
  • Full lefthook pre-push gate green (coverage app+ui, builds, e2e, zizmor).

Changelog

  • πŸ”§ Changed update-available audit deduplication to use kind, localValue, and remoteValue signatures.
  • πŸ”§ Changed state caching to occur only after successful audit insertion.
  • πŸ”§ Changed container removal to clear update-available state.
  • πŸ› Fixed fresh update detection after container removal and recreation.
  • πŸ—‘οΈ Removed DD_AUDIT_UPDATE_AVAILABLE_DEDUPE_MS and its configuration getter, tests, and documentation.
  • πŸ”§ Updated audit documentation for signature-based detection and re-detection behavior.
  • πŸ”’ Kept security-alert deduplication unchanged.

Concerns

  • Confirm known duplicate records from flaky manifest results and process restarts are acceptable.
  • Check for stale references to DD_AUDIT_UPDATE_AVAILABLE_DEDUPE_MS or getAuditUpdateAvailableDedupeMs.
  • Verify state identity derivation remains consistent between update detection and container removal.

@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
drydock-website Ready Ready Preview Jul 31, 2026 1:26pm
drydockdemo-website Ready Ready Preview Jul 31, 2026 1:26pm

@coderabbitai

coderabbitai Bot commented Jul 31, 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: 33e44708-70a0-4b61-be69-481c7b448c41

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 7f55c35 and 54487bf.

β›” Files ignored due to path filters (1)
  • CHANGELOG.md is excluded by !CHANGELOG.md
πŸ“’ Files selected for processing (6)
  • app/configuration/index.test.ts
  • app/configuration/index.ts
  • app/event/audit-subscriptions.test.ts
  • app/event/audit-subscriptions.ts
  • content/docs/current/configuration/server/index.mdx
  • content/docs/current/monitoring/index.mdx
πŸ’€ Files with no reviewable changes (3)
  • app/configuration/index.ts
  • content/docs/current/configuration/server/index.mdx
  • app/configuration/index.test.ts

πŸ“ Walkthrough

Walkthrough

Update-available audit deduplication no longer uses DD_AUDIT_UPDATE_AVAILABLE_DEDUPE_MS. The subscription stores the last signature per container and records audits when the signature changes. Failed writes do not consume deduplication state. Container removal and cache clearing reset the state. Tests and documentation now describe signature-based behavior.

Possibly related PRs

  • CodesWhat/drydock#520: Modifies audit deduplication and container state cleanup in the same subscription area.
  • CodesWhat/drydock#607: Modifies update-available deduplication and candidate identity/signature handling.
πŸš₯ Pre-merge checks | βœ… 2
βœ… Passed checks (2 passed)
Check name Status Explanation
Linked Issues check βœ… Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check βœ… Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
πŸ“ 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.6-audit-churn

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.

@scttbnsn
scttbnsn merged commit 4930161 into dev/v1.6 Jul 31, 2026
26 checks passed
@scttbnsn
scttbnsn deleted the fix/v1.6-audit-churn branch July 31, 2026 15:07
scttbnsn added a commit that referenced this pull request Jul 31, 2026
Renames Unreleased to [1.6.0-rc.10] β€” 2026-07-31 and adds the routine
dependency-maintenance rollup entry (#614, #615, #617, #646).

rc.10 contents: the #644 infrastructure helper-image fix (#645), Crowdin
resync + fr fixes (#620), minute-precise maintenance-window warning +
docs (#640/#641), the audit re-record fix (#642), dep maintenance
including the fast-uri override at 4.1.1, and the Renovate babel-major
block.

Version files stay at 1.6.0 (set at rc.1). Full app+ui coverage gates
run locally: 100% on all metrics.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Changelog

✨ **Added**
- Added v1.6.0-rc.10 release highlights.
- Added dependency-maintenance coverage for issues `#614`, `#615`,
`#617`, and `#646`.
- Added release comparison-link validation for v1.6.0-rc.10.

πŸ”§ **Changed**
- Updated release documentation from `Unreleased` to `[1.6.0-rc.10] β€”
2026-07-31`.
- Updated README, site metadata, demo mocks, API examples, quickstart
documentation, and tests from `1.6.0-rc.9` to `1.6.0-rc.10`.
- Updated release identity tests to reference the new release and date.
- Documented infrastructure fixes, Crowdin synchronization, French
translations, maintenance-window warnings, audit deduplication,
dependency updates, the `fast-uri` 4.1.1 override, and the Renovate
Babel-major block.

- Confirm that all release-version references changed from `1.6.0-rc.9`
to `1.6.0-rc.10`.
- Confirm that version files remain at `1.6.0`.
- Run the documented application and UI coverage gates and verify 100%
coverage across all metrics.
- Verify that the release documentation contains the dependency rollup
and all referenced issues.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
scttbnsn added a commit that referenced this pull request Jul 31, 2026
Standard pre-cut sync. Brings main level with dev/v1.6 for the
v1.6.0-rc.10 cut.

Delta since the rc.9 sync: #640, #641, #642, #614, #615, #645 (fixes
#644), #620, #646, #617, #647 (release prep).

After merge, main's tree must equal origin/dev/v1.6 (squash-merge policy
mints a new SHA; tree equality is the invariant the release-cut workflow
asserts).

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Changelog

- πŸ› Fixed Docker Hub helper-image references so Drydock can spawn helper
containers without the unavailable registry-prefixed image.
- πŸ”§ Changed audit `update-available` deduplication to use stable
signatures instead of a configurable time window.
- πŸ”§ Added maintenance-window warnings for cron expressions with fixed
minute fields.
- ✨ Added update-eligibility documentation links to soft-blocker
confirmation dialogs.
- ✨ Documented Portwing Edge exec sessions and maintenance-window
behavior.
- πŸ”§ Updated localization, release metadata, mock data, dependencies, and
release-candidate references to `1.6.0-rc.10`.
- πŸ”’ Updated dependency security checks and Renovate rules.

## Concerns

- Verify that `main` and `origin/dev/v1.6` have identical trees after
merge.
- Review new locale entries that still use English text.
- Confirm that helper-image resolution preserves non-Hub registry hosts
and all registry-manager fallback behavior.
- Confirm that removing `DD_AUDIT_UPDATE_AVAILABLE_DEDUPE_MS` is
reflected in deployment configuration and upgrade guidance.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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