Conversation
Problem: the workload/node CVE report notification email rendered as a flat "Heading: value" list with the branding logo hardcoded at 20% width above the body. It didn't match the in-product look and gave recipients no quick signal of severity or CVE counts, and no way back to the report in the console. Solution: build the email body as an email-safe HTML document (table layout, inline styles only, 600px container, light mode) that mirrors the UI: - branding logo in a header band + a titled dark bar - headline stat cards for deployed/watched (workload) or total (node) CVEs - a severity legend using the product's PatternFly v6 severity colors (dot + label; independent of the counts, no invented per-severity split) - a config-details table using the exact UI field labels - an attachment note that reflects whether a CSV/ZIP is actually attached (none is sent when no CVEs are found) - a "View report in console" button built from the notifier's UI endpoint and the report config ID Notes: - Colors are inlined as hex because email clients can't resolve PatternFly CSS custom properties; severityColorByValue is kept in sync with the UI. - writeContentBytes no longer wraps report bodies in an <img>/<div> shell; the body now supplies its own HTML and references the inline logo via cid:logo.png. - User-provided values (config/collection names, filter queries, scope rules) are now HTML-escaped. Associated request: "I get a weekly 'RHACS Workload CVE Report' email; make it look much nicer" -> iterated on HTML mockups (workload, all cases, node), then implemented the approved design. Note: partially generated with the help of an AI agent.
|
Skipping CI for Draft Pull Request. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (7)
Included review availability: Your plan provides up to 12 included reviews per hour; 9 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughReport emails now use shared HTML layouts for workload and node notifications. Report generators build notifier-specific URLs and format bodies with attachment and vulnerability details. Email delivery writes the complete HTML body without adding an image wrapper. ChangesReport email rendering
Priority: ⬇️ Low Estimated code review effort: 4 (Complex) | ~45 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant ReportGenerator
participant FormatWorkloadReportEmailBody
participant ReportEmailHTML
participant EmailNotifier
ReportGenerator->>FormatWorkloadReportEmailBody: pass report data and notifier URL
FormatWorkloadReportEmailBody->>ReportEmailHTML: render shared HTML layout
ReportEmailHTML-->>FormatWorkloadReportEmailBody: return complete HTML body
FormatWorkloadReportEmailBody-->>ReportGenerator: return body or formatting error
ReportGenerator->>EmailNotifier: send complete HTML body
Suggested reviewers: Merge Risk: ⚪ Minimal · up to The report-email redesign has no identified correctness, security, or delivery issue requiring changes before merge. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #22824 +/- ##
==========================================
- Coverage 51.82% 51.81% -0.01%
==========================================
Files 2901 2902 +1
Lines 182788 182951 +163
==========================================
+ Hits 94721 94801 +80
- Misses 79776 79835 +59
- Partials 8291 8315 +24
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🚀 Build Images ReadyImages are ready for commit e88cf82. To use with deploy scripts: export MAIN_IMAGE_TAG=5.0.x-292-ge88cf82c97 |
Description
Redesigns the notification email for Workload (image) CVE reports and Node CVE reports.
Problem: the report email rendered as a flat
Heading: valuelist with the branding logo hardcoded at 20% width above the body. It didn't match the in-product look, gave recipients no quick signal of severity or CVE counts, and offered no way back to the report in the console.Solution: the email body is now an email-safe HTML document (table layout, inline styles only, 600px container, light mode) that mirrors the UI:
CVE severity,CVE status,Image type,CVEs discovered in image since, ...)Notes / considered alternatives:
severityColorByValueis kept in sync with the UI (ui/apps/platform/src/constants/severityColors.ts).writeContentBytesno longer wraps report bodies in a hardcoded<img>/<div>shell; the body now supplies its own HTML and references the inline logo viacid:logo.png. This only affects report emails (the soleEmbedLogocaller).Design was iterated as static HTML mockups (workload, all render variants, node) before implementation. See "How I validated" for how to preview.
User-facing documentation
Testing and quality
Automated testing
How I validated my change
go build ./central/reports/scheduler/v2/reportgenerator/... ./central/notifiers/email/— passesgo veton the same packages — passesgo test ./central/reports/scheduler/v2/reportgenerator/ ./central/reports/scheduler/v2/reportgenerator/node/ ./central/notifiers/email/— passesThis PR was partially generated with the help of an AI agent.