Skip to content

PR iteration preflight rejects accessible head repositories when gh returns an empty nameWithOwner #39

Closed

Description

@dkropachev

Problem

dk-pr-iter stops at preflight with PR head repository is unavailable for an accessible PR because repository identity resolution relies on gh pr view returning a nonempty headRepository.nameWithOwner.

Observed with dk-workflows 1.1.23 in Codex on Linux and GitHub CLI 2.86.0, against dk-code-factory/code-factory-plugin#7. The PR is open, is not cross-repository, and the authenticated account has push access. Retrying configuration refresh produced the same error. No branch or PR changes were made.

Reproduction and evidence

  1. Run the iteration preflight for the PR above:

    python3 runtime/dk-pr-iter/scripts/preflight.py --cwd /path/to/code-factory-plugin --pr https://github.com/dk-code-factory/code-factory-plugin/pull/7

    It exits 1 with ready: false. The reviewers and diagnostics checks report dk-config: PR head repository is unavailable; the completion check reports completion: PR head repository is unavailable. Reviewer and completion configuration cannot be resolved.

  2. Query the same metadata through GitHub CLI:

    gh pr view https://github.com/dk-code-factory/code-factory-plugin/pull/7 --json url,headRepository
    {"headRepository":{"id":"R_kgDOVSGpNg","name":"code-factory-plugin","nameWithOwner":""},"url":"https://github.com/dk-code-factory/code-factory-plugin/pull/7"}
  3. Query GitHub GraphQL directly:

    gh api graphql -f 'query={repository(owner:"dk-code-factory",name:"code-factory-plugin"){pullRequest(number:7){headRepository{nameWithOwner}}}}'
    {"data":{"repository":{"pullRequest":{"headRepository":{"nameWithOwner":"dk-code-factory/code-factory-plugin"}}}}}

    The REST pull-request endpoint also returns head.repo.full_name as dk-code-factory/code-factory-plugin.

Expected behavior

Resolve the head repository from verifiable live GitHub metadata when the CLI view omits or empties nameWithOwner, so accessible PRs can reach the remaining preflight checks. Preserve correct fork/base configuration lookup and publication guards. If the head repository cannot actually be verified, continue to fail closed with an actionable error.

The discrepancy above is verified; its underlying cause in the CLI or API interaction has not been established.

Activity

  1. added 2 commits that reference this issue on Oct 26, 2026
    573d657
    c5cfed9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions