hive-forge: don't assert 'conflicts' from a bare mergeable=false

This commit is contained in:
damocles 2026-08-13 11:23:58 +02:00 committed by mara
commit dd5ccb5ce7
2 changed files with 27 additions and 2 deletions

View file

@ -127,8 +127,18 @@ pub fn run(client: &Client, args: Args) -> Result<()> {
fn check_ready(client: &Client, repo: &str, number: u64, pull: &PullRequest) -> Result<()> {
match pull.mergeable {
Some(true) => {}
// Forgejo's `mergeable` is one boolean covering several distinct
// causes (draft, a real conflict, a blocked required check, ...) —
// asserting "conflicts" and telling the caller to rebase is only
// correct for one of those causes and actively wrong advice for the
// others (rebasing a draft does nothing). Only name the
// cause when the API actually confirms it (draft); otherwise report
// the bare observation and let `pr-status` be consulted for detail.
Some(false) if pull.draft.unwrap_or(false) => bail!(
"pr-merge: PR #{number} is a draft, not mergeable. Mark it ready for review, or pass --force."
),
Some(false) => bail!(
"pr-merge: PR #{number} is not mergeable (conflicts). Rebase it, or pass --force."
"pr-merge: PR #{number} is not mergeable. Check `pr-status --pr {number}` for detail, or pass --force."
),
None => bail!(
"pr-merge: PR #{number} mergeability is still being computed. Retry shortly, or pass --force."