-
Notifications
You must be signed in to change notification settings - Fork 119
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
Cross-Plattform Crash Reporting #4455
Conversation
Codecov ReportBase: 37.23% // Head: 35.50% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #4455 +/- ##
==========================================
- Coverage 37.23% 35.50% -1.73%
==========================================
Files 325 328 +3
Lines 21699 22038 +339
Branches 11739 11832 +93
==========================================
- Hits 8079 7825 -254
- Misses 6080 6778 +698
+ Partials 7540 7435 -105
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
src/cmake/sentry.cmake
Outdated
|
||
|
||
# Defines which OS builds can include sentry. Check src/cmake Lists for all values of MVPN_PLATFORM_NAME | ||
set(SENTRY_SUPPORTED_OS "windows" "macos") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why only these 2 platforms?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding it is trivial, but i assume that I cannot use the ExernalProject
with the PPA builds, as that would need to be present in the source bundle thing?
auto appLocal = appDatas.first() + "\\sentry"; | ||
sentry_options_set_dsn(options, Constants::SENTRY_DER); | ||
sentry_options_set_environment( | ||
options, Constants::inProduction() ? "production" : "stage"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are in prod. See the if-stmt at the top
// -> Maybe start a new Process for the Crash-Report UI ask for consent | ||
// -> Check if a setting "upload crashes" is present. | ||
// If we should not send it, we can discard the crash data here :) | ||
if (shouldSend) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check with legal if we can use the telemetry policy flag.
# this is super easy to link against and we do not need another binary shipped with the client. | ||
SET(SENTRY_ARGS -DSENTRY_BACKEND=breakpad -DSENTRY_BUILD_SHARED_LIBS=false -DSENTRY_TRANSPORT=none) | ||
endif() | ||
if(WIN32) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Can we use an elseif here? Also for the Android conditional.
|
||
|
||
# Defines which OS builds can include sentry. Check src/cmake Lists for all values of MVPN_PLATFORM_NAME | ||
set(SENTRY_SUPPORTED_OS "Windows" "Darwin" "Android") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why no iOS and Linux?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not tested so far, as i don't have a build machine setuped yet 😅.
For iOS I want to wait for it to be moved to cmake before i start that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heh, totally get that. Let's file tickets for the iOS and Linux work though, so we can keep track of it.
else() | ||
# Sentry is not supported on this Plattform. | ||
message("Sentry supported OS -> ${SENTRY_SUPPORTED_OS}") | ||
message("Cannot build sentry for ${CMAKE_SYSTEM_NAME}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I'd remove this message. It's redudant with the previous one and it looks like an error.
target_sources(mozillavpn PRIVATE | ||
tasks/sentry/tasksentry.cpp | ||
tasks/sentry/tasksentry.h | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: newline.
@@ -179,9 +178,6 @@ int CommandUI::run(QStringList& tokens) { | |||
std::cerr.clear(); | |||
} | |||
# endif | |||
|
|||
CrashClient::instance().start(CommandLineParser::argc(), | |||
CommandLineParser::argv()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: What are we removing here? What is the crash client? How is this related to the Sentry changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The crash client is a mini qt application we're shipping in the client. It shows the "ohno it's crashed, wanna upload?" prompt. It's currently only running under windows.
This line will make the crash client register itself for "structured exception handling", - which we don't want as sentry will do that.
On that note, I currently don't want to rip that whole thing out.... yet. We might still want to create the crash-ui process, in the sentry onCrash handler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, yeah my question was a precursor to me asking if you wanted to also just remove the whole thing. Thanks for clarifying!
src/sentry/sentryadapter.cpp
Outdated
* argument to this function. | ||
* The transport takes ownership of the `envelope`, and must free it once it | ||
* is done. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this also a doxygen style comment?
// Will be used if NONE_TRANSPORT is enabled | ||
// in that case this will be called if the client has a | ||
// report to send to Sentry. | ||
static void transportEnvelope(sentry_envelope_t* envelope, void* state); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the comment adding on this file. In mozilla-central docstrings are added to the header files too, right? I've been adding them to the .cpp file, maybe we should reach an agreement about this, happy to swich from .cpp to .h. On another note, I believe ideally we should use doxygen format comments, just because if we ever decide to auto generate docs based on these doc-comments it will be easier that way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mc has most in the header; Which i kind of like because I can easily can get a glimpse of what everything in the class is happening. :D
Totally with you about the standard comment, I already forgot that we agreed on a standard format :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOL, well me and you agreed. We should probably broadcast that. I agree with having it in the header. I'll do that from now on and also change the stuff that is not in the header!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File looks beautiful now with all the comments 💯
logger.debug() << "Sentry sent events"; | ||
emit completed(); | ||
}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: newline.
QByteArray m_envelope; | ||
}; | ||
|
||
#endif // TASKSENTRY_H |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: newline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Left some minor stuff. This is a great change, excited for those sentry reports!
src/featureslist.h
Outdated
"Sentry Crash Report SDK", // Feature name | ||
"2.13.0", // released | ||
FeatureCallback_false, // Can be flipped on | ||
FeatureCallback_false, // Can be flipped off |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not allow flipping it on and off?
/** | ||
* @brief Inits Sentry. | ||
* | ||
* This is a no-op if the client is in production mode. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: "This is a no-op if the "sentry" feature is turned off".
This way if we change the feature we don't need to update this again :)
Description
This PR adds experimental crash reporting support using sentry-native.
The feature is disabled by default, only enabled when we're on guardian-stage.
By Crossplattform, i mean osx and windows for now :) - Linux should be straightforward to add, i don't have a vm to test that on right now.
Android & iOS are theoretically supported. We need to either figurre out how to get this into the qmake structure, or port those plattforms finally to cmake again like (#4301)
##Ref
https://mozilla-hub.atlassian.net/browse/VPN-2822
Checklist