Update Sentry release param to use app version - #96
Conversation
| debug: true, | ||
| enabled: process.env.NODE_ENV !== 'development', | ||
| release: COMMIT_HASH, | ||
| release: app.getVersion() ? app.getVersion() : COMMIT_HASH, |
There was a problem hiding this comment.
app.getVersion() is an Electron method that returns the version of the loaded application found in the app package.json file.
There was a problem hiding this comment.
I paused to think if we should/need to update/remove the existing COMMIT_HASH references here (or elsewhere). My thought is that retaining the references still makes sense.
Many of the other references appear to log both values, so having both likely is intentional and helpful context. I'm not sure under what circumstances this particular line would use the COMMIT_HASH.
dcalhoun
left a comment
There was a problem hiding this comment.
This will be very helpful for evaluating release stability. Thank you!
| debug: true, | ||
| enabled: process.env.NODE_ENV !== 'development', | ||
| release: COMMIT_HASH, | ||
| release: app.getVersion() ? app.getVersion() : COMMIT_HASH, |
There was a problem hiding this comment.
I paused to think if we should/need to update/remove the existing COMMIT_HASH references here (or elsewhere). My thought is that retaining the references still makes sense.
Many of the other references appear to log both values, so having both likely is intentional and helpful context. I'm not sure under what circumstances this particular line would use the COMMIT_HASH.
@dcalhoun Thanks for the feedback -- I had also considered this. In fact, I initially removed After reviewing the Sentry docs on the release param, I decided to keep |
Related to https://github.com/Automattic/dotcom-forge/issues/6671
Ensures Sentry events reference the release version, when available.
Proposed Changes
Updates
Sentry.initparams to pass the release version (viaapp.getVersion()). If there is no release version, the commit hash is used (matching current behavior).Testing Instructions
Log Sentry.init values locally to observe app release version.
studio/src/index.ts
Lines 28 to 33 in ecc7e62
Pre-merge Checklist