Implement: Use Koan with Gitlab and Codeberg.org?#992
Implement: Use Koan with Gitlab and Codeberg.org?#992Koan-Bot wants to merge 2 commits intoAnantys-oss:mainfrom
Conversation
Introduce koan/app/forge/ package with ForgeProvider ABC, GitHubForge thin delegation wrapper over app.github, a forge registry, and a get_forge() factory. GitHubForge delegates all operations to existing app.github/github_url_parser — zero behavior change. Supports GitHub Enterprise via base_url parameter. Includes 70 tests covering base class, GitHub delegation, registry, and factory. Co-Authored-By: Claude <noreply@anthropic.com>
|
@Koan-Bot review |
PR Review — Implement: Use Koan with Gitlab and Codeberg.org?Solid Phase 1 foundation — clean separation, good test coverage, and proper delegation to existing modules. However, there are several issues that should be addressed before merge: (1) 🟡 Important1. Bare except Exception swallows config errors silently ( Suggested fix: add a 2. forge_url passed only to GitHubForge, ignored for future forges ( Suggested fix: pass 3. auth_env imports from app.github_auth but module is not in the PR ( 4. pr_view returns untyped fallback dict on JSON parse failure ( 5. CI status test doesn't exercise the error path correctly ( 6. detect_fork tests mock too deep and assert on implementation detail ( 🟢 Suggestions1. "github.enterprise" substring match is too broad ( 2. ABC with no abstract methods ( 3. supports() claims all features including notifications/reactions ( Checklist
SummarySolid Phase 1 foundation — clean separation, good test coverage, and proper delegation to existing modules. However, there are several issues that should be addressed before merge: (1) Automated review by Kōan |
|
Here's the review. The PR introduces a well-structured ForgeProvider abstraction with clean delegation to existing
See inline comments for details and suggested fixes. |
|
@Koan-Bot rebase |
TODO for `forge_url` not passed to non-GitHub forges** (`koan/app/forge/__init__.py`): Documented the Phase 2 limitation with a `TODO(Phase 2)` comment so it won't be forgotten when GitLab/Gitea forges are added. Per reviewer comment Anantys-oss#2. - **`pr_view` now raises `RuntimeError` on JSON parse failure** (`koan/app/forge/github.py`): Instead of returning `{"raw": output}` (inconsistent dict shape that would cause `KeyError` in callers), `pr_view` now raises `RuntimeError` with a descriptive message. Updated corresponding test. Per reviewer comment Anantys-oss#4. - **`supports()` now only claims actually-implemented features** (`koan/app/forge/github.py`): Changed from `feature in ALL_FEATURES` to a curated `_SUPPORTED_FEATURES` frozenset containing only `pr`, `issues`, `ci_status`, and `pr_review_comments`. `notifications` and `reactions` are excluded since GitHubForge doesn't implement those methods. Updated tests accordingly. Per reviewer's top-level concern about `supports()` misleading callers.
Rebase: Implement: Use Koan with Gitlab and Codeberg.org?Branch Diff: 7 files changed, 1217 insertions(+) Review feedback was analyzed and applied. ChangesTODO for
Actions
CICI passed. Automated by Kōan |
|
Also view #977 |
|
That's great, but we need a real-life end-to-end testing before merging to @GeekRuthie : would you like to test this branch on your existing setup and report here? That would be great! |
|
@sukria : I will do so, probably this weekend--I'll try to squeeze it in! :) |
Summary
Implements #968
Closes #968
Generated by Kōan /implement
Quality Report
Changes: 7 files changed, 1196 insertions(+)
Code scan: clean
Tests: passed (10 PASSED)
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline