feat: allow gitea.issue.comment for author and reviewer profiles (#137)

- Add aliases 'issue.comment' and 'issue_comment' to GITEA_OPERATION_ALIASES so short names normalize to gitea.issue.comment
- Grant 'issue.comment' (and short) in v2 example profiles for example-author and example-reviewer
- Grant in gitea-mcp.example.json mdcps-reviewer
- Update docs example profiles
- Add test coverage for new aliases and normalization

This enables gitea_create_issue_comment and list for profiles that include it, while preserving fail-closed for others and separation of duties (issue.comment does not imply pr.review etc).

Closes #137
This commit is contained in:
2026-07-05 02:10:18 -04:00
parent 7a6f7257c8
commit 3953b6bdd2
5 changed files with 12 additions and 4 deletions
+6
View File
@@ -47,6 +47,8 @@ class TestNormalizeOperation(unittest.TestCase):
"request_changes": "gitea.pr.request_changes",
"review": "gitea.pr.review",
"comment": "gitea.pr.comment",
"issue.comment": "gitea.issue.comment",
"issue_comment": "gitea.issue.comment",
"read": "gitea.read",
}
for legacy, canonical in expected.items():
@@ -58,6 +60,10 @@ class TestNormalizeOperation(unittest.TestCase):
self.assertEqual(normalize_operation("push"), "gitea.branch.push")
self.assertEqual(normalize_operation("open_pr"), "gitea.pr.create")
def test_issue_comment_alias(self):
self.assertEqual(normalize_operation("issue.comment"), "gitea.issue.comment")
self.assertEqual(normalize_operation("issue_comment"), "gitea.issue.comment")
def test_unknown_unqualified_op_fails_closed(self):
with self.assertRaises(ConfigError):
normalize_operation("frobnicate")