Skip to content

Improve parsing of plugin arguments in target-query#1619

Open
yunzheng wants to merge 3 commits intomainfrom
bugfix/target-query-argparse-handling
Open

Improve parsing of plugin arguments in target-query#1619
yunzheng wants to merge 3 commits intomainfrom
bugfix/target-query-argparse-handling

Conversation

@yunzheng
Copy link
Copy Markdown
Member

@yunzheng yunzheng commented Mar 13, 2026

This PR implements the suggested solution described in #1508, the described edgecase is left open.

It mainly gets the supported argparse arguments from the requested plugins to target-query, and then reparses the arguments again so it properly parses known plugin flags. This essentially fixes the problem described in the issue.

Unknown arguments/flags now also throw an error, which before would go unnoticed.

resolves #1508, #1362

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 13, 2026

Codecov Report

❌ Patch coverage is 91.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 81.12%. Comparing base (945ad90) to head (f8505bc).

Files with missing lines Patch % Lines
dissect/target/tools/query.py 90.90% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1619      +/-   ##
==========================================
+ Coverage   81.09%   81.12%   +0.02%     
==========================================
  Files         402      402              
  Lines       35264    35274      +10     
==========================================
+ Hits        28599    28616      +17     
+ Misses       6665     6658       -7     
Flag Coverage Δ
unittests 81.12% <91.66%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 13, 2026

Merging this PR will not alter performance

✅ 12 untouched benchmarks


Comparing bugfix/target-query-argparse-handling (f8505bc) with main (945ad90)

Open in CodSpeed

@yunzheng yunzheng force-pushed the bugfix/target-query-argparse-handling branch from 750b9ea to 3c8b561 Compare March 13, 2026 09:50
@JSCU-CNI
Copy link
Copy Markdown
Contributor

Perhaps this makes implementing #1493 easier.

@yunzheng
Copy link
Copy Markdown
Member Author

yunzheng commented Mar 13, 2026

Windows tests are failing due to windows_path vs posix_path. will look into it later.

update: changed the test to match on inode instead

@yunzheng yunzheng force-pushed the bugfix/target-query-argparse-handling branch from 788599e to 9b53c3c Compare March 13, 2026 14:11
@yunzheng yunzheng force-pushed the bugfix/target-query-argparse-handling branch from 9b53c3c to f8505bc Compare March 20, 2026 20:34
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.

Target-query runtime arguments interpreted as TARGET

2 participants