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
ui: don't rely on Dependencies to know if collect_info() has been run #224
Conversation
Codecov Report
@@ Coverage Diff @@
## main #224 +/- ##
=======================================
Coverage 82.81% 82.81%
=======================================
Files 91 91
Lines 18736 18737 +1
=======================================
+ Hits 15516 15517 +1
Misses 3220 3220
|
6f65a7a
to
0c74e9a
Compare
I modified apport/ui.py locally with these changes and they worked for me i.e. a crash report was successfully uploaded to the Error Tracker. |
Ever since we've started collecting deps info at crash file creation, that code path was essentially dead, and that resulted in the _MarkForUpload field never touched in some circumstances. This quick workaround is to actually check for that internal field instead, as it's *only* written in collect_info(), but I think we'll need a better solution in the long term. Fixes: ea64857 ("feat: Already add package info during crash") Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/apport/+bug/2038650 Signed-off-by: Simon Chopin <simon.chopin@canonical.com>
We started collecting deps in the initial crash file to hopefully have a more exact picture of the system at the time of the crash. This should also be reflected in the test data. This enables coverage for the commit "ui: don't rely on Dependencies to know if collect_info() has been run" Signed-off-by: Simon Chopin <simon.chopin@canonical.com>
0c74e9a
to
a16de4e
Compare
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: collect_info
has a "skip if we already ran" check and returns for ProblemType
!= Crash
and Dependencies
present. Have you tested this code path?
thought: collect_info
sets self.report["_MarkForUpload"] = "True"
as first step. So checking for this field means "started collection" and not "finished collection". Moving setting _MarkForUpload
might change that.
You are indeed right that there's a change of behaviour for non-crash reports: now they might actually get uploaded! Except for Hang reports that are marked for upload on their own, any non-crash report that would come in with already-populated Dependencies would have been totally ignored. With this fix at least we get some data. I haven't tested though, as I don't have the first idea how to trigger non-crash reports, and crafting bogus reports would hardly prove anything. As far as moving |
Besides the I'll merge this PR since it is a first step in the right direction. |
There is also the |
Ever since we've started collecting deps info at crash file creation, that code path was essentially dead, and that resulted in the _MarkForUpload field never touched in some circumstances.
This quick workaround is to actually check for that internal field instead, as it's only written in collect_info(), but I think we'll need a better solution in the long term.
Fixes: ea64857 ("feat: Already add package info during crash")
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/apport/+bug/2038650