fix: add repo auto-detection and improve org validation #65
Reference in New Issue
Block a user
Delete Branch "fix/repo-auto-detection-and-org-validation"
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?
Summary
Fixes three issues reported in #64:
1. Repo Auto-Detection
_detect_repo_from_git()to parse git remote URLGITEA_REPOnot set2. Organization Validation
is_org_repo()to use/orgs/{owner}endpoint_is_organization()method for reliable org detectionowner.typewasnullin Gitea API3. Organization Labels
Tests
All 11 new tests passing.
Fixes #64
1. Repo Auto-Detection (config.py): - Added _detect_repo_from_git() to parse git remote URL - Supports SSH, SSH short, HTTPS, HTTP URL formats - Falls back to git remote when GITEA_REPO not set 2. Organization Validation (gitea_client.py): - Changed is_org_repo() to use /orgs/{owner} endpoint - Added _is_organization() method for reliable org detection - Fixes issue where owner.type was null in Gitea API 3. Tests: - Added 6 tests for git URL parsing - Added 3 tests for org detection Fixes #64 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>