Skip to content

Make POLICY_VIOLATION emails more informative#4935

Merged
nscuro merged 1 commit intoDependencyTrack:masterfrom
kacper-uminski:issue-4520-improve-violation-emails
May 12, 2025
Merged

Make POLICY_VIOLATION emails more informative#4935
nscuro merged 1 commit intoDependencyTrack:masterfrom
kacper-uminski:issue-4520-improve-violation-emails

Conversation

@kacper-uminski
Copy link
Copy Markdown
Contributor

Added component name, version, and URL as well as the name of the broken policy to the email template. This should make it easier for an end-user to diagnose a violation.

Description

This just adds a handful of rows to the default pebble template for emails. With this change, the default emails should include more info on the violating component as well as the license.

Addressed Issue

Improves the email portion of #4520. I did not make any changes to the Jira template, as I was unable to set up the platform, however the changes should be easily portable.

Additional Details

I felt no need to update any docs, as the changes are very small and do not majorly affect behavior. I also tried to add the policy trigger/definition, however I had trouble getting consistent results with that.

The emails before:

Policy Violation on Project: [pkg:cargo/surver]

--------------------------------------------------------------------------------

Project:           Surfer
Version:           0.3.0
Description:       A waveform viewer with a focus on a snappy usable interface, and extensibility.
Project URL:       /projects/c8c8878d-bd37-49fa-be89-d82b03e1c795
--------------------------------------------------------------------------------

A license policy violation occurred

--------------------------------------------------------------------------------

2025-04-28T15:04:03.876495948

The emails after:

Policy Violation on Project: [pkg:cargo/surver]

--------------------------------------------------------------------------------

Project:           Surfer
Version:           0.3.0
Description:       A waveform viewer with a focus on a snappy usable interface, and extensibility.
Project URL:       /projects/c8c8878d-bd37-49fa-be89-d82b03e1c795

Component:         spade-ast-lowering
Component Version: 0.10.0
Component URL:     /components/1272f3e4-bc74-4699-93fc-be18f6862543

Violated Policy:   License Test
--------------------------------------------------------------------------------

A license policy violation occurred

--------------------------------------------------------------------------------

2025-04-28T15:11:21.718156423

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 added corresponding update logic
  • This PR introduces new or alters existing behavior, and I have updated the documentation accordingly

Added component name, version, and URL as well as the name of the broken
policy to the email template. This should make it easier for an end-user
to diagnose a violation.

Signed-off-by: kacper-uminski <[email protected]>
@codacy-production
Copy link
Copy Markdown

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.00% (target: -1.00%) (target: 70.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (3f4ded0) 24029 19371 80.62%
Head commit (8f97052) 24029 (+0) 19371 (+0) 80.62% (+0.00%)

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 (#4935) 0 0 ∅ (not applicable)

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%

See your quality gate settings    Change summary preferences

@nscuro nscuro added this to the 4.14.0 milestone May 12, 2025
@nscuro nscuro added the enhancement New feature or request label May 12, 2025
Copy link
Copy Markdown
Member

@nscuro nscuro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@nscuro nscuro merged commit 8d9afb9 into DependencyTrack:master May 12, 2025
11 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants