← Back to Pull requests

Oppiabot GitHub client #386

Open
Yashbhu opened this pull request with 3668 lines diff across 23 files
View on GitHub
Yashbhu Yashbhu commented on Oct 16, 2026 23:45 UTC
Author

Explanation

This PR adds OppiabotGitHubClient, the common GitHub API abstraction required by the unified TypeScript-based Oppiabot architecture.

Tracked by issue: [#378 (comment)](https://github.com/oppia/oppiabot/issues/378#issue-5584987382)

TDD: [Oppiabot TDD](https://docs.google.com/document/d/1xk6LARVtFoi6xO-EoXSBAXP-vhBYQFvM94KRw1jDb9A/edit?tab=t.0)

Changes

  • Add OppiabotGitHubClient and the GitHub operations required by the migrated workflows.

  • Add GitHubApiClient as the GitHub API abstraction used by OppiabotGitHubClient.

  • Add OppiabotGitHubClientError for GitHub API failures while preserving the underlying error as its cause.

  • Add pagination for every list operation (listIssues, listPullRequests, listPullRequestReviews, listChangedFiles), so scheduled sweeps never see a silently truncated result set.

  • Filter pull requests out of listIssues, matching the legacy getAllOpenIssues() helper; plugins that need pull requests call listPullRequests.

  • Add unit tests covering repository scoping, GitHub API operations, pagination, search scoping, and error handling.

  • Export OppiabotGitHubClient and OppiabotGitHubClientError through the core index.

  • Keep all existing legacy Oppiabot implementation unchanged.
  • Dry-Run support, Core Engine integration, and plugin execution are handled in subsequent PRs.

    Deferred GitHub operations

    The TDD's plugin mapping also requires GitHub operations that this PR does not yet expose: setting or updating a commit status (Pass-Key / Commit-Status Checks, Don't-Merge Enforcement), dismissing reviews (Review Dismissal for Late File Changes), updating pull-request information (Title Formatting & Issue Association), and requesting or removing reviewers (Assignment Switching). These are added incrementally through the client in the PRs for the plugins that need them, so no plugin calls Octokit directly.

    Stacking

    Parent: #379 — Execution Context.
    Children: #385 — Core Engine Execution.

    New commits (review these)

    9ab2d9a, afed177, 878fbc7, 5a7600a, 93aae8b, aee472f, f9aed8b, 925cf47, c5d7f57, 25e020e, 77e1abb, e50bba0, 3ed4dd1.

    Inherited changes (don't re-review)

  • #377 — Core Engine and Plugin Framework.

  • #379 — Execution Context.
  • Replaces closed PR #381.

    Checklist

  • I have successfully deployed my own instance of Oppiabot. You can find instructions for doing this [here](https://github.com/oppia/oppiabot/wiki/Deploying-your-own-instance-of-oppiabot).

  • I have manually tested all the changes made in this PR following the [manual tests matrix](https://github.com/oppia/oppiabot/wiki/Manual-Tests-Matrix).
  • Diff: 3668 lines (+3661 / -7) across 23 files Reviewer: U8NWXD Review duration: 72034m
    All Vouch review confidence checks passed
    Residual risk 0.42 = Change Risk (0.84) × (1 − Review Confidence (0.49)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.84 · 3668 lines diff across 23 files
    0.84
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.23 · 3 substantive comment(s)
    0.23
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    49%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.400
    Shallow Review Depth shallow_review_depth
    0.269
    Mass File Touch mass_file_touch
    0.080
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    4 items
    Yashbhu Yashbhu commented on Oct 17, 2026 01:42 UTC
    Author

    @lkbhitesh07 @U8NWXD PTAL

    Yashbhu Yashbhu commented on Oct 17, 2026 01:43 UTC
    Author

    this PR is third PR after https://github.com/oppia/oppiabot/pull/379 this PR

    Yashbhu Yashbhu commented on Oct 20, 2026 23:41 UTC
    Author

    @lkbhitesh07 PTAL

    Reviewers
    Assignees
    Yashbhu Yashbhu
    Labels
    risk: medium confidence: 49.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 83.5% (HIGH) · Higher = larger blast radius
    83.5%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 49.5% · Lower = rushed or shallow review
    49.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 42.2% · Moderate risk
    42.2%
    Repository