Feat/verification configurable pipeline#200
Conversation
TestSuiteGate.verify ran pytest via a hard-coded python3 interpreter with cwd set to file_path.parent. For nested files this misses the repo's pyproject.toml / pytest.ini / conftest.py and may use a different interpreter/venv than the host process, causing false positives or undiscovered tests and CI-vs-local mismatch. - Run pytest via sys.executable instead of python3. - Set cwd to the resolved project root (project_root or file dir). - Prepend the project root to PYTHONPATH for layouts that rely on it. - Add tests asserting the interpreter, cwd, and PYTHONPATH. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Verification behaviour was mostly hard-coded: a fixed 45s test-gate timeout, a fixed check list and order, and no way to disable a check (e.g. the slow test gate) without code changes. Teams could not tune safety vs speed for their repo size, CI tier, or policy. - config.py: new VerificationConfig dataclass exposed as a `verification:` section of RefactronConfig — enabled_checks (which checks run, and in what order), short_circuit, test_gate_timeout_sec, and pytest_extra_args; loaded/saved via from_file/to_file - engine.py: VerificationEngine accepts a VerificationConfig, builds its checks from enabled_checks (unknown names raise a clear error), and verify() falls back to the configured short_circuit value - test_gate.py: TestSuiteGate takes timeout_sec and pytest_extra_args instead of a hard-coded 45s timeout and fixed pytest command - verify CLI: new --config flag threads the verification section into the engine; --all-checks still overrides short_circuit - docs: configuration.mdx documents defaults and migration (the section is optional; absent config reproduces prior behaviour) Also folds in the earlier verification work this builds on: JSON output (`refactron verify --json`), the run-all (--all-checks) mode, import cycle detection in ImportIntegrityVerifier, and package-aware TestSuiteGate relevance matching. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (14)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
solve #193
This change makes Refactron's verification pipeline configurable instead of hard-coded. Previously the pipeline used a fixed 45-second test-gate timeout, a fixed list and ordering of checks baked into VerificationEngine.init, and offered no first-class way to disable a check — for example skipping the slow test gate in a quick PR pipeline — without editing source code. As a result teams could not tune the safety-versus-speed trade-off for their repository size, CI tier, or review policy. This change introduces a VerificationConfig dataclass, surfaced as an optional verification: section of RefactronConfig, with four settings: enabled_checks (which checks run, and in what order), short_circuit (stop on first failure versus run them all), test_gate_timeout_sec, and pytest_extra_args. The config is loaded and saved through the existing from_file/to_file machinery, with a clear error message for invalid keys. VerificationEngine now accepts a VerificationConfig, builds its check list from enabled_checks (raising a clear ValueError on an unknown check name), and verify() falls back to the configured short_circuit value when a caller does not pass one explicitly. TestSuiteGate takes timeout_sec and pytest_extra_args parameters in place of the hard-coded timeout and fixed pytest command line. The refactron verify CLI gains a --config flag that threads the verification: section into the engine, while the existing --all-checks flag still overrides short_circuit. The configuration.mdx documentation gains a section covering the new keys, a defaults table, common recipes, and a migration note: the verification: section is entirely optional, and a config file without it reproduces the exact behaviour of earlier releases, so no action is required to upgrade. Thirteen new tests in test_verification_config.py cover the defaults, engine wiring, timeout threading, and config-file round-tripping, and all 67 verification tests pass. Note that the issue also mentioned refactron autofix --verify and refactron run; autofix is currently a stub that does not actually run verification and there is no refactron run command, so there was nothing live to thread config into there — config is fully wired into refactron verify and the VerificationEngine itself, so those commands will pick it up once implemented. This commit also folds in the earlier verification work it builds on: machine-readable JSON output for refactron verify, the run-all (--all-checks) mode, import cycle detection in ImportIntegrityVerifier, and package-aware TestSuiteGate relevance matching.