Replace free-text plugin repo URL with a picker from the developer's own GitHub repos - #18
Merged
mrenvoize merged 9 commits intoAug 13, 2026
Conversation
mrenvoize
force-pushed
the
worktree-repo-picker
branch
from
August 7, 2026 14:29
d7a600b to
cd0d6c1
Compare
mrenvoize
force-pushed
the
worktree-developer-oauth-login
branch
2 times, most recently
from
August 7, 2026 15:42
f137c2d to
eff9b07
Compare
mrenvoize
force-pushed
the
worktree-repo-picker
branch
from
August 7, 2026 15:43
cd0d6c1 to
5fe7421
Compare
3 tasks
Two related bugs found testing the repo picker fix against a real GitHub account: - Without read:org scope, GitHub silently omits organization-owned repos from affiliation=organization_member results -- no error, just missing data. This is why org repos never appeared even after fixing the pagination cap downstream. - log_in_developer stored the developer's entire row (via unblessed) in the session, which lives entirely in a signed cookie capped at 4KiB by Mojolicious. Once a developer's cached_repos grew past a few dozen entries, the session silently failed to persist at all (logged as "Cookie is bigger than 4KiB"), breaking every subsequent authenticated request with a 404. Nothing reads anything but the id back out of session (logged_in_user always re-fetches fresh from the DB), so only the id needs to be stored.
fetch_public_repos fetched a single per_page=100 page sorted by recency, so org/collaborator repos past that cutoff (this account's openfifth membership, where most real plugins live) never showed up in the picker. Replaces it with fetch_all_repos, which paginates through everything. Rather than re-running that full fetch on every /new-plugin view, the result is cached on the developer's row (cached_repos, cached_repos_fetched_at) and only refreshed on first visit or an explicit "Refresh my GitHub repos" button. The picker itself (Tom Select) filters that cached list entirely client-side, so searching a long repo list needs no server round-trip and no GitHub Search API integration. Submission-time ownership validation (new_plugin) keeps calling fetch_all_repos live rather than reading the cache, so a stale cached list can't be used to submit a repo the developer no longer actually has access to.
mrenvoize
force-pushed
the
worktree-repo-picker
branch
from
August 10, 2026 12:58
980275f to
8b6f514
Compare
Re-authorizing without first revoking the app doesn't re-show GitHub's per-organization grant screen -- confirmed against GitHub's own docs, since a developer might otherwise reasonably expect logging out and back in to let them add an org they skipped the first time. Points at the one documented way to get that screen back: revoke access at github.com/settings/applications, then log in again.
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
KohaPluginStore::GitHub::fetch_public_repos, called by fully-qualified name so tests can override itGET /api/v1/developer/repos, gated by the OpenAPI plugin's ownsecuritymechanism<select>populated from the developer's public GitHub repos, with an honest empty state when they have nonenew_pluginagainst that same list, since the dropdown alone doesn't stop a hand-crafted requestStacked on #15 (developer OAuth login) — diff here is just the 8 commits for this feature.
See
docs/superpowers/specs/2026-08-07-repo-picker-design.mdanddocs/superpowers/plans/2026-08-07-repo-picker.mdfor the design/plan this followed.Test plan
prove -l t/— 35 tests, all passing