Skip to content

Expose latest project status in notification subjects - #7704

Merged
nscuro merged 3 commits into
DependencyTrack:mainfrom
jdotc1:notification/project-latest-subject
Oct 23, 2026
Merged

nscuro merged 3 commits into
DependencyTrack:mainfrom
jdotc1:notification/project-latest-subject

Conversation

@jdotc1

@jdotc1 jdotc1 commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Description

Expose the existing project latest-version status in notification subjects so filters can use subject.project.is_latest == true. Populate it for both model-backed notifications and database-backed subjects, including affected-project lists and summary lookups.

Addressed Issue

Closes #6590.

Additional Details

Adds optional protobuf field is_latest = 8 and projects the existing PROJECT.IS_LATEST column consistently through the notification mapper. No database migration or new dependency is needed.

Validation:

  • Original schema failed both new true/false regression cases because the field was absent.
  • Focused NotificationModelConverterTest passed after the change: 2 tests, 0 failures/errors/skips. It checks explicit field presence, both values, and evaluation of the actual CEL filter expression.
  • Local reactor packaging passed with tests skipped. Java formatting, protobuf formatting/linting and whitespace checks passed.
  • Docker-backed NotificationSubjectDaoTest passed: 12 tests, 0 failures/errors/skips, including the new true/false assertions and updated subject JSON expectations. Executed only this pending class through jacoco:prepare-agent surefire:test -Dtest=NotificationSubjectDaoTest against the already compiled classes. Earlier successful checks were reused without rerunning.

No full test suite or end-to-end notification delivery run.

Checklist

  • I have read and understand the contributing guidelines
  • This PR fixes a defect, and I have provided tests to verify that the fix is effective
  • This PR implements an enhancement, and I have provided tests to verify that it works as intended
  • This PR introduces changes to the database model, and I have updated the migration changelog accordingly
  • This PR introduces new or alters existing behavior, and I have updated the documentation accordingly
  • This PR is a substantial change (per the ADR criteria), and I have added an ADR under docs/adr/

Allow notification filters to select the latest project version using subject.project.is_latest. Populate the status consistently for model-backed and database-backed subjects.

Signed-off-by: jdotc1 <[email protected]>
@codacy-production

codacy-production Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 4 complexity

Metric Results
Complexity 4

View in Codacy

🟢 Coverage 100.00% diff coverage · +0.02% coverage variation

Metric Results
Coverage variation ✅ +0.02% coverage variation (-1.00%)
Diff coverage ✅ 100.00% diff coverage (70.00%)

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (3896b29) 45919 40325 87.82%
Head commit (16c882f) 45921 (+2) 40334 (+9) 87.83% (+0.02%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#7704) 3 3 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

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.

@nscuro nscuro added this to the 5.3 milestone Oct 22, 2026
@nscuro nscuro added the enhancement New feature or request label Oct 22, 2026
@jdotc1

jdotc1 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Addressed the three review comments in 6c87a1cc5: moved the routing checks into NotificationRouterTest and expanded the converter and DAO assertions to cover all mapped fields. The Docker-backed router/DAO tests passed locally: 51 tests, no failures or skips.

The full CI failure exposed a timing assumption in a separate Dex test: its competing child could finish before the parent attempted the duplicate instance ID. 16c882f3d replaces the three-second timer with an explicit release event. The affected test passed locally; fresh hosted CI remains pending.

Could a maintainer approve the workflows for 16c882f3d and re-review the updated tests? Tests CI and the other current-head workflows are awaiting approval, so hosted validation has not yet run for this revision.

Hold the existing child run on an external event until the parent rejection has been asserted. A three-second timer could finish under CI load before the parent attempted to create its child, allowing the parent to complete successfully instead of exercising duplicate instance rejection.

Signed-off-by: Jeff <[email protected]>
@jdotc1
jdotc1 requested a review from nscuro October 23, 2026 02:29
@jdotc1

jdotc1 commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Thank you for your time reviewing this PR. When you have a chance, could you please approve the pending workflows for 16c882f3d so the updated tests can run in CI? I appreciate your help.

@nscuro
nscuro merged commit 441761b into DependencyTrack:main Oct 23, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Project.isLatest to notification subjects

2 participants