Skip to content

fix(profiling): Change path of non-sandboxed macOS app launch profile configuration#5143

Merged
philprime merged 17 commits into
hotfix/8.49.2from
armcknight/profiling/test/mac-app-launch-profiling-config-file
Apr 29, 2025
Merged

fix(profiling): Change path of non-sandboxed macOS app launch profile configuration#5143
philprime merged 17 commits into
hotfix/8.49.2from
armcknight/profiling/test/mac-app-launch-profiling-config-file

Conversation

@armcknight

@armcknight armcknight commented Apr 28, 2025

Copy link
Copy Markdown
Member

reproduces the issue reported in #5142 and fixed in #5144

This extends the macOS-Swift project to have four app targets: two that are sandboxed, and two that are not.

This allows us to simulate the scenario where one mac app configures launch profiling thus writing the launch profile config file, and then a different app with a different bundle id tries to configure the SDK to never profile launches, but then still reads the config file from the common cache location and has the profiler run when it shouldn't.

The simulation runs the same way for each pair of apps (sandboxed and nonsandboxed). Only the nonsandboxed pair test should fail, since the sandboxed pair gets an automatically namespaced caches path.

#skip-changelog

@github-actions

Copy link
Copy Markdown
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:

  • Sources/Sentry/SentryFileManager.m

@codecov

codecov Bot commented Apr 28, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 92.90323% with 11 lines in your changes missing coverage. Please review.

Please upload report for BASE (hotfix/8.49.2@dd30b39). Learn more about missing BASE report.

Files with missing lines Patch % Lines
Sources/Sentry/SentryFileManager.m 84.126% 10 Missing ⚠️
Sources/Sentry/SentryProfiler.mm 0.000% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                @@
##             hotfix/8.49.2     #5143   +/-   ##
=================================================
  Coverage                 ?   92.798%           
=================================================
  Files                    ?       676           
  Lines                    ?     84024           
  Branches                 ?     30583           
=================================================
  Hits                     ?     77973           
  Misses                   ?      5950           
  Partials                 ?       101           
Files with missing lines Coverage Δ
...urces/Sentry/Profiling/SentryProfilerTestHelpers.m 87.804% <100.000%> (ø)
...ts/SentryTests/Helper/SentryFileManagerTests.swift 96.945% <100.000%> (ø)
Sources/Sentry/SentryProfiler.mm 90.000% <0.000%> (ø)
Sources/Sentry/SentryFileManager.m 94.412% <84.126%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dd30b39...50e1cb3. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Apr 28, 2025

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1227.24 ms 1248.61 ms 21.37 ms
Size 22.30 KiB 849.55 KiB 827.25 KiB

Previous results on branch: armcknight/profiling/test/mac-app-launch-profiling-config-file

Startup times

Revision Plain With Sentry Diff
dfab59c 1240.43 ms 1259.83 ms 19.40 ms
0ac3953 1212.67 ms 1236.52 ms 23.85 ms
987aede 1218.45 ms 1240.68 ms 22.23 ms
f699e3c 1203.06 ms 1238.67 ms 35.61 ms

App size

Revision Plain With Sentry Diff
dfab59c 22.30 KiB 851.81 KiB 829.51 KiB
0ac3953 22.30 KiB 851.81 KiB 829.50 KiB
987aede 22.30 KiB 851.81 KiB 829.51 KiB
f699e3c 22.31 KiB 851.81 KiB 829.51 KiB

Comment thread Samples/macOS-Swift/Shared/AppDelegate.swift Outdated
@philprime

Copy link
Copy Markdown
Member

I went ahead and fixed the paths to the Entitlements, as they were incorrect on my case-sensitive file-system.

@github-actions

Copy link
Copy Markdown
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:

  • Sources/Sentry/SentryFileManager.m

5 similar comments
@github-actions

Copy link
Copy Markdown
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:

  • Sources/Sentry/SentryFileManager.m

@github-actions

Copy link
Copy Markdown
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:

  • Sources/Sentry/SentryFileManager.m

@github-actions

Copy link
Copy Markdown
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:

  • Sources/Sentry/SentryFileManager.m

@github-actions

Copy link
Copy Markdown
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:

  • Sources/Sentry/SentryFileManager.m

@github-actions

Copy link
Copy Markdown
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:

  • Sources/Sentry/SentryFileManager.m

@armcknight
armcknight changed the base branch from main to hotfix/8.49.2 April 28, 2025 20:37
@armcknight
armcknight force-pushed the armcknight/profiling/test/mac-app-launch-profiling-config-file branch from c7a2fe0 to 219b35c Compare April 28, 2025 20:37
@github-actions

Copy link
Copy Markdown
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:

  • Sources/Sentry/SentryFileManager.m

@armcknight armcknight changed the title test: reproduce macOS profiling issue test(profiling): reproduce macOS profiling issue in UI test Apr 28, 2025
@github-actions

Copy link
Copy Markdown
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:

  • Sources/Sentry/SentryFileManager.m

@github-actions

Copy link
Copy Markdown
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:

  • Sources/Sentry/SentryFileManager.m

@github-actions

Copy link
Copy Markdown
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:

  • Sources/Sentry/SentryFileManager.m

@philprime philprime changed the title test(profiling): reproduce macOS profiling issue in UI test fix(profiling): Change path of non-sandboxed macOS app launch profile configuration Apr 29, 2025
@github-actions

Copy link
Copy Markdown
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:

  • Sources/Sentry/SentryFileManager.m

Comment thread Plans/iOS13-Swift_Base.xctestplan
Comment thread Samples/macOS-Swift/macOS-Swift.xcodeproj/project.pbxproj

@philprime philprime left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, still need wait for green CI

@github-actions

Copy link
Copy Markdown
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:

  • Sources/Sentry/SentryFileManager.m

@philipphofmann philipphofmann left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I only looked at the changelog and the actual fix but not at the sample apps. I trust @philprime s review.

Comment thread Sources/Sentry/include/SentryFileManager.h Outdated
Comment thread CHANGELOG.md Outdated
Comment thread Samples/macOS-Swift/Shared/AppDelegate.swift Outdated
@github-actions

Copy link
Copy Markdown
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:

  • Sources/Sentry/SentryFileManager.m

@philprime
philprime merged commit dbe67d1 into hotfix/8.49.2 Apr 29, 2025
@philprime
philprime deleted the armcknight/profiling/test/mac-app-launch-profiling-config-file branch April 29, 2025 15:08
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.

3 participants