Skip to content

BUG-52: the GitHub adapter reads the first 300 changed files of a comparison as the complete list #199

Closed

Description

@ephico2real2

Part of #18

What is wrong: GitHubProvider.changed_paths reads the files of GitHub's compare answer as the full list of changed files. GitHub's description of that operation says: "The list of changed files is only shown on the first page of results, and it includes up to 300 changed files for the entire comparison." So a branch that changes more than 300 files has changed files that the adapter never sees. pr_checks uses the list to refuse a branch that touches a path outside the approved plan. A partial list reads there as a complete one.

Where: cmapi/src/cmapi/core/git/github.py:120-124 on 9a5a9d6 (changed_paths), and its caller cmapi/src/cmapi/jobs/pr_checks.py:65.

How to prove it: A test gives the adapter a compare answer with 300 files on a mock transport. Today changed_paths returns the 300 names and no error. After the fix the adapter says that the list is not complete (300 and 301 files), and it still returns a list of 299. A second test makes the host's list not complete for a request in pr_checks: cmapi/check fails and the request ends, and the job does not wait.

Measured or inferred: Read on 2026-11-13 from GitHub's published OpenAPI description (github/rest-api-description at 53fd7d2, GET /repos/{owner}/{repo}/compare/{basehead}), in spike #187. Not measured against GitHub: nothing here has run against GitHub (#61).

Severity: Low, and lower than the first text of this issue said. Corrected on 2026-11-13 while the fix was written: a plan of today has a few files, so a cut list of 300 names always holds paths outside the plan, and pr_checks already fails for it. The first text said that pr_checks then finds nothing outside the plan. That is true only for a plan of 300 files or more, which cmapi does not make today. The defect is that the port says "every path" and the adapter cannot keep that. pr_checks also requires the head of the branch to be the head that the bot wrote.

What must hold after the fix: A comparison whose file list can be cut is never read as complete. The check cmapi/check fails for such a branch, and its text says why.

Research: GitHub's description of the compare operation, quoted above. The same class as #87 (BUG-11), finding C3: "a partial list must not read as complete".

Solution (inline, not applied): In changed_paths: when the answer has 300 files or more, raise an error that says the list is not complete. In pr_checks: treat that error as a path outside the plan.

Class: No class. The fix makes an existing guard fail closed.

Activity

  1. added
    bug
    status:open
    sev:low
    In-Progress
    on Nov 13, 2026
  2. added a commit that references this issue on Nov 13, 2026
  3. added
    In-QA
    and removed
    In-Progress
    on Nov 13, 2026
  4. added a commit that references this issue on Nov 13, 2026
  5. added
    Done
    and removed
    In-QA
    on Nov 13, 2026
  6. ephico2real2 commented on Nov 13, 2026

    @ephico2real2
    OwnerAuthor

    Done: pull request #202 merged to main. GitHub Actions run 43527159058 was green on the exact head 82931b1 (six jobs). The merged tree is the tree that the native suite ran on: 713 passed. Native on macOS: test_github_compare_limit.py 4 passed; before the fix a compare answer with 300 files gave 300 names and no error. Codex gpt-6.1-sol reviewed the change and found no defect (docs/reviews/2026-11-13-issue-199/README.md). Not measured: GitHub itself (#61). The limit is from GitHub's documents.

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

    Donebugsev:lowstatus:open

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions