Skip to content

[PM-36838] Render DeviceType display name in event integration templates#8011

Open
lastbestdev wants to merge 1 commit into
mainfrom
events-device-type-display-name
Open

[PM-36838] Render DeviceType display name in event integration templates#8011
lastbestdev wants to merge 1 commit into
mainfrom
events-device-type-display-name

Conversation

@lastbestdev

@lastbestdev lastbestdev commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-36838

📔 Objective

The #DeviceType# integration template token resolved to the DeviceType enum member identifier (e.g. "ChromeExtension") because ReplaceTokens calls .ToString() on the value. Expose the [Display(Name)] value via GetDisplayName() so rendered event payloads show the friendly name (e.g. "Chrome Extension") instead.

📸 Screenshots

Event sent to Splunk (see "deviceName" value. "Chrome" is the display value for the "ChromeBrowser" device type enum member)

image

The #DeviceType# integration template token resolved to the DeviceType
enum member identifier (e.g. "ChromeExtension") because ReplaceTokens
calls .ToString() on the value. Expose the [Display(Name)] value via
GetDisplayName() so rendered event payloads show the friendly name
(e.g. "Chrome Extension") instead.
@lastbestdev
lastbestdev requested a review from a team as a code owner July 17, 2026 23:31
@lastbestdev
lastbestdev requested a review from Banrion July 17, 2026 23:31
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

Reviewed a focused bugfix that changes IntegrationTemplateContext.DeviceType from the raw DeviceType? enum to Event.DeviceType?.GetDisplayName(), so event integration templates render the friendly [Display(Name)] value (e.g. "Chrome Extension") instead of the enum identifier ("ChromeExtension"). Traced the token-replacement path in IntegrationTemplateProcessor.ReplaceTokens, confirmed the property is only consumed via reflection-based token substitution, and verified GetDisplayName safely falls back to the enum name when no [Display] attribute exists. Null handling and DeviceTypeId behavior are preserved and covered by new unit tests.

No security, correctness, breaking-change, or performance concerns were found.

Code Review Details

No findings. The change is small, well-scoped, and appropriately tested for both the set and null device-type cases.

@codecov

codecov Bot commented Jul 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.36%. Comparing base (3e79593) to head (59e65a4).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8011      +/-   ##
==========================================
+ Coverage   62.23%   62.36%   +0.13%     
==========================================
  Files        2287     2286       -1     
  Lines       99663    99673      +10     
  Branches     9004     9004              
==========================================
+ Hits        62023    62162     +139     
+ Misses      35469    35338     -131     
- Partials     2171     2173       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant