Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: LIVE_UPDATE_APP_VERSION for Sentry release instead of FYLE_MOBILE_RELEASE_VERSION #3264

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

Aniruddha-Shriwant
Copy link
Contributor

@Aniruddha-Shriwant Aniruddha-Shriwant commented Nov 18, 2024

Clickup

app.clickup.com

Summary by CodeRabbit

  • New Features

    • Enhanced Sentry integration by dynamically assigning the release version from environment configuration.
  • Bug Fixes

    • Removed outdated code for mobile app version tracking, ensuring a cleaner pre-build process without affecting overall functionality.

Copy link

coderabbitai bot commented Nov 18, 2024

Walkthrough

The changes in this pull request involve modifications to the hooks/prebuild.js and src/main.ts files. The prebuild.js file has had the code that updates the mobile app version for Sentry tracking removed, while retaining the logic for environment variable checks and configuration file updates. In src/main.ts, the Sentry initialization now dynamically uses the LIVE_UPDATE_APP_VERSION from the environment instead of a hardcoded string. The overall control flow and error handling remain unchanged.

Changes

File Path Change Summary
hooks/prebuild.js Removed code that updated mobile app version for Sentry tracking; retained environment checks and other configurations.
src/main.ts Updated Sentry release property to use environment.LIVE_UPDATE_APP_VERSION instead of a hardcoded string; other logic remains unchanged.

Possibly related PRs

  • feat: add mobile app release version in Sentry issues #3249: This PR modifies the hooks/prebuild.js and src/main.ts files to enhance Sentry issue tracking by incorporating the mobile app release version, which is directly related to the changes made in the main PR regarding Sentry configuration and version handling.

Suggested labels

size/XS

Suggested reviewers

  • Chethan-Fyle
  • arjunaj5

🎉 In the code where changes play,
The version tracking fades away.
Dynamic Sentry, now it gleams,
From environment, it pulls the dreams.
With Rajinikanth's flair, we say,
"Code like a superstar, every day!" 🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the size/XS Extra Small PR label Nov 18, 2024
@@ -38,7 +38,7 @@ Sentry.init({
dsn: environment.SENTRY_DSN,
integrations: [],
tracesSampleRate: 0.1,
release: 'please-replace-your-mobile-app-version',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://fylein.slack.com/archives/C017C400V37/p1731905137847389?thread_ts=1731904728.122209&cid=C017C400V37

discussed here, LIVE_UPDATE_APP_VERSION - will have updated version always, so using that key

Copy link
Contributor Author

@Aniruddha-Shriwant Aniruddha-Shriwant Nov 18, 2024

Choose a reason for hiding this comment

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

image

my .env's LIVE_UPDATE_APP_VERSION 5.13.1 is reflected in Sentry properly ✌🏻

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Outside diff range comments (1)
src/main.ts (1)

Line range hint 38-47: Superstar suggestion for better monitoring!

Like how I make my grand entries perfectly timed, we should add performance monitoring to Sentry!

Consider enabling Sentry's Performance Monitoring by adding these integrations:

  Sentry.init({
    dsn: environment.SENTRY_DSN,
-   integrations: [],
+   integrations: [
+     new Sentry.BrowserTracing({
+       tracingOrigins: ['localhost', 'your-production-domain.com'],
+     }),
+   ],
    tracesSampleRate: 0.1,
    release: environment.LIVE_UPDATE_APP_VERSION,
    ignoreErrors: ['Non-Error exception captured', 'Non-Error promise rejection captured'],
    beforeSend(event) {
      cleanHttpExceptionUrlsForSentryGrouping(event);
      return event;
    },
  });

When you add performance monitoring, you become the Thalaiva of debugging! 🌟

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE

📥 Commits

Reviewing files that changed from the base of the PR and between fbf0c91 and 76b2bc4.

📒 Files selected for processing (2)
  • hooks/prebuild.js (0 hunks)
  • src/main.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • hooks/prebuild.js

@@ -38,7 +38,7 @@ Sentry.init({
dsn: environment.SENTRY_DSN,
integrations: [],
tracesSampleRate: 0.1,
release: 'please-replace-your-mobile-app-version',
release: environment.LIVE_UPDATE_APP_VERSION,
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Mind it! The environment setup needs some punch, macha!

Listen here, the situation is like a movie without a climax! We found LIVE_UPDATE_APP_VERSION in environment.ts, but it's empty like a vacant theater! And the production environment file is missing like my signature sunglasses!

  • environment.ts has LIVE_UPDATE_APP_VERSION: '' - empty string, not good!
  • environment.prod.ts is completely missing from the stage!

You need to:

  1. Add proper value to LIVE_UPDATE_APP_VERSION in environment.ts
  2. Create environment.prod.ts with the production configuration
  3. Ensure both files have the correct version setup

Remember: In my style, when Sentry tracks errors, it should know exactly which version caused the trouble!

🔗 Analysis chain

Mind-blowing change, but let's verify the environment setup, boss!

The change from hardcoded version to environment.LIVE_UPDATE_APP_VERSION is stylish! But just like how I verify my stunts, we need to verify this environment variable setup.

Mind it: Make sure this variable is properly set in your environment configuration files, or Sentry won't know which version caused the punch dialogues... err... I mean errors! 🕶️

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify LIVE_UPDATE_APP_VERSION is properly configured

# Check if the variable is defined in environment files
echo "Checking environment files for LIVE_UPDATE_APP_VERSION..."
rg "LIVE_UPDATE_APP_VERSION" src/environments/

Length of output: 234


Script:

#!/bin/bash
# Let's check both environment files to ensure proper configuration
echo "Checking all environment files content..."
echo "=== environment.ts ==="
cat src/environments/environment.ts
echo -e "\n=== environment.prod.ts ==="
cat src/environments/environment.prod.ts

# Let's also check the previous version variable usage
echo -e "\n=== Checking for FYLE_MOBILE_RELEASE_VERSION ==="
rg "FYLE_MOBILE_RELEASE_VERSION" src/environments/

Length of output: 1640

Copy link

Unit Test Coverage % values
Statements 95.95% ( 19188 / 19997 )
Branches 91.11% ( 10566 / 11596 )
Functions 94.35% ( 5730 / 6073 )
Lines 95.98% ( 18317 / 19083 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XS Extra Small PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants