feat(code): cartes liées au code — branches, PRs, commits (issue #1)
app/code_links.py: appariement pur (#n dans titres/corps/messages,
numéro en jeton de branche). Client: list_branches/list_pulls/
list_commits. Badge sur les cartes (board + fragments live),
section Code lié du panneau détail, /api/issues/{o}/{r}/{n}/code.
This commit is contained in:
@@ -223,6 +223,49 @@ class FakeGitea:
|
||||
for label in removed:
|
||||
self.label_ops.append(("remove", number, label["name"]))
|
||||
|
||||
async def list_branches(self, owner, repo):
|
||||
return [
|
||||
{"name": "main"},
|
||||
{"name": "feature/1-tache-un"},
|
||||
{"name": "issue-5-focus"},
|
||||
]
|
||||
|
||||
async def list_pulls(self, owner, repo, state="all"):
|
||||
return [
|
||||
{
|
||||
"number": 16, "title": "Corrige la tâche un",
|
||||
"body": "Fixes #1", "state": "open", "merged": False,
|
||||
"html_url": "http://gitea.test/pr/16",
|
||||
"head": {"ref": "feature/1-tache-un"},
|
||||
},
|
||||
{
|
||||
"number": 17, "title": "Focus", "body": "",
|
||||
"state": "closed", "merged": True,
|
||||
"html_url": "http://gitea.test/pr/17",
|
||||
"head": {"ref": "issue-5-focus"},
|
||||
},
|
||||
]
|
||||
|
||||
async def list_commits(self, owner, repo, limit=75):
|
||||
return [
|
||||
{
|
||||
"sha": "abcdef1234567890",
|
||||
"html_url": "http://gitea.test/c/abcdef1",
|
||||
"commit": {
|
||||
"message": "Début de la tâche #1\n\nDétails",
|
||||
"author": {"date": "2026-10-10T10:00:00Z"},
|
||||
},
|
||||
},
|
||||
{
|
||||
"sha": "1234567abcdef",
|
||||
"html_url": "http://gitea.test/c/1234567",
|
||||
"commit": {
|
||||
"message": "Commit sans rapport",
|
||||
"author": {"date": "2026-10-09T10:00:00Z"},
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
async def get_milestones(self, owner, repo, state="open"):
|
||||
return [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user