Repository navigation
Conversation
Existing CEL violations retain their identity when matching content changes, so later KEVs do not produce the creation notification. Persist message transitions and notification outbox entries together, and expose separate subscriptions for active and explicitly opted-in reviewed violations. Preserve creation notifications and review decisions. Cover PostgreSQL concurrency, rollback, review ownership and API-to-webhook delivery with regression tests, and document the message-based contract in a proposed ADR. Signed-off-by: WenFeng Gao <bd007xf@gmail.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 131 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Make the documented notification filters explicit about optional message and review fields. Verify that absent values and a recorded false suppression flag do not match the corresponding filters in the real notification router. Signed-off-by: WenFeng Gao <bd007xf@gmail.com>
This was referenced Nov 7, 2026
007xf
marked this pull request as ready for review
November 10, 2026 11:09
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add independently subscribed notifications when an existing component policy violation's
stored message changes. A message-producing KEV condition can report another matching
KEV while retaining the violation UUID.
POLICY_VIOLATIONkeeps its creation-only meaning.POLICY_VIOLATION_UPDATEDreports ordinary updates. The separatePOLICY_VIOLATION_UPDATED_REVIEWEDgroup explicitly opts into updates for approved orsuppressed violations. Existing rules gain neither subscription automatically, and review
decisions remain unchanged.
Addressed Issue
Addresses #7649.
Additional Details
Reconciliation requires an active READ COMMITTED transaction and locks the project in a
separate statement before the bulk upsert reads previous values. This avoids stale predecessor
values under PostgreSQL upsert conflicts. Null-safe comparison detects actual stored-message
transitions, including clearing a message; SQL captures previous/current values and statement
time. Violation changes and durable notification outbox entries commit or roll back together.
Existing project analysis workflows serialize full evaluations; direct callers must preserve that
contract because the reconciliation lock does not order earlier input reads.
One bulk subject query captures review metadata and classifies each transition once. Its
analysis join matches violation, component and project, ensuring only the corresponding review
tuple participates. APPROVED or suppressed=true selects the reviewed group; REJECTED/false
stays ordinary. Subscribing to both groups produces one event per transition. Reviewed subjects
include captured analysis state and suppression, preserving explicit false versus absent.
Ordinary subjects omit these optional review fields. Review-only changes,
new subscriptions and clearing a decision do not replay prior transitions or reset decisions.
Protobuf adds groups 25/26 and an update subject; optional review fields are appended as 7/8.
Existing enum numbers and fields remain unchanged. Text-based group storage needs no schema
migration. Router, CEL filters, Kafka partition keys and default publisher templates support both
groups. Consumers opting in must understand the new subject; custom templates may need an
explicit branch. Existing REST notification rules support independent subscription. Companion
changes are available in DependencyTrack/frontend#2074 and DependencyTrack/docs#324. The
frontend adds independent choices and accessible opt-in guidance; the documentation adds
configuration, filter and template guidance, and regenerated schema references. These remain unreleased.
Conditions must return a stable message containing relevant matching identities. Boolean
conditions and equal stored text cannot expose matching-set changes, including changes past
the existing 1024-character limit. Removal, replacement and wording changes also count; this
is not a semantic classifier of newly added KEVs. Delivery retains existing at-least-once retries
and permanent-failure diagnostics. Receivers should deduplicate by notification ID.
Validation used Temurin 25.0.5, real PostgreSQL 14.24 and process-local en_US/UTC settings:
presence-aware filters for absent values and an explicitly false suppression flag.
263.934 seconds. This includes 18 production-component CEL-to-webhook invocations,
concurrent reconciliation, rollback, null transitions, subscription isolation, review ownership,
templates and Protobuf compatibility. Skips comprise 80 inapplicable cases and eight existing
disabled tests; they are not counted as passes.
suppressed-only and combined decisions through authenticated REST configuration/review,
the public analysis endpoint, persistent workflows and a local receiver. Synthetic KEV/finding
fixtures use the isolated database. Cases verify default exclusion, opt-in, no duplicate events,
no replay and future active updates.
10 passed; two skipped; zero failures/errors, in 226.546 seconds. The three new HTTP
scenarios all ran. Existing Snyk organization and OSS Index username prerequisites were
unavailable; those two tests were not executed or counted as passes.
eight new subscription cases, against the patched local API server and PostgreSQL. The latest
backend commit only changes documentation and tests; production code matches the tested image.
production-template-renderer scenarios. Its 392 existing prose warnings match the unchanged
main baseline; added content has none. Frontend dependency audit and build diagnostics are
documented in its PR rather than claimed resolved here.
Commands used for full regression, checks and final container validation:
Proposed ADR 044 and a repository usage note accompany the implementation. The ADR needs
Accepted status before merge. Companion changes need upstream merge/publication. Frontend CI
uses
5-snapshotand requires the backend implementation to merge and publish first. All commitsinclude the contributor's DCO sign-off.
Checklist
This PR introduces changes to the database model, and I have updated the migration changelog accordingly(No schema change.)docs/adr/(Proposed; acceptance before merge pending.)