oliver-zehentleitner / maity
hub: runners/placements: one repository-pattern match and one isolation user strip; runner_view reads the viewer's projects once
tsk-3jhg5wn9r1xx Open
Audit round 3 (tsk-hgnbapyw7hnh), read at 588f911b. Kind: duplication / debt (slow path).
What is wrong
hub/src/maity_hub/placements.py:561-570(check_repository:removeprefix("https://").rstrip("/")plusfnmatch.fnmatchcaseovercapabilities.repositories) is restated in the newhub/src/maity_hub/runners.py:195-210(_capabilities_for).placements.py:499-504(_isolation) dropsuserfrom a target's isolation, whichrunners.py:216-221(without_user) already does; the_isolationdocstring names it._capabilities_forcalls_project_idsandnamespace.full_names, thenrunner_viewruns them again through_project_slugs(runners.py:156-160,:193-194,:246): two extra statements per non-owner row onlist_runners(routes/runners.py:624).
Proposal: a runners.repository_offered(patterns, url) helper used by both; _isolation calls without_user; read project ids and names once per view.
Effort / risk: S. Low risk.