fix: mock-forgejo path parsing bug + non-fatal cron in smoke-init (#586)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/pr/smoke-init Pipeline was successful

- Fix off-by-one in mock admin/users/{username}/repos path extraction
  (parts[4] was 'users', not the username — should be parts[5])
- Change _install_cron_impl to return 1 instead of exit 1 when crontab
  is missing, so cron failure doesn't abort entire init

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Claude 2026-04-10 15:08:43 +00:00
parent d190296af1
commit 3405879d8b
3 changed files with 5 additions and 34 deletions

View file

@ -505,8 +505,9 @@ class ForgejoHandler(BaseHTTPRequestHandler):
require_token(self)
parts = self.path.split("/")
if len(parts) >= 6:
target_user = parts[4]
# /api/v1/admin/users/{username}/repos → parts[5] is the username
if len(parts) >= 7:
target_user = parts[5]
else:
json_response(self, 400, {"message": "username required"})
return