oliver-zehentleitner / maity

hub: runners/placements: one repository-pattern match and one isolation user strip; runner_view reads the viewer's projects once

Sign in to report

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("/") plus fnmatch.fnmatchcase over capabilities.repositories) is restated in the new hub/src/maity_hub/runners.py:195-210 (_capabilities_for).
  • placements.py:499-504 (_isolation) drops user from a target's isolation, which runners.py:216-221 (without_user) already does; the _isolation docstring names it.
  • _capabilities_for calls _project_ids and namespace.full_names, then runner_view runs them again through _project_slugs (runners.py:156-160, :193-194, :246): two extra statements per non-owner row on list_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.