Skip to content

Enhance P10Y repository handling with pagination and qualified searches - #33

Merged
awrobel-gd merged 1 commit into
mainfrom
p10y-init-fix
Jul 9, 2026
Merged

Enhance P10Y repository handling with pagination and qualified searches#33
awrobel-gd merged 1 commit into
mainfrom
p10y-init-fix

Conversation

@awrobel-gd

@awrobel-gd awrobel-gd commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

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() in backend/scripts/create_generation_session_repos.py, which resolves repository IDs through the new P10YInternalAPIClient.list_repositories_paginated() client method using a single, consistently qualified <github_org>/<prefix> search string computed once in main().

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.

- 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.
@awrobel-gd awrobel-gd added the bug Something isn't working label Jul 8, 2026
@awrobel-gd
awrobel-gd merged commit ba700e4 into main Jul 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Quickstart setup - P10Y repo polling needs prefix search and pagination

2 participants