Skip to content

change release naming for Sentry - #868

Merged
bcotrim merged 6 commits into
trunkfrom
chore/fix_sentry_versions_naming
Jan 31, 2025
Merged

change release naming for Sentry#868
bcotrim merged 6 commits into
trunkfrom
chore/fix_sentry_versions_naming

Conversation

@bcotrim

@bcotrim bcotrim commented Jan 31, 2025

Copy link
Copy Markdown
Contributor

Related issues

Proposed Changes

  1. Changed Sentry release naming format:

    • New format: studio@1.3.3 (consistent across all platforms)
    • Removed platform-specific suffixes (no more -macos, -windows)
    • Uses base version without commit hash
  2. Added environment-based error tracking:

    • Development builds report to development environment
    • Release builds report to production environment
    • Allows tracking issues in dev builds while keeping them separate from production
  3. Improved webpack integration:

    • Source maps are uploaded with the same release name format
    • Added logging to show what release name and environment would be used
    • Fixed dev build detection by checking both version suffix and IS_DEV_BUILD flag
  4. Code cleanup:

    • Removed unused getPlatformName() function
    • Consolidated version parsing logic
    • Added explanatory comments

Testing Instructions

  1. Build the app in development mode:

    • Run npm run dev
    • Check console logs for:
      Sentry release version would be: studio@1.3.3
      Sentry environment would be: development
      
  2. Build the app in production mode:

    • Run a production build
    • Check console logs for:
      Sentry release version would be: studio@1.3.3
      Sentry environment would be: production
      
  3. Test error reporting:

    • Trigger an error in both dev and production builds
    • Verify in Sentry that:
      • Errors are grouped under the correct release (e.g., studio@1.3.3)
      • Dev build errors show up in the development environment
      • Production build errors show up in the production environment
      • Source maps work correctly in both environments

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
@bcotrim
bcotrim requested a review from a team January 31, 2025 12:40
Comment thread src/index.ts Outdated
Comment on lines +41 to +43
const [ baseVersionWithBeta ] = version.split( '-dev.' );
const isDevBuild = version.includes( '-dev.' ) || process.env.NODE_ENV === 'development';
const sentryRelease = `studio@${ baseVersionWithBeta }`;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Even if it's very little logic, I still feel like it might make sense to abstract it, so we're 100% sure that release names are synchronized between here and webpack.plugins.ts

@fredrikekelund fredrikekelund left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Aside from my previous comment (https://github.com/Automattic/studio/pull/868/files#r1937392726), this LGTM and tests well 👍

Comment thread src/index.ts Outdated
if ( ! isCLI() && ! process.env.IS_DEV_BUILD ) {
const version = app.getVersion();
const [ baseVersionWithBeta ] = version.split( '-dev.' );
const isDevBuild = version.includes( '-dev.' ) || process.env.NODE_ENV === 'development';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great idea to make dev builds submit errors to the development environment in Sentry 👍

@bcotrim
bcotrim merged commit 85d296d into trunk Jan 31, 2025
@bcotrim
bcotrim deleted the chore/fix_sentry_versions_naming branch January 31, 2025 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants