Repository navigation
fix(testmap): Python modules were offered as runnable test scripts - #236
Conversation
|
Note Reviews pausedUse the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe change adds evidence-based Python runner detection, root-scoped matching, command caching, safe path handling, and end-to-end tests for pytest, main guards, fallback runners, and isolated project roots. ChangesPython runner detection
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~45 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant TestRunnerIndex
participant PythonEvidence
participant ProjectRoot
participant RunnerHintTests
TestRunnerIndex->>PythonEvidence: inspect source and pytest evidence
PythonEvidence->>ProjectRoot: read configuration within crawl root
ProjectRoot-->>PythonEvidence: return matching project evidence
PythonEvidence-->>TestRunnerIndex: return validated runner
TestRunnerIndex-->>RunnerHintTests: emit runner hint
RunnerHintTests->>TestRunnerIndex: verify roots, commands, and unsafe paths
Merge Risk: ⚪ Minimal · up to The runner-hint paths have no identified merge-blocking issue. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Thanks @qinghuanandejiangshi. This makes run= trustworthy on Python repos: an agent in a Django/pytest tree now gets Must fix before merge
Optional, fine as a follow-up
CodeRabbit comments you can safely ignore
Queue: this PR is 3rd in landing order — #231 → #237 → #236 → #235 + #233 (reconciled together) → #224 → #44 (Windows, being refactored). |
|
CI note for @qinghuanandejiangshi: |
|
@coderabbitai pause |
✅ Action performedReviews paused. |
|
Fixed the must-fix in c2dc447: self-runnable kinds now return their own Also merged current main and reconciled the readWholeFile count separately in 87ba372, then refreshed the churn acknowledgement using the binary. Dev/ASan runhint gates, a cold ASan repository scan, and three deterministic comparisons passed. The full 634-gate run plus permission-only reruns finished with 631 passing and 3 conditional skips; details and the sanitizer limitation are in the updated PR description. The optional pytest follow-ups remain separate. |
|
The required Python runner ownership correction is in Rebuilt and reran the full suite on The whole-PR quality comparison against |
|
This PR is part of integration train 1b, #277, and will show as merged when that train lands. |
integration: train 1b — train 2b + regex guard and long-line crash, input blow-up guards, compile-time checks, hardened checks, reader fuzzers, #236
hazardpatterncheck (hardened-checks) was exact against its own base and red on the merged tree. Every edit below is a row the gate named: - B1: two rows deleted. redhat-et#251 moved the arch.h pathRuleForbids and search.h grepScanText handlers behind src/regexguard.h, which also retires the grepScanText FINDING (6 -> 5). - C: the four PENDING rows deleted (skilleval.h x3, wrap.h). Their fixes, f636b19 and af40182, are on main, and the gate printed a delete-the-row NOTE for each. - B2: one row added, regexguard.h throwIfMatchFaultInjected (redhat-et#251's RIPWIRE_FAULT_REGEX_MATCH switch). Its three call sites sit inside GuardedRegex's try blocks, which catch std::regex_error by type. - E: three rows added, worded like their pattern.h and slice.h siblings, after reading each body: - pythonrunner.h topLevelEvidence ts_parser_new (redhat-et#236), deleted on the grammar-refused return and right after the parse; - pythonrunner.h topLevelEvidence ts_parser_parse_string (redhat-et#236), the tree deleted after the walk; - slice.h sliceBuildParentIndex ts_tree_cursor_new (redhat-et#274 on main), deleted before the only return. Result: A, B1, B2, C, D and E all exact, rc=0. printf_parity: UPDATE_GOLDEN=1 with UPDATE_GOLDEN_EXPECT=help_all moved exactly that label (41 unchanged); the recheck is 42 PASS. Unchanged, and checked on the merged binary: readWholeFile is 22 by --uses (cppqualcheck's pin, rc=0), docs/COMMANDS.md still matches the binary (176 flags), and qschemetripcheck and cachefuzzcheck pass. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Python test modules received
run="python3 ..."even when importing the file runs no tests or fails without Django settings. Run hints now require a top-level main guard for direct Python execution, or pytest configuration between the test directory and its crawl root. Modules without that evidence retain the unknown-runner disclosure.Python rows use only their own evidence: an unknown module cannot borrow a sibling pytest/main-guard command, a same-stem shell script, or a script that mentions a matching substring. Non-script files retain the existing same-root fallback. Candidate commands are cached, and the parsers distinguish executable guards and configuration sections from documentation examples.
Closes #229.
Validation on macOS at final head
1c6ebbf4:runhintcheck.shpass, covering test-gate JSON, affected XML, situ text, positive runner controls, unknown runners, root boundaries, and hostile paths.f57a9df3: 635 gates, 632 passed, 3 conditional skips, 0 failures,tree_writes=0(1949.9 seconds). BothGOLD_BINandRIPWIRE_HEADBINpoint to a clean binary built from exact HEAD1c6ebbf4.editchecknotecheck,argvdiffcheck) andg1freshcheck, which looks specifically for an in-treeasan/ripwire. The sanitizer build here used a separate build directory.--no-cachescan pass; scan stderr is empty and XML is valid. LeakSanitizer is unavailable on this Apple arm64 runtime, sodetect_leaks=0was used; this is not a leak-check claim.--no-cacheare byte-identical across all three comparisons, and their XML is valid. The full suite's cppqual/format gates pass.c2dc4472.--quality-ack --scope=src/testmap.h --ack-only=gating. The explicit whole-PR quality comparisonf57a9df3..1c6ebbf4reports 0 gating findings, 1 acknowledged finding, and 1 non-gating new-symbol complexity finding (hasPytestSection: 16, threshold 15).Known follow-ups: additional pytest configuration formats remain unknown, and pytest's
-ppre-parser needs separate leading-dash path handling. Those optional review items are not included in this correction.