Include OSPlugin functions in `find_functions` output
This PR fixes a (slightly different) regression of https://github.com/fox-it/dissect.target/issues/421.
Since the plugin internals refactor #889 only __regular__ plugins are returned when invoking find_functions (-> _generate_long_paths). Previously OSPlugin specific functions were also returned.
See the added test for steps how to reproduce using target-query -l "*" <target>.
Codecov Report
:x: Patch coverage is 88.37209% with 5 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 80.70%. Comparing base (4ae4dbc) to head (f648a70).
:warning: Report is 1 commits behind head on main.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| dissect/target/tools/utils.py | 66.66% | 3 Missing :warning: |
| dissect/target/plugin.py | 94.11% | 2 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #1135 +/- ##
==========================================
- Coverage 80.70% 80.70% -0.01%
==========================================
Files 374 374
Lines 33288 33286 -2
==========================================
- Hits 26865 26863 -2
Misses 6423 6423
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 80.70% <88.37%> (-0.01%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
Seems like something here is not deterministic. Sometimes the path of the selected plugin is "os.unix._os.users" and sometimes it is "os.unix.linux._os.users"
CodSpeed Performance Report
Merging #1135 will not alter performance
Comparing JSCU-CNI:fix/os-functions-filter-tree-match (f648a70) with main (4ae4dbc)
Summary
✅ 8 untouched benchmarks
Is there anything we can do to move this PR forward?
It seems part of this PR was implemented by @Miauwkeru in https://github.com/fox-it/dissect.target/commit/fb96bdd4886bd8f7828feb67321ef23f00ef387b.
@JSCU-CNI I've made some changes, let me know if this works in line with how you would expect this to work. I've made it so that wildcarding will only pick up "OS functions" from the target's own OS (and superclasses). This also works reliably on DefaultOSPlugin now.
I also changed some tests around, removing the atrocious mock data that was there before with something more realistic (and way easier to debug and wrap your head around).
Completely missed this, thanks for the commit @Schamper. At a first glance this seems to achieve exactly what we want.