Repository navigation
Conversation
Failure-Class: none Verification: - python plugins\\omi-github-app\\test_github_client.py - git diff --check
|
Thanks @goodguypeci-design — nice, tightly-scoped fix for #13168. What I verified: plugins/omi-github-app/github_client.py — plugins/omi-github-app/test_github_client.py — good request-level coverage: multi-page follow-through, error-to-empty, empty complete page, and discarding partial results when a later page errors. Mocking Two non-blocking notes for a follow-up, neither required for this fix:
Leaving for human maintainer review before merge. This is AI-generated feedback posted on behalf of the maintainers. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
kodjima33
left a comment
There was a problem hiding this comment.
Scoped backend/plugin bug fix (GitHub repo-list pagination), tests added, CI clean (pending), not yet fixed on main.
|
Thanks for merging this. This closes #13168, where I had proposed the US$25 bounty for the fix. Could you point me to the payout or claim path for that when you have a chance? |
Three endpoints now page through `next` links (user repos since BasedHardware#13184, both label fetchers as of the previous commit) — the duplicated skeleton is what let two of them ship unpaginated. Extract _get_paginated so the next list endpoint cannot silently truncate; callers keep their own transform. Behavior is unchanged: same params, same discard-partial-results error semantics, pinned by the existing tests plus a new discard case for the details fetcher. Tests: 8 tests in test_github_client.py pass. Failure-Class: none
Three endpoints now page through `next` links (user repos since BasedHardware#13184, both label fetchers as of the previous commit) — the duplicated skeleton is what let two of them ship unpaginated. Extract _get_paginated so the next list endpoint cannot silently truncate; callers keep their own transform. Behavior is unchanged: same params, same discard-partial-results error semantics, pinned by the existing tests plus a new discard case for the details fetcher. Tests: 8 tests in test_github_client.py pass. Failure-Class: none
* fix(github-app): page through repository labels Both get_repo_labels and get_repo_labels_with_details fetched a single page of 100 — on repositories with more labels, AI label selection silently missed every label past the first page and the list-labels tool undercounted. Same class as the repository-chooser pagination fix: follow `next` links, and discard partial results on a later-page error rather than returning a truncated list. Tests: regression tests assert both fetchers follow a second page and that a page-2 failure yields [] instead of partial data. All 7 tests in test_github_client.py pass (`python test_github_client.py`). Failure-Class: none * refactor(github-app): share one pagination loop across list fetchers Three endpoints now page through `next` links (user repos since #13184, both label fetchers as of the previous commit) — the duplicated skeleton is what let two of them ship unpaginated. Extract _get_paginated so the next list endpoint cannot silently truncate; callers keep their own transform. Behavior is unchanged: same params, same discard-partial-results error semantics, pinned by the existing tests plus a new discard case for the details fetcher. Tests: 8 tests in test_github_client.py pass. Failure-Class: none * fix(github-app): keep item projections inside the pagination error boundary Review feedback on #13546: the refactor moved per-item mapping out of the try/except that used to cover it, so a malformed item in a successful page escaped as KeyError/TypeError instead of returning [] — breaking the fetchers' fail-closed contract. _get_paginated now takes a project callable and applies it inside the boundary, so page failures and malformed items share one owner. Tests: malformed-item cases for the dict-building projections assert [] instead of a raised KeyError; both raise on the pre-fix code. uv run --with requests --with python-dotenv --no-project python test_github_client.py — 10 tests pass. * ci(github-app): run the client test suite from the check manifest The suite ran in no CI lane, so the pagination regression it guards could have shipped silently again. Stub the module-level requests/dotenv imports during module load the way the sibling plugin suites do — the tests patch requests.get per case and perform no real I/O — then register github-app-client-tests in checks-manifest.yaml (local + ci lanes). Verified: python3 plugins/omi-github-app/test_github_client.py — 10 tests pass on a stdlib-only interpreter; python3 .github/scripts/run_checks.py --lane ci --check-id github-app-client-tests --base origin/main -> PASS; --lane local --list selects it via plugins/omi-github-app/** on this diff.
|
Quick follow-up on the payout path for this merged fix. This PR closed #13168, where I had proposed the US$25 bounty for the issue. If Omi is not using a formal bounty flow for this, no problem — I just want to close the loop correctly. |
What changed and why
Fixes #13168.
The GitHub integration cached only the first
/user/repospage, so the repository picker could hide repositories for accounts with more than 100 accessible repos.list_user_reposnow follows GitHub'snextpagination while keeping the same returned repo shape and fail-closed error behavior.Product invariants affected
none
How it was verified
python plugins\omi-github-app\test_github_client.py— 4 tests passed.git diff --check— no whitespace or conflict marker problems.python .github\scripts\pr_preflight.py --lane local --base origin/main --pr-body-file C:\Users\Fantamanbg\Desktop\Bounty-Work\omi-pr-body-13168.md— local PR contract checks passed.I did not exercise the OAuth setup UI locally because this plugin environment is not configured with a GitHub OAuth app and an account with more than 100 repositories; the production method is covered with request-level fixtures.
Tests
plugins/omi-github-app/test_github_client.py::GitHubClientTests.test_list_user_repos_follows_next_pageplugins/omi-github-app/test_github_client.py::GitHubClientTests.test_list_user_repos_accepts_empty_complete_pageplugins/omi-github-app/test_github_client.py::GitHubClientTests.test_list_user_repos_returns_empty_on_api_errorplugins/omi-github-app/test_github_client.py::GitHubClientTests.test_list_user_repos_discards_partial_results_on_later_page_errorFailure class (fixes)
Failure-Class: none