[No QA] Add script for Sentry release adoption reporting#92605
Conversation
Adds a CLI that queries Sentry Discover for the share of production users on releases older than a given New Expensify build. Co-authored-by: Cursor <cursoragent@cursor.com>
Replace the Node mjs entrypoint with a typed Bun script and drop the separate README in favor of usage docs in the file header. Co-authored-by: Cursor <cursoragent@cursor.com>
Replace hand-rolled argv parsing with scripts/utils/CLI for typed flags, named args, validation, and built-in help. Co-authored-by: Cursor <cursoragent@cursor.com>
Resolve cspell, ESLint, and tsgo issues: typed env access, Sentry field constant, and simplified CLI factory return type. Co-authored-by: Cursor <cursoragent@cursor.com>
Append statsPeriod or start/end on every events query, not only the first page, so cursor pagination stays within the requested window. Co-authored-by: Cursor <cursoragent@cursor.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
mollfpr
left a comment
There was a problem hiding this comment.
LGTM! @roryabraham There's still failing test but I think is not related to the changes.
|
Failing tests are unrelated |
|
@roryabraham looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.4.0-0 🚀
Bundle Size Analysis (Sentry): |
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.4.0-7 🚀
|
Explanation of Change
Adds
scripts/sentry/release-adoption-older-than.ts, a Bun CLI that queries Sentry Discover for the percentage of production users (by unique error events) on New Expensify releases strictly older than a given build. This makes release-adoption checks repeatable without using the Sentry MCP interactively.Fixed Issues
$ n/a - wanted to use it to check if we can force an upgrade without disturbing many users. Will need to do the same check weekly until most users have upgraded, so I wrote a script rather than relying on AI and an MCP every time.
Tests
Sentry Auth TokenSENTRY_AUTH_TOKEN="$(op item get --fields notesPlain 'Sentry Auth Token')" ./scripts/sentry/release-adoption-older-than.ts --helpand confirm usage printsSENTRY_AUTH_TOKEN="$(op item get --fields notesPlain 'Sentry Auth Token')" ./scripts/sentry/release-adoption-older-than.ts --threshold 9.3.79-4 --period 24h --jsonand confirm JSON output withtotalUniqueUsers,uniqueUsersOnOlderReleases, andpercentOnOlderReleasesOffline tests
N/A
QA Steps
N/A – internal developer script only; no product UI changes.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
N/A
Android: mWeb Chrome
N/A
iOS: Native
N/A
iOS: mWeb Safari
N/A
MacOS: Chrome / Safari
N/A