Repository navigation
Fix listing installation repositories with user authentication - #3571
Conversation
Use the user-scoped endpoint for AppUserAuth while preserving installation-token behavior, lazy pagination, and requester settings. Add offline HTTP regression coverage for GitHub.com and custom API URLs. Assisted-by: OpenAI Codex
Co-authored-by: EnricoMi <[email protected]>
…tion-repos' into copilot/hansu650fixuser-installation-repos # Conflicts: # tests/Installation.py Co-authored-by: EnricoMi <[email protected]>
This reverts commit 9152817. Co-authored-by: EnricoMi <[email protected]>
Co-authored-by: EnricoMi <[email protected]>
Co-authored-by: Enrico Minack <[email protected]>
|
@hansu650 please consider merging hansu650#1 into your branch. |
Assisted-by: OpenAI Codex <[email protected]>
|
Thanks @EnricoMi — I merged hansu650#1 into this branch, preserving your commits, and fixed the import-group spacing flagged by Ruff. The tests now use Local validation (Windows, Python 3.13.15):
The test runs also emitted existing deprecation warnings and a local pytest-cache permission warning; neither affected the test results. CI for the updated head still needs to run. |
EnricoMi
left a comment
There was a problem hiding this comment.
Thanks for the fix, please adjust the test file.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3571 +/- ##
==========================================
+ Coverage 97.00% 97.04% +0.04%
==========================================
Files 172 180 +8
Lines 18934 20445 +1511
==========================================
+ Hits 18366 19841 +1475
- Misses 568 604 +36 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Fixes #3546.
Installation.get_repos()always calls/installation/repositories, which requires installation authentication. An installation obtained throughGithub(auth=AppUserAuth(...)).get_user().get_installations()instead needs/user/installations/{installation_id}/repositories.Select that endpoint when the requester uses
AppUserAuth. Other authentication types retain the installation endpoint, including the existingAppAuthtoAppInstallationAuthconversion. The API-providedrepositories_urlattribute remains unchanged; an opaqueAuth.Tokenkeeps its existing behavior.Three offline replay cases cover GitHub.com and an Enterprise-style base URL with a non-default port, two-page iteration,
totalCount, authentication preservation, and an empty installation-token result. These are synthetic fixtures with placeholder credentials, not new live API recordings.Validation — 2026-11-13
Head
c55c9dedmerges upstream33fdcf50. The merge retains upstream's VCR-based request capture; the installation-token assertion now checks the original placeholder token seen by that capture layer.Dedicated Windows / CPython 3.13.15 environment:
git diff --check: passed.The original submission's baseline run had two user-authentication failures and five passes without the endpoint fix. That earlier baseline and its build/documentation checks were not repeated for this merge. Live GitHub App authentication, other platforms/Python versions and the separate OpenAPI CLI suite were not run locally. Current remote CI is tracked separately.
AI assistance: prepared and validated with OpenAI Codex.