Repository navigation
fix(review): the review pipeline reports the eight failures it now swallows, and reads a file in one place - #2196
Merged
Conversation
…allows, and reads a file in one place Eight `except Exception` handlers in `ai/review/pipeline.py` hid a failure that changes what a review checks. Each handler now catches only the error that its call raises, and a failure that changes the scope of the review goes into the report as a coverage gap with the stage and the reason. - Pre-analysis, the admission of a finding and the threat-intelligence lookup catch only `OSError` from the read of a file. Each records the file in `errored_files`, which the report shows in its table of skipped and errored files. - Admission reads a cited file through one function, `_read_cited_file`, in place of `_file_content` and `_read_content`. - The cache check catches only `OSError` and `ValueError`, treats a cached time with no time zone as a cache miss, and compares the file time as a number. - The handlers around `find_repo_root`, `list_repo_files` and the preparation of a path are deleted: these calls raise nothing for a path that the file system accepts. - `_analyze_python_ast` treats a `RecursionError` of `ast.parse` as a `SyntaxError`, so a Python file with a very deep expression gets its metadata from its text and does not stop the review. - The executive summary no longer gives an AI provider as the cause of an errored file. - The swallowed-failures ceiling of the file goes from 19 to 9. Closes #2160
dan-petty
marked this pull request as ready for review
October 24, 2026 22:50
dan-petty
pushed a commit
that referenced
this pull request
Oct 24, 2026
🤖 I have created a release *beep* *boop* --- ## [0.4.3](v0.4.2...v0.4.3) (2026-10-24) ### Bug Fixes * **k8s:** a manual sync of the app-of-apps drops the homelab host overrides and every public hostname returns 404 ([#2195](#2195)) ([7c97467](7c97467)) * **review:** the review pipeline reports the eight failures it now swallows, and reads a file in one place ([#2196](#2196)) ([da401c6](da401c6)), closes [#2160](#2160) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Eight
except Exceptionhandlers insrc/devops_cli/ai/review/pipeline.pyhid a failure that changes what a review checks, and the review did not tell the user. This change makes each handler catch only the error that its call raises. A failure that changes the scope of the review now goes into the report as a coverage gap, with the stage and the reason, in the table of skipped and errored files (errored_files).OSErrorfrom the read of a file, and record the file as a coverage gap:Pre-analysis: Permission denied,Admission: Permission denied,Threat intelligence: Permission denied._read_cited_file. It replaces_file_contentand_read_content.OSErrorandValueError. A cached time with no time zone is a cache miss, and the check compares the file time as a number, so no comparison raises.find_repo_root,list_repo_filesand the preparation of a path are deleted. These calls raise nothing for a path that the file system accepts._analyze_python_ast(src/devops_cli/ai/analyze/scanner.py) treats aRecursionErrorofast.parseas it treats aSyntaxError. Without this, the narrower pre-analysis handler would stop the review on a Python file with an expression of 50,000 or more chained terms (about 100 KB). The base code gave such a file no metadata and said nothing.errored_files.ai/review/pipeline.pygoes from 19 to 9.Evidence:
uv run ruff check --select BLE001,S110,S112 src/devops_cli/ai/review/pipeline.pygave 19 sites at base, and gives 9 now. The 9 that stay belong to other open issues (lines 1809, 1862 and 2437 at base to fix(review): a failed base-file read counts as an absent file, and an empty pull request diff raises is no diff #1907; 852 and 863 to fix(security): cloudflare radar lookups use the documented radar api with the configured token, and a failed lookup is reported as unavailable, never as verified #1429; 200 to fix(config): service clients use only configured urls and never fall back to an unconfigured localhost default #1165) or to the payload-init handler that already reports its cause.Path.is_file(), and its read raisesPermissionError(strerror"Permission denied").find_repo_rootandlist_repo_filesraised nothing for a symbolic link loop or a directory with no permissions, and raiseValueErroronly for a path with a NUL character. For such a target, the constructor at base also raisedValueError, fromreviewed_tree.list_repo_filesfails and a test wherefind_repo_rootfails. Such a test must patch adevops_cliname, which docs/TESTING.md forbids. The two handlers were dead code, so the change deletes them, as docs/TESTING.md says.uv run devops ci fail-to-pass --base origin/main: 7 failed on base. The four new tests intests/ai/review/test_coverage_gaps.pyfailed for the right reason (no row in the table of skipped and errored files, or no metadata for the deep file). Three changed tests failed because the signature of a private function changed.Item
Closes #2160
Change:
openspec/changes/archive/2026-10-24-2160-review-coverage-gaps/