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(Cordova) enhanced node path detection, debug symbols now run in foreground. #694

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

lucas-zimerman
Copy link
Contributor

@lucas-zimerman lucas-zimerman commented Oct 22, 2024

This is a refactor on how the Cordova Integration runs, the main changes on the PR are:

  • More path options for sentry.properties.
  • Use node path from .xcode.env when node is not found.
  • Skip the integration if node isn't found, avoiding a build failure when running Sentry-CLI.
  • Use a more modern approach to find where Sentry-CLI is located.

@lucas-zimerman lucas-zimerman marked this pull request as ready for review October 22, 2024 17:17
@@ -190,31 +190,68 @@ export class Cordova extends BaseIntegration {
shellPath: '/bin/sh',
shellScript:
// eslint-disable-next-line prefer-template
Copy link
Member

Choose a reason for hiding this comment

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

Can we move this to a shell file that will ship with wizard and then copy the content to create the build phase?

For example lib/Steps/Integrations/Cordova/SentryUploadDebugFiles.sh?

Copy link

codecov bot commented Feb 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.92%. Comparing base (2d006c9) to head (7710f6f).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #694      +/-   ##
==========================================
- Coverage   51.15%   50.92%   -0.23%     
==========================================
  Files          53       53              
  Lines        3517     3517              
  Branches      825      826       +1     
==========================================
- Hits         1799     1791       -8     
- Misses       1591     1599       +8     
  Partials      127      127              
Flag Coverage Δ
e2e-tests 75.17% <ø> (-5.68%) ⬇️
unit-tests 49.91% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

const script = fs
.readFileSync(xcodeSymbolScriptPath, 'utf8')
.replace(/\\/g, '\\\\')
.replace(/\n/g, '\\n');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

image
Diff check from the shell script file compared to the same script copy/pasted on the xcode project shows the logic above matches the xcode output.

Copy link
Member

Choose a reason for hiding this comment

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

I my comment, I thought we would add the file to the wizard, and then copy it to the build phase.

Since we are adding the file in the Cordova SDK. https://github.com/getsentry/sentry-cordova/pull/372/files

Can we simplify the code to just executing the file

shellScript: `/bin/sh ../node_modules/@sentry/react-native/scripts/sentry-xcode-debug-files.sh`,

const xcodeSourceScriptPath = path.join(
process.cwd(),
'plugins/sentry-cordova/scripts',
'xcode-upload-debug-files.sh',
Copy link
Member

Choose a reason for hiding this comment

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

The file was added in getsentry/sentry-cordova#372

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.

2 participants