Repository navigation
fix(parser): extract PowerShell functions, classes, methods and command calls - #1079
azizur100389 wants to merge 5 commits into
Conversation
code-review-graph reviewOverall risk: 0.40 (MEDIUM) — 12 changed function(s)/class(es), 0 affected flow(s), 3 test gap(s) Risk-scored changes
Test gaps
Token savings: this graph-backed report used ~193,007 fewer tokens (~99%) than reading every changed file in full (estimated, chars/4 approximation). Powered by code-review-graph — local-first analysis; no code leaves the CI runner. |
|
Thank you for this PR.
After you push the fix, I will test it again. |
|
Hi @tirth8205, the review issues have been fixed and pushed, with regression tests covering the reported cases. Numeric ranges no longer produce fake calls, including decimal, hexadecimal, binary, and suffixed literals. PowerShell test classification now uses the file path, so production DSC Test() methods are not marked as tests. I rechecked CI today: all 17 checks are passing, with the upgrade-path check intentionally skipped. The branch is also up to date with staging and has no merge conflicts. Could you please retest the updated PR when you have a chance? Thank you! |
Linked issue
Closes #1067.
What & why
PowerShell declarations were discarded because their grammar names are function_name/simple_name, and the configured call node did not exist. Read those names, index class_method_definition, and extract command calls. Treat the approved Test-* verb as production code outside test files. Regression coverage includes .ps1/.psm1 declarations, method scope, internal and top-level calls, test-file classification, and Python/Bash compatibility.
How it was tested
Following the same staged regression/baseline methodology used in my earlier PRs (#274, #276, #279, #353 and #354), against the current contribution target
stagingat6b12d11625cbec3b6773e076cb3d136464fa90e5.ruff check code_review_graph tests/test_powershell_extraction.py: clean.bandit -r code_review_graph/ -c pyproject.toml: zero findings.mypy code_review_graph/ --ignore-missing-imports --no-strict-optional: the same three existing Windowsfcntl.LOCK_EX/LOCK_NB/flockerrors indaemon.pyas unchanged staging; no new errors.Exact test commands (using a local virtual environment with
.[dev], asuvis not installed):Full local Windows suite completed: 4,149 passed, 111 failed, 819 skipped, 46 deselected, 2 xfailed, 2 xpassed; 86% coverage. Unchanged staging: 4,143 passed, 110 failed, with identical skip/xfail/xpass counts. All 110 staging failures also occur here. The one additional failure was
TestRealObserver::test_deleting_a_watched_directory_does_not_kill_the_watcherwithRuntimeError('Failed joining thread'); it passed 3/3 isolated reruns on this branch and 3/3 on unchanged staging, indicating an intermittent Windows observer thread failure. No reproducible new failure was found. The Git ceiling isolates temporary test repositories from an unrelated enclosing home-directory Git repository; PATH/PYTHONPATH point to each checkout under test. Browser tests passed in CI; browser and opt-in upgrade suites were excluded locally.