werkator build succeeded after 00:34
PR-Agent logs a 404 as ERROR when it asks for the base version of an added file or the head version of a deleted one; werkrevisor now filters exactly that line. Details: the PR document under `docs/prs/`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Reviewed-on: #13 Co-authored-by: claude-code <claude-code@javagil.de>
2.6 KiB
2.6 KiB
PR#13: No error in the log for the missing version of an added, deleted or renamed file
WARNING: This document describes only the change applied in this PR. It may already be outdated once the next PR is merged. Historic PR documentation is not maintained along with new PRs; treat it as a snapshot.
The Problem
PR-Agent asks Gitea for the base version of every changed file and for the head version as well.
An added or renamed file has no base version under its path, and a deleted file has no head version, so Gitea answers 404.
PR-Agent logs that as ERROR … Error getting file: <path>, content: (404).
The build log of PR#12 showed three such lines, although the review was complete.
Non-Goals
- No change to what PR-Agent sends to the model.
- Other errors of PR-Agent stay visible, also a 404 for a file that the PR only changes.
The Scenarios
Feature: the build log shows only real errors
Scenario#13.01: the missing version of an added, deleted or renamed file is not logged
So that a complete review has an error-free log.
- Given a PR that adds
docs/prs/2026-10-05-PR#12-x.md, deletesold.pyand renameso.pyton.py - When PR-Agent logs
Error getting file: <path>, content: (404)for one of these files - Then the line does not appear in the log
Verified by
- test_logging.ExpectedMissingVersionTest.test_404_for_an_added_deleted_or_renamed_file_is_not_logged
- test_logging.AddedDeletedRenamedTest.test_the_review_notes_the_added_deleted_and_renamed_files
- test_logging.AddedDeletedRenamedTest.test_changed_file_knows_added_deleted_and_renamed
Scenario#13.02: other errors stay in the log
So that a real problem still shows.
- Given a PR that adds
new.py - When PR-Agent logs a 404 for a changed file, a 500 for
new.pyor another error - Then the line appears in the log
Verified by
The Solution
werkrevisor/review.pyfilters this log line of PR-Agent's Gitea provider, and only for the files that the PR adds, deletes or renames.- PR-Agent asks for both versions under the new path, also for a renamed file, so the old path never gives a 404.
- The line does not say which version failed, so a real 404 on the other version of such a file is hidden too. That risk is small: a file whose content is really missing still shows in the coverage check of werkrevisor.
ChangedFile.addedandChangedFile.renamedname an added and a renamed file.- werkrevisor 0.13.2.