apport:main

Last commit made on 2024-05-23
Get this branch:
git clone -b main https://git.launchpad.net/apport

Branch merges

Branch information

Name:
main
Repository:
lp:apport

Recent commits

7a40931... by Benjamin Drung

crashdb: make _duplicate_db_sync_status more readable

Coverity 2023.9.2 rule COV_PY_COPY_PASTE_ERROR_PYTHON complains about
`real_fixed_version` in `CrashDatabase.duplicate_db_fixed` looks like a
copy-paste error.

For the "crash got reopened" case, `real_fixed_version` is `None` and
therefore the call to `duplicate_db_fixed` sets the fixed version back
to 'still unfixed'. Make that code more readable by explicitly passing
`None` to `duplicate_db_fixed`.

Signed-off-by: Benjamin Drung <email address hidden>

4361d6f... by Benjamin Drung

ui: refactor suppress evaluation in parse_argv

Coverity 2023.9.2 rule COV_PY_FORWARD_NULL_PYTHON complains about
accessing a property of null-like value "cmd". Refactor the code to
satisfy Coverity.

Signed-off-by: Benjamin Drung <email address hidden>

f8bd184... by Benjamin Drung

report: Fix possible None.startswith() call

In `Report._gen_stacktrace_top` `fn` might be set to `None` and calling
`fn.startswith` will fail in that case.

Signed-off-by: Benjamin Drung <email address hidden>

12d3445... by Benjamin Drung

launchpad: fix dynamic adaption of chunck size

The chunk size in `HTTPSProgressConnection.send` starts with 1024. The
chunk size is checked for being bigger than 1024 before increasing or
decreasing it. Therefore this condition will never met and the chunk
size will stay at 1024.

Only check for the chunk size to be bigger than 1024 before decreasing
it (not before increasing it).

I ran the integration tests locally, but `HTTPSProgressConnection` is
not covered by it:

```
TEST_LAUNCHPAD=1 pytest -ra --cov=. --cov-report=html --cov-branch tests/integration/test_crashdb_launchpad.py
```

6ef0b15... by Benjamin Drung

launchpad: calculate duration only once

Make the code more readable by introducing `duration` variable.

7f6e572... by Benjamin Drung

apt_dpkg: split _search_contents into smaller methods

Split `__AptDpkgPackageInfo._search_contents()` into smaller methods to
make the code more readable and modifiable.

Signed-off-by: Benjamin Drung <email address hidden>

adfe369... by Benjamin Drung

apport: Ignore container crash reports from systemd-coredump

systemd-coredump stores crashes that happen inside a container on the
host in case it cannot forward the crash to the container. Apport cannot
do anything useful with these crash reports, because the information
about the crashed process does not contain the process number seen from
inside the container and because the crashed process is already gone
when Apport gets the crash from systemd-coredump.

So let Apport just ignore crash reports from systemd-coredump if the
crashes happened inside containers.

Bug-Ubuntu: https://launchpad.net/bugs/2063349
Signed-off-by: Benjamin Drung <email address hidden>

04af911... by Benjamin Drung

test: fix test_missing_uid

`Report._get_ignore_dom()` calls `os.geteuid()` instead of
`os.getuid()`.

Fix `test_missing_uid` to mock `os.geteuid` instead of `os.getuid`, use
`MagicMock`, and check that the mock was called.

e856e0b... by Shivaram Lingamneni

remove dependency on python-requests

Importing `requests` uses about 10 MB of additional memory and costs
about 100 milliseconds. My personal motivation is more to push backwards
against the increasing size and complexity of the Ubuntu base system, or
alternatively, to reduce the number of projects that constitute critical
infrastructure for Linux.

`urllib.request` raises an exception for anything other than a 20x
by default (this is `urllib.request.HTTPErrorHandler`).

5f797ca... by Benjamin Drung

setup: determine udev directory dynamically

On /usr merged systems like Ubuntu 24.04 the udev rules are placed into
`/usr/lib/udev/rules.d` instead of `/lib/udev/rules.d`.

Determine the location of the udev directory from the pkg-config file
and fallback to the old location on failure. Install `pkg-config` in the
`system-installed` test.

Signed-off-by: Benjamin Drung <email address hidden>