Skip to content

fix(review): the review pipeline reports the eight failures it now swallows, and reads a file in one place - #2196

Merged
dan-petty merged 1 commit into
mainfrom
fix/2160-review-pipeline-reports-failures
Oct 24, 2026
Merged

dan-petty merged 1 commit into
mainfrom
fix/2160-review-pipeline-reports-failures

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Summary

Eight except Exception handlers in src/devops_cli/ai/review/pipeline.py hid 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).

  • Pre-analysis, the admission of a finding and the threat-intelligence lookup catch only OSError from the read of a file, and record the file as a coverage gap: Pre-analysis: Permission denied, Admission: Permission denied, Threat intelligence: Permission denied.
  • Admission reads a cited file through one function, _read_cited_file. It replaces _file_content and _read_content.
  • The cache check of pre-analysis catches only OSError and ValueError. 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.
  • 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 (src/devops_cli/ai/analyze/scanner.py) treats a RecursionError of ast.parse as it treats a SyntaxError. 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.
  • The executive summary no longer gives an AI provider as the cause of an errored file. No AI call writes errored_files.
  • The swallowed-failures ceiling of ai/review/pipeline.py goes from 19 to 9.

Evidence:

Item

Closes #2160

Change: openspec/changes/archive/2026-10-24-2160-review-coverage-gaps/

…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
dan-petty marked this pull request as ready for review October 24, 2026 22:50
@dan-petty
dan-petty merged commit da401c6 into main Oct 24, 2026
17 checks passed
@dan-petty
dan-petty deleted the fix/2160-review-pipeline-reports-failures branch 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>
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.

fix(review): the review pipeline reports the eight failures it now swallows, and reads a file in one place

1 participant