Skip to content

Conversation

@bdrung
Copy link
Member

@bdrung bdrung commented Jun 12, 2025

I was working on https://launchpad.net/bugs/2098792 and reading the code add_proc_info for that. This PR is the result of making the code more readable. Then I noticed that _add_executable_timestamp was not called by add_proc_info in these crashes.

See individual commits for details.

bdrung added 4 commits June 12, 2025 11:29
`Report.add_proc_info` will always set `proc_pid_fd`. So the helper
function `_read_proc_link` is not needed any more.
`Report.add_proc_info` will always set `proc_pid_fd`. So the case for
`dir_fd` being `None` in `_read_proc_file` can be dropped and the
parameter `pid` will not be needed any more.
Add the helper method `_add_executable_path` to break down the big
method.
Split the big `Report.add_proc_info` method into two methods.
@codecov
Copy link

codecov bot commented Jun 12, 2025

Codecov Report

Attention: Patch coverage is 66.66667% with 8 lines in your changes missing coverage. Please review.

Project coverage is 84.22%. Comparing base (f713fe1) to head (24ca7b7).

Files with missing lines Patch % Lines
apport/report.py 66.66% 6 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #539   +/-   ##
=======================================
  Coverage   84.21%   84.22%           
=======================================
  Files         104      104           
  Lines       20778    20776    -2     
  Branches     3253     3251    -2     
=======================================
  Hits        17498    17498           
  Misses       2827     2827           
+ Partials      453      451    -2     

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

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

@bdrung bdrung added this to the 2.34.0 milestone Jun 12, 2025
@bdrung bdrung requested a review from schopin-pro June 12, 2025 12:29
Copy link
Contributor

@schopin-pro schopin-pro left a comment

Choose a reason for hiding this comment

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

Let's be clear: if it's not a bugfix (as in, an actual bug encountered by real people, not a linter or typechecker complaint), I'll just ignore any review request. This one falls clearly in the "not a bugfix" category.

@bdrung bdrung removed this from the 2.34.0 milestone Jul 4, 2025
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