nisse-review: match repository patterns against Gitea's search
At bring-up, `dev/*` failed: listing an organization's repositories (/orgs/dev/repos) needs the read:organization token scope, which the reviewer's token doesn't have and shouldn't need. Patterns are now matched against /repos/search, which needs only the repository scope and already lists every repository the account can read. A pattern that matches nothing is logged (access.no_match). owner_repositories goes. A Gitea error at startup is now reported like a config error, not a traceback. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J5Utyfzw7gF7UhjRDEtjTk
This commit is contained in:
1 parent
86f899006a
commit
faf973be6c
8 files changed
+25
-58
No files matched your search
@@ -9,6 +9,7 @@ from types import FrameType
|
||||
|
||||
from nisse_core.config import ConfigError
|
||||
from nisse_core.envfile import load_env_file
|
||||
from nisse_core.gitea import GiteaError
|
||||
from nisse_review.access import AccessRefused
|
||||
from nisse_review.build import StartupError, build
|
||||
from nisse_review.config import ReviewConfig
|
||||
@@ -19,7 +20,7 @@ def main() -> int:
|
||||
try:
|
||||
config = ReviewConfig.load()
|
||||
built = build(config)
|
||||
except (ConfigError, StartupError) as exc:
|
||||
except (ConfigError, StartupError, GiteaError) as exc:
|
||||
print(f"nisse-review: {exc}", file=sys.stderr)
|
||||
return 2
|
||||
|
||||
|
||||
Reference in new issue
Block a user