Skip to content

fix(roadmap): readiness skips PRs above 300 files #7321

Done

Description

@dan-petty

Problem

devops pr check-readiness and devops pr ready cannot judge the change folder of a pull request that changes more than 300 files. They read the file list from the GitHub compare reply, which holds at most 300 files, and report the pull request as blocked.

Evidence

#7317 changes 503 files and adds its archived change folder. The tool reported "is not judged on its change folder" while GitHub reported the pull request as mergeable and clean.

Done when

  • The check reads every changed file, for example with the paged list of the files of the pull request or with local git, and judges a pull request above 300 files. A test fails on the base.

Alternatives check of 2026-11-26: none.
Tool: none found.
Reason: Searches found only GitHub SDKs and CI actions that can page a PR file list; none judges a change folder, and the issue's own remedy is internal paging of the PR files endpoint or local git.

Lacks:

  • No readiness verdict on a change folder
  • Adds a GitHub SDK dependency for one paginated call
  • CI action needs a workflow step outside the CLI

Proposed design

Problem statement

devops pr check-readiness and devops pr ready judge a pull request's change folder from the compare answer of the tip of its base branch and its head commit. GitHub lists at most 300 files of one comparison, so a pull request that changes more files (503 in #7317) is reported as not judged on its change folder, although GitHub reports it mergeable. The fix completes a compare answer that holds the limit with the local three-dot diff at the compare's own merge base, so the check reads every changed file while still reading the merge-base diff rather than the pull request's stale file list.

Acceptance criteria

Requirement: File list above the compare limit

The readiness check SHALL judge the change folder of a pull request that changes more than 300 files.

Scenario: 503 changed files

  • WHEN the doubled GitHub session returns a compare answer of 300 files, and the doubled process edge answers the three-dot git diff --name-status -z --find-renames with 503 files whose last entry adds the archived change folder of the issue
  • THEN the verdict holds no blocker that the pull request is not judged on its change folder, and holds no blocker that it adds no file to the change folder

Requirement: Completion at the compare's merge base

The check SHALL complete a compare answer that holds CONST_GITHUB_COMPARE_FILES_LIMIT files with the three-dot diff of the merge base that the answer gives and the head commit.

Scenario: The git command

  • WHEN a test runs the readiness check for a pull request whose compare answer holds 300 files and gives the merge base abc123
  • THEN the process edge records git diff --name-status -z --find-renames abc123...<head-sha> -- and the check holds the files of that answer

Requirement: No pulls files request

The readiness run MUST NOT read the changed files from the pulls files endpoint.

Scenario: A compare answer at the limit

  • WHEN a test runs the readiness check for a pull request whose compare answer holds 300 files
  • THEN the session receives no request whose path ends with /pulls/<number>/files, and the changed files come from the three-dot diff

Requirement: Unreadable local diff

When the three-dot diff lists no file, the check SHALL report the file list as possibly truncated and MUST NOT report the change folder as absent.

Scenario: No checkout of the head

  • WHEN the compare answer holds 300 files and the doubled process edge answers the three-dot git diff with a failed status and no output
  • THEN the verdict holds the truncation blocker that names 300 files and holds no blocker that the pull request adds no file to the change folder

Requirement: Git statuses read as GitHub statuses

The completion MUST give each file the status that the readiness rules read, a deleted file as removed and a rename's old path as its previous filename.

Scenario: A deleted active change folder

  • WHEN the three-dot diff lists D openspec/changes/1234-a-change/proposal.md and A openspec/changes/archive/2026-11-28-1234-a-change/proposal.md
  • THEN the completion gives the first file the status removed and the second added, and the verdict names the archived folder as the change the pull request adds

Requirement: Regression test on the base

The new test MUST fail on the base commit and pass with the fix.

Scenario: Test at the base commit

  • WHEN the new test of the 503-file case runs against the base commit
  • THEN the test fails because the check reports that the pull request is not judged on its change folder

Existing Tool Considered

git, the open tool the project already runs through list_changed_files (src/devops_cli/git/operations.py:597, command src/devops_cli/git/operations.py:580), covers the need: its --name-status -z --find-renames three-dot diff at the compare's merge base lists every changed file with its status and rename source, and it adds no dependency. What it lacks is a network read: it lists nothing when the checkout does not hold the head commit and the merge base. So the GitHub session (gidgethub, ADR 0006) still reads the compare for the merge base and the first 300 files, and an empty git list keeps the truncation blocker instead of judging a short list. The change is glue only: map ChangedFile.change_type onto GitHub's status vocabulary and pass the repository root that the readiness run already finds (src/devops_cli/github/merge_readiness.py:716). Written cost: about 20 000 tokens and 1.5 hours to build, keep and fix until it matches, with no SDK dependency and no workflow step, so the lacks of the alternatives block are not taken on.

Key questions

  • How does the check read every changed file of a pull request that changes more than 300 files?: Keep the compare of the base branch and the head commit as the primary read. When the answer holds CONST_GITHUB_COMPARE_FILES_LIMIT files, complete the list with the local three-dot diff of the merge base that the compare answer gives and the head commit, through list_changed_files, which runs git diff --name-status -z --find-renames <merge-base>...<head> --. A non-empty list replaces the truncated one; an empty list leaves today's truncation blocker. (best practice) [sources: openspec/specs/pr-merge-readiness/spec.md:154, src/devops_cli/github/merge_readiness.py:396, src/devops_cli/github/client.py:732, src/devops_cli/git/operations.py:597, src/devops_cli/git/operations.py:580]
    • Chosen: Compare, completed by the local three-dot diff at the compare's merge base. It reads the same merge-base diff the living requirement names, it needs no new dependency, and the three-dot diff is the one git command the project already runs for a changed file list.
    • Rejected: Paged pull request files endpoint. It reads the pull request's own diff, whose base is stale after a merge commit moves the merge base, which is the false not-grounded blocker that fix(github): Fix check-readiness base and monitor merged state #2530 fixed; the living requirement forbids a pulls files request and the archived design rejects this fallback.
    • Rejected: GitHub SDK or CI action. The alternatives block names both: they add a dependency or a workflow step and judge no change folder.
  • What file cap does the compare reply have?: The compare answer holds at most 300 files of one comparison and has no paging, so the client marks a list of 300 or more as possibly truncated. The answer also gives the merge base commit, which the local completion uses. [sources: src/devops_cli/config/constants.py:1096, src/devops_cli/github/client.py:740, src/devops_cli/github/client.py:748, src/devops_cli/github/client.py:469]
  • How does the test read the file list with no network?: The test doubles the GitHub session at its seam and the process seam that list_changed_files runs git through, run_subprocess in src/devops_cli/git/operations.py, and asserts the verdict. ADR 0007 allows doubling a process edge, and docs/TESTING.md states that every edge is faked through its seam. [sources: docs/adr/0007-tests-double-only-process-edges.md, docs/TESTING.md, src/devops_cli/git/operations.py:610, tests/support/fakes/process.py:167]
  • What does the check report when the local diff cannot complete the file list?: It keeps the truncation blocker, which names GitHub's limit of 300 files and the git diff command to run in a checkout of the branch, and it reports no absent change folder. A partial list never yields a verdict. (best practice) [sources: src/devops_cli/roadmap/grounding.py:216, src/devops_cli/lang/en/messages.py:2018, openspec/changes/archive/2026-11-13-2530-readiness-compare-from-base-branch/design.md:31]
    • Chosen: Keep the truncation blocker. The check cannot know the whole list, and a wrong 'adds no file to the change folder' verdict is the failure the issue fixes.
    • Rejected: Treat the 300-file answer as whole. It reports the wrong verdict on every pull request above 300 files.
    • Rejected: Fall back to the pulls files endpoint. That endpoint's stale base is the false not-grounded blocker that fix(github): Fix check-readiness base and monitor merged state #2530 fixed, and the living requirement forbids it.
  • Does the readiness run have a checkout whose git can list the merge-base diff?: Yes in the normal run: assess_merge_readiness already finds the repository root for the perimeter advisory, and the truncation message tells the reader to run the git diff in a checkout of the branch. When the checkout holds neither the head commit nor the merge base, list_changed_files lists nothing and the blocker stays. [sources: src/devops_cli/github/merge_readiness.py:716, src/devops_cli/lang/en/messages.py:2019, src/devops_cli/git/operations.py:604]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/bug
    on Nov 26, 2026
  2. dan-petty commented on Nov 26, 2026

    @dan-petty
    OwnerAuthor
  3. added
    source/agent
    scope/roadmap
    status/new
    value/medium
    effort/low
    priority/p2-medium
    on Nov 26, 2026
  4. devops-cli-service commented on Nov 26, 2026

    @devops-cli-service
    Contributor

    The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.

    Searches (8)

    Tools considered:

    Searches run:

    • PyGithub pull request get_files pagination all changed files, results: 5
    • GitHub API compare two commits 300 files limit list all changed files pagination, results: 5
    • gh pr diff all changed files beyond 300 limit github cli, results: 5
    • "300 files" github compare API truncated changed files workaround, results: 5
    • PyGithub, results: 5
    • github pull request files endpoint paginate 3000 files REST API, results: 5
    • GitPython changed files between two commits diff name-only library, results: 5
    • tj-actions changed-files, results: 5

    Sources:

  5. added
    status/ready
    and removed
    status/new
    on Nov 28, 2026
  6. devops-cli-service commented on Nov 28, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See the section Proposed design of the body.

  7. added
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 28, 2026
  8. removed
    status/in-review
    owner/agent
    on Nov 29, 2026
  9. devops-cli-service commented on Nov 29, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-29 03:13 UTC

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

    effort/lowpriority/p2-mediumscope/roadmapsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions