Enhance P10Y repository handling with pagination and qualified searches - #33
Merged
Conversation
- Implemented pagination for P10Y repository lookups in `create_generation_session_repos.py`, allowing for efficient retrieval of repositories across multiple pages. - Introduced a helper function to construct qualified search prefixes for repositories, ensuring searches are scoped to specific organizations and prefixes. - Updated related functions to utilize the new pagination logic and search capabilities. - Added unit tests to verify the correct behavior of repository lookups and pagination.
akozak-gd
approved these changes
Jul 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Quickstart P10Y repository lookups now work correctly for organizations with more than one page of repositories, and re-fetch requests after creating new repos now target only the GitHub connection that actually owns them instead of scanning or syncing across every connection.
Entrypoint
Start at
get_repository_ids()inbackend/scripts/create_generation_session_repos.py, which resolves repository IDs through the newP10YInternalAPIClient.list_repositories_paginated()client method using a single, consistently qualified<github_org>/<prefix>search string computed once inmain().Diagram
N/A — no architectural or flow diagram needed for this change.
Details
Repository listing pages are now walked to completion inside
list_repositories_paginated()on the P10Y client itself, so lookups, status checks, and status polling no longer silently stop at the first 1000 repositories. The qualified search string is computed once and passed through unchanged everywhere it's used, including the post-refetch retry loop, so a repo lookup can never end up double-qualified after a refetch. Connection re-fetch now matches any repository already known under the target GitHub org, since brand-new repos aren't visible in P10Y yet and matching only their exact names would always miss; it only broadcasts to every active GitHub connection when P10Y has no visibility into that org at all. A pagination-limit failure during status polling now surfaces immediately instead of being silently retried as a transient error.