fix(F.16): update visibility tests — gitea is now public
Some checks failed
Release / Test before release (push) Has been cancelled
Release / Publish to PyPI (push) Has been cancelled
Release / Publish to Docker Hub (push) Has been cancelled
Release / Create GitHub Release (push) Has been cancelled

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-02 08:00:16 +02:00
parent 2c9d4ed3d2
commit bf893a743a
2 changed files with 97 additions and 5 deletions

View File

@@ -0,0 +1,90 @@
# F.16 — Gitea Plugin Review, Test & Public Release
> Session prompt. Copy and paste into a new Claude Code conversation.
---
## Prompt:
```
از مهارت project-ops برای آشنایی با محیط استفاده کن. پروژه mcphub-internal روی branch Phase-1 است.
فایل‌های مرجع:
- docs/plans/2026-03-25-v4-development-cycle.md
- CLAUDE.md
- CHANGELOG.md
## وضعیت فعلی
- نسخه: v3.5.0
- 565 ابزار در 9 پلاگین (4 پلاگین عمومی: WordPress, WooCommerce, Supabase, OpenPanel)
- FastMCP: `>=3.0.0,<4.0.0`
- CI سبز
- F.15 تکمیل شده — FastMCP 3.x upgrade + legacy cleanup
## هدف: فاز F.16 — Gitea Plugin Review, Test & Public Enablement
مشابه F.10 (OpenPanel) — بررسی، تست و فعال‌سازی عمومی پلاگین Gitea.
### بخش 1: بررسی و تحلیل
1. **ساختار پلاگین**: `plugins/gitea/` شامل 56 ابزار در 5 هندلر:
- `handlers/repositories.py` — 16 tools (CRUD repos, branches, tags, files)
- `handlers/issues.py` — 12 tools (issues, comments, labels, milestones)
- `handlers/pull_requests.py` — 15 tools (PRs, reviews, merge, diff)
- `handlers/users.py` — 8 tools (users, orgs, teams)
- `handlers/webhooks.py` — 5 tools (CRUD webhooks, test)
2. **مشکلات شناسایی‌شده**:
- `update_webhook` در client.py هست ولی به عنوان tool expose نشده
- هیچ تست اختصاصی‌ای ندارد (0 تست!)
- فعلاً admin-only هست (نه در ENABLED_PLUGINS)
3. **تست واقعی**: سایت Gitea از MCPHub MCP endpoint:
- از ابزارهای Supabase MCP (`mcp.example.com`) استفاده کنید تا سایت Gitea موجود را پیدا کنید
- یا یک Gitea instance جدید از طریق داشبورد اضافه کنید
- هر دسته tool را با API واقعی تست کنید
### بخش 2: تست نوشتن
مشابه `tests/test_openpanel_plugin.py` (الگو — 767 خط, 62 تست):
1. `tests/test_gitea_plugin.py` بنویسید:
- Client initialization + health check
- Tool spec validation (نام‌ها، پارامترها، type ها)
- Handler delegation (mock client)
- Error handling
- Pagination
2. هدف: حداقل 80 تست (56 tool + edge cases)
### بخش 3: رفع مشکلات
1. `update_webhook` را به عنوان tool expose کنید
2. هر tool که در تست واقعی مشکل دارد را fix کنید
3. توضیحات service page برای Gitea بنویسید
4. health check endpoint را بررسی کنید
### بخش 4: فعال‌سازی عمومی
1. `core/plugin_visibility.py`: اضافه کردن `gitea` به `DEFAULT_PUBLIC_PLUGINS`
2. `env.example`: آپدیت ENABLED_PLUGINS default
3. `glama.json`: آپدیت description اگر لازمه
### بخش 5: Release
1. Version bump: `3.5.0` → `3.6.0`
2. CHANGELOG update
3. Lint: `uvx --python 3.12 black .` && `uvx ruff check --fix .`
4. Commit + push Phase-1
5. Sync: `python3.11 scripts/community-build/sync.py --output ../mcphub/`
6. بعد از sync حتماً `uvx --python 3.12 black .` در public repo هم بزنید!
7. Commit + push public repo
### مراحل پیشنهادی
1. **تحلیل**: خواندن کامل هر handler + client + schemas
2. **تست واقعی**: اتصال به Gitea instance و تست ابزارها
3. **پلن اجرایی**: ارائه پلن و تایید قبل از شروع
4. **تست نوشتن**: test_gitea_plugin.py
5. **رفع مشکلات**: fix هر tool مشکل‌دار
6. **فعال‌سازی**: ENABLED_PLUGINS update
7. **Release**: v3.6.0
### نکات فنی
- Private repo: /config/workspace/mcphub-internal (branch Phase-1)
- Public repo: /config/workspace/mcphub (branch main)
- Lint: `uvx --python 3.12 black .` && `uvx ruff check --fix .`
- Sync: `python3.11 scripts/community-build/sync.py --output ../mcphub/`
- ایمیل git عمومی: hi.airano@gmail.com
- **مهم**: اول پلن بده، بدون تایید شروع نکن
- **الگوی مرجع**: F.10 (OpenPanel) — بخش "Phase F.10" در plan و `tests/test_openpanel_plugin.py`
```

View File

@@ -78,11 +78,11 @@ class TestIsPluginPublic:
os.environ.pop("ENABLED_PLUGINS", None) os.environ.pop("ENABLED_PLUGINS", None)
assert is_plugin_public("supabase") is True assert is_plugin_public("supabase") is True
def test_default_gitea_not_public(self): def test_default_gitea_public(self):
"""Gitea is not public by default.""" """Gitea is public by default (since F.16)."""
with patch.dict(os.environ, {}, clear=False): with patch.dict(os.environ, {}, clear=False):
os.environ.pop("ENABLED_PLUGINS", None) os.environ.pop("ENABLED_PLUGINS", None)
assert is_plugin_public("gitea") is False assert is_plugin_public("gitea") is True
def test_default_wordpress_advanced_not_public(self): def test_default_wordpress_advanced_not_public(self):
"""WordPress Advanced is not public by default.""" """WordPress Advanced is not public by default."""
@@ -118,8 +118,9 @@ class TestSiteApiIntegration:
assert "wordpress" in fields assert "wordpress" in fields
assert "woocommerce" in fields assert "woocommerce" in fields
assert "supabase" in fields assert "supabase" in fields
assert "gitea" in fields
assert "openpanel" in fields
assert "wordpress_advanced" not in fields assert "wordpress_advanced" not in fields
assert "gitea" not in fields
assert "n8n" not in fields assert "n8n" not in fields
def test_get_user_plugin_names_filtered(self): def test_get_user_plugin_names_filtered(self):
@@ -133,8 +134,9 @@ class TestSiteApiIntegration:
assert "wordpress" in names assert "wordpress" in names
assert "woocommerce" in names assert "woocommerce" in names
assert "supabase" in names assert "supabase" in names
assert "gitea" in names
assert "openpanel" in names
assert "wordpress_advanced" not in names assert "wordpress_advanced" not in names
assert "gitea" not in names
def test_custom_env_changes_fields(self): def test_custom_env_changes_fields(self):
"""Custom ENABLED_PLUGINS changes which credential fields are returned.""" """Custom ENABLED_PLUGINS changes which credential fields are returned."""