Skip to content

[Bug] file-content fetch failure logs omit PR number, making failed PR untraceable #710

@bitloi

Description

@bitloi

Description

When GitHub GraphQL file-content fetch fails in _fetch_file_contents_with_base_batch, the warning log does not include the PR number. This makes it hard to identify which PR failed during validator runs.

Steps to Reproduce

  1. Trigger fetch_file_contents_for_pr(...) for a PR with file changes.
  2. Make execute_graphql_query(...) return None for the file-content batch query.
  3. Check logs.

Expected Behavior

Warning should include repository and PR context, e.g.:
Failed to fetch file contents for owner/repo (PR #123)

Actual Behavior

Warning only includes repository:
Failed to fetch file contents for owner/repo

Environment

  • OS: Linux 6.8.0-90-generic
  • Python version: 3.12.3
  • Commit/Version: 7df6570

Additional Context

  • Scope should remain minimal:
    • keep deterministic fallback (FileContentPair(None, None))
    • no tuple-return API changes
    • no skip-vs-zero behavior changes
    • no None vs [] return-contract changes
  • This issue tracks the minimal observability improvement requested in PR review discussion around fix: skip PR scoring on file-content GraphQL fetch failure #645.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions