diag: resolve label IDs dynamically from Gitea API instead of hardcoding #134
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
src/api/diag/__main__.pyhas 20 hardcoded label IDs (lines 23-52). If labels are recreated or the repo is cloned, all IDs break silently.Fix
Add a
resolve_labels(names: list[str]) -> list[int]helper toapi.clients.giteathat:GET /repos/{owner}/{repo}/labelsThe diag reporter calls
resolve_labels(['ci', 'pipeline:deploy', 'step:build', 'image:api'])instead of[13, 15, 22, 28].Files
src/api/clients/gitea/client.py— add label resolutionsrc/api/diag/__main__.py— use name-based resolutionsrc/api/diag/vuln.py— same