DependencyTrack / dependency-track

Dependency-Track is an intelligent Component Analysis platform that allows organizations to identify and reduce risk in the software supply chain.
https://dependencytrack.org/
Apache License 2.0
2.72k stars 580 forks source link

Fix policy evaluation not happening upon creation or update of individual components #4374

Closed fupgang closed 2 weeks ago

fupgang commented 2 weeks ago

Description

Fixes #4373 as suggested in the issue.

Addressed Issue

4373

Additional Details

The test PolicyEvaluationTaskTest does not exactly check the fix. But I found it valuable since there seems to be no test case yet for PolicyEvaluationTask. I used it to study the behavior, it asserts another aspect.

Checklist

codacy-production[bot] commented 2 weeks ago

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
:white_check_mark: +0.08% (target: -1.00%) :white_check_mark: 100.00% (target: 70.00%)
Coverage variation details | | Coverable lines | Covered lines | Coverage | | ------------- | ------------- | ------------- | ------------- | | Common ancestor commit (3c265ed6e8880fde6c51302f8c54a04273276269) | 22579 | 17852 | 79.06% | | | Head commit (dc48389dc4fe9b261dd74f86decd672be962fb5f) | 22579 (+0) | 17871 (+19) | 79.15% (**+0.08%**) | **Coverage variation** is the difference between the coverage for the head and common ancestor commits of the pull request branch: ` - `
Diff coverage details | | Coverable lines | Covered lines | Diff coverage | | ------------- | ------------- | ------------- | ------------- | | Pull request (#4374) | 2 | 2 | **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: `/ * 100%`

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more