2.5 KiB
PR#85: The Merge Base Stands In for an Unknown Base Commit
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.
Problem
On 2026-10-06, tools/dry-run with werkrevisor 0.20.6 stopped on hs.hsadmin.ng #283 with
the base commit is unknown, so .werkrevisor.toml cannot be read.
The cause: #283 was a stacked PR on the branch mihoe/rbac-grant-reachability-closure,
which was deleted after the merge.
For such a PR, Gitea returns base.sha = '', but it still knows merge_base.
Since 0.21.0 (werkrevisor PR#39),
werkrevisor reads .werkrevisor.toml at the head of the default branch, so the review no longer stops.
The base commit stays empty, though:
the result comment says against base unknown, and the usage record has "base_sha": "".
Non-Goals
- No change for a PR whose base branch still exists:
base.shastays the base commit shown. - No change of the diff; Gitea computes it against the merge base anyway.
Specification
Feature: a review names a base commit also after the base branch was deleted
Scenario#85.01: the merge base stands in for an empty base commit
So that the result comment and the usage record name the commit the PR was reviewed against.
- Given a merged PR whose base branch was deleted, so Gitea returns an empty
base.shaand amerge_base - When werkrevisor reviews it without
WERKATOR_PR_BASE_SHA - Then the result comment and the usage record name the merge base as the base commit
Verified by
- test_flow.PublishAndUsageTest.test_the_merge_base_stands_in_for_the_base_of_a_deleted_branch
- test_flow.PublishAndUsageTest.test_the_base_sha_wins_over_the_merge_base
Solution
cli.base_committakesbase.shaand, if it is empty,merge_base;mainandexecuteuse it whenWERKATOR_PR_BASE_SHAis not set.- Both tests fail without the fallback.
- A dry run of hs.hsadmin.ng #283 showed
against base unknownwith 0.32.10 and its merge baseb95fe2ewith 0.32.11. - The guide for dev.hostsharing.net no longer names the bug as open.
- Werkbaum:
#ops.basecommit. - Version 0.32.11.
Open Questions
None.
Additional Changes
- Werkbaum: the idea
#model.codex, an optional review by the Codex CLI with a frontier model in a subscription.