Peach: Local-first video metadata scraper and media manager.
fix(tooling): 公开需求看板与路线图入口并保护归档事项
longmeidao7316b3558f28
diff --git a/.github/project-board.json b/.github/project-board.jsonindex 08a4ba565..eb26d6077 100644--- a/.github/project-board.json+++ b/.github/project-board.json@@ -1,10 +1,13 @@{"repository": "peach-mitao/peach",- "project_id": "PVT_kwDOE_1hCc4BncGL",+ "project_id": "PVT_kwDOE_1hCc4BnjsH",+ "issues_only": true,+ "maintainers": ["longmeidao"],"implementation_commits": {"53": ["b2bdb529b536723138144cedc996c8530df2a336"],"61": ["03eb94e22387e9ba3fc2401a2b5c73f64f525a44"],"62": ["7887699b3ee4059325ace140744904a39bb5bb4a"],+ "64": ["b8b809f37bb825d50c0cc53c8040016d71606218"],"65": ["7cf62507ce6148af6e9b06af724b8764cf547cbf"]}}diff --git a/README.en.md b/README.en.mdindex 520db9fec..702da8e25 100644--- a/README.en.md+++ b/README.en.md@@ -12,12 +12,14 @@<a href="https://demo.peach.video">Live demo</a> ·<a href="https://github.com/peach-mitao/peach/releases/tag/intro-video">Intro video</a> ·<a href="https://github.com/peach-mitao/peach/issues">Report a problem</a> ·+ <a href="https://github.com/orgs/peach-mitao/projects/7/views/1">Requests board</a> ·+ <a href="https://github.com/orgs/peach-mitao/projects/7/views/3">Roadmap</a> ·<a href="#documentation">Documentation</a> ·<a href="README.md">中文</a></p><p align="center">- <a href="https://github.com/peach-mitao/peach/releases"><img src="https://img.shields.io/github/v/release/peach-mitao/peach?include_prereleases&filter=v*&sort=semver&label=release" alt="release"></a>+ <a href="https://github.com/peach-mitao/peach/releases"><img src="https://img.shields.io/github/v/release/peach-mitao/peach?include_prereleases&filter=v*&sort=semver&display_name=tag" alt="release"></a><a href="https://github.com/peach-mitao/peach/actions/workflows/test.yml"><img src="https://img.shields.io/github/actions/workflow/status/peach-mitao/peach/test.yml?branch=master&label=tests&logo=githubactions&logoColor=white" alt="CI status"></a><a href="LICENSE"><img src="https://img.shields.io/badge/license-AGPL--3.0--or--later-blue?logo=gnu&logoColor=white" alt="license"></a><a href="docs/TESTING_DESKTOP.md"><img src="https://img.shields.io/badge/Windows-x64-0078D4" alt="Windows x64"></a>diff --git a/README.md b/README.mdindex 70306cbdb..c0bbd8944 100644--- a/README.md+++ b/README.md@@ -12,12 +12,14 @@<a href="https://demo.peach.video">在线演示</a> ·<a href="https://github.com/peach-mitao/peach/releases/tag/intro-video">介绍视频</a> ·<a href="https://github.com/peach-mitao/peach/issues">问题反馈</a> ·+ <a href="https://github.com/orgs/peach-mitao/projects/7/views/1">需求看板</a> ·+ <a href="https://github.com/orgs/peach-mitao/projects/7/views/3">路线图</a> ·<a href="#文档">文档</a> ·<a href="README.en.md">English</a></p><p align="center">- <a href="https://github.com/peach-mitao/peach/releases"><img src="https://img.shields.io/github/v/release/peach-mitao/peach?include_prereleases&filter=v*&sort=semver&label=release" alt="release"></a>+ <a href="https://github.com/peach-mitao/peach/releases"><img src="https://img.shields.io/github/v/release/peach-mitao/peach?include_prereleases&filter=v*&sort=semver&display_name=tag" alt="release"></a><a href="https://github.com/peach-mitao/peach/actions/workflows/test.yml"><img src="https://img.shields.io/github/actions/workflow/status/peach-mitao/peach/test.yml?branch=master&label=tests&logo=githubactions&logoColor=white" alt="CI 状态"></a><a href="LICENSE"><img src="https://img.shields.io/badge/license-AGPL--3.0--or--later-blue?logo=gnu&logoColor=white" alt="license"></a><a href="docs/TESTING_DESKTOP.md"><img src="https://img.shields.io/badge/Windows-x64-0078D4" alt="Windows x64"></a>diff --git a/docs/PRODUCT_BACKLOG.md b/docs/PRODUCT_BACKLOG.mdindex 9e04faafe..aeeb60247 100644--- a/docs/PRODUCT_BACKLOG.md+++ b/docs/PRODUCT_BACKLOG.md@@ -2,7 +2,7 @@最后核验:2026-10-07。这里只记还没做完的需求和待执行的操作;做完就删,历史去 Git 查。运行数字以 `peach-data/state/job-status.md` 的自动区块为准。-当前开发与版本范围见 [Peach 项目看板](https://github.com/orgs/peach-mitao/projects/6),关联与自动同步方式见[项目看板与交付关联](PROJECT_BOARD.md);本文件保留资料复核、运维等待条件与长期待办。+当前开发与版本范围见 [Peach 需求与路线图](https://github.com/orgs/peach-mitao/projects/7),关联与自动同步方式见[项目看板与交付关联](PROJECT_BOARD.md);本文件保留资料复核、运维等待条件与长期待办。## 功能验收与范围diff --git a/docs/PROJECT_BOARD.md b/docs/PROJECT_BOARD.mdindex 7b1091928..5f8c3e37a 100644--- a/docs/PROJECT_BOARD.md+++ b/docs/PROJECT_BOARD.md@@ -1,12 +1,19 @@# 项目看板与交付关联-[Peach 项目看板](https://github.com/orgs/peach-mitao/projects/6)收录产品需求、缺陷与工程任务。正式事项使用 GitHub Issue 编号;草稿保留讨论范围与优先级,逐项确认后再决定是否转为 Issue。卡片正文的相关事项链接用于说明依赖。个人馆藏修正、账号登录与设备维护留在本机清单,条件尚不满足的研究项保留归档。+[Peach 需求与路线图](https://github.com/orgs/peach-mitao/projects/7)是唯一持续同步的公开看板,展示项目 Issue、计划范围与交付状态。维护者安排的项目任务和使用者提交的反馈通过「来源」及视图区分。个人馆藏修正、账号登录与设备维护留在私有清单。++「需求看板」展示全部项目需求,「维护者待办」和「用户反馈」分别按来源筛选,「路线图」展示计划阶段与优先级。README 顶部和仓库 Projects 提供入口。视图不改变公开范围,同一事项只维护一份。++Issue 列表也可按作者筛选:[维护者待办](https://github.com/peach-mitao/peach/issues?q=is%3Aissue+is%3Aopen+author%3Alongmeidao)、[用户反馈](https://github.com/peach-mitao/peach/issues?q=is%3Aissue+is%3Aopen+-author%3Alongmeidao)。登录后的 Issues 总览可以将相同查询保存为个人视图。++公开仓库的 Issue 始终按仓库权限可见,将它加入私有看板不会隐藏原 Issue。正式事项使用 GitHub Issue 编号;草稿保留已确认范围与优先级,相关事项使用可访问的链接说明关联。## 状态与版本| 字段 | 含义 || --- | --- || Status | 待评估、待安排、进行中、待验证、已完成、已取消;PR 另有已关闭未合入,描述真实处理结果 |+| 来源 | 按配置的维护者账号识别为维护者待办,其余为用户反馈 || Priority | P0 紧急、P1 优先、P2 常规、P3 低优先级 || 计划阶段 | 近期、后续、探索;不构成交付日期承诺 || 等待条件 | 阻止下一步的具体条件;没有阻塞时留空 |@@ -21,7 +28,9 @@ PR 合入表示代码已集成。开放的需求进入待验证;完成验收`.github/workflows/project-board.yml` 响应 Issue 开关和标签变化、PR 建立和合入、主线推送、Release 发布与变动。使用主线代码,不检出或执行外部 PR 的代码。所有同步串行执行,每次读取当前事实,重复执行不会重复建卡或推进状态。-- 新建 Issue、PR 自动加入看板,每轮补查开放事项。重新打开的事项按实际实现恢复为待安排或待验证,开放 PR 为进行中。+- 公开路线图自动收录本仓库的新建 Issue,每轮补查开放事项,并同步真实状态与发布版本。PR 用于计算实现关联,内部草稿不复制到公开 Project。+- 来源按 Issue 作者与 `.github/project-board.json` 的维护者账号列表同步;分类视图使用同一份 Issue。+- 重新打开的事项按实际实现恢复为待安排或待验证,已关联开放 PR 的事项为进行中。- PR 的 GitHub 关联和独立 `Refs #编号` 行建立实现关联;只处理本仓库引用。正文中普通提及某个编号不会被当成交付。- 已合入 PR 对应的开放需求进入待验证;`status:needs-info` 和 `status:needs-verification` 分别保留等待信息和验收的含义。- 从有下载制品的已发布 Release 中检查标签提交祖先关系,填写首次包含实现的版本。只有标签、失败构建和发布草稿均不算已发布。diff --git a/scripts/project_board.py b/scripts/project_board.pyindex 2c31fecb0..e6653e877 100644--- a/scripts/project_board.py+++ b/scripts/project_board.py@@ -101,7 +101,7 @@ def decision(content, current, linked, published):return result-CONTENT = '''__typename ... on DraftIssue{id title} ... on Issue{id number title url state stateReason+CONTENT = '''__typename ... on DraftIssue{id title} ... on Issue{id number title url state stateReason author{login}labels(first:100){nodes{name}}}... on PullRequest{id number title url state merged mergeCommit{oid} bodyclosingIssuesReferences(first:100){nodes{id number}}}'''@@ -118,7 +118,7 @@ fields(first:100){nodes{... on ProjectV2Field{id name dataType}if required not in fields:raise ValueError(f"看板缺少字段:{required}")items = connection('''query($id:ID!,$cursor:String){node(id:$id){... on ProjectV2{-items(first:100,after:$cursor){nodes{id isArchived content{''' + CONTENT + '''}+items(first:100,after:$cursor,archivedStates:[ARCHIVED,NOT_ARCHIVED]){nodes{id isArchived content{''' + CONTENT + '''}fieldValues(first:100){nodes{... on ProjectV2ItemFieldSingleSelectValue{name field{... on ProjectV2SingleSelectField{name}}}... on ProjectV2ItemFieldTextValue{text field{... on ProjectV2Field{name}}}}}}pageInfo{hasNextPage endCursor}}}}}''', ("node", "items"), id=project)@@ -148,7 +148,7 @@ def include_incoming(config, candidates, prs, event, apply):repository, project = config["repository"], config["project_id"]owner, name = repository.split("/")incoming = connection('''query($owner:String!,$name:String!,$cursor:String){repository(owner:$owner,name:$name){-issues(first:100,after:$cursor,states:OPEN){nodes{__typename id number title url state stateReason+issues(first:100,after:$cursor,states:OPEN){nodes{__typename id number title url state stateReason author{login}labels(first:100){nodes{name}}}pageInfo{hasNextPage endCursor}}}}''',("repository", "issues"), owner=owner, name=name)tracked = {item["content"].get("number") for item in candidates.values()@@ -160,6 +160,8 @@ labels(first:100){nodes{name}}}pageInfo{hasNextPage endCursor}}}}''',node = graphql('''query($id:ID!){node(id:$id){''' + CONTENT + '''}}''', id=subject["node_id"])["node"]incoming.append(node)for node in incoming:+ if config.get("issues_only") and node["__typename"] != "Issue":+ continueif node["id"] not in candidates:item = {"id": None, "content": node, "fieldValues": {"nodes": []}, "isArchived": False}if apply:@@ -232,6 +234,8 @@ def reconcile(config, *, apply=False, event=None):if not content["url"].startswith(f"https://github.com/{repository}/"):continuedesired = delivery_fields(config, content, values(item), linked, releases)+ if "来源" in fields and content.get("author"):+ desired["来源"] = "维护者待办" if content["author"]["login"] in config.get("maintainers", []) else "用户反馈"changes.extend(apply_fields(project, item, fields, desired, apply))return changesdiff --git a/tests/test_scripts.py b/tests/test_scripts.pyindex c73bc2b7d..5995dc38a 100644--- a/tests/test_scripts.py+++ b/tests/test_scripts.py@@ -95,8 +95,9 @@ class ProjectBoardTests(unittest.TestCase):commit = "a" * 40fields = [{"id": name, "name": name} for name in ("发布版本", "发布说明", "实现关联")]fields += [{"id": "status", "name": "Status", "options": [{"id": "verify", "name": "待验证"}]},- {"id": "delivery", "name": "交付进度", "options": [{"id": "published", "name": "已发布"}]}]- issue = self.issue(id="issue", number=65, title="历史导入", url="https://github.com/peach-mitao/peach/issues/65")+ {"id": "delivery", "name": "交付进度", "options": [{"id": "published", "name": "已发布"}]},+ {"id": "source", "name": "来源", "options": [{"id": "feedback", "name": "用户反馈"}, {"id": "plan", "name": "维护者待办"}]}]+ issue = self.issue(id="issue", number=65, title="历史导入", author={"login": "visitor"}, url="https://github.com/peach-mitao/peach/issues/65")item = {"id": "item", "content": issue, "isArchived": False, "fieldValues": {"nodes": []}}archived = {**item, "id": "archive", "isArchived": True, "content": {**issue, "id": "old", "number": 90}}draft = {"id": "draft", "isArchived": False, "content": {"__typename": "DraftIssue", "id": "draft-content"}}@@ -106,17 +107,33 @@ class ProjectBoardTests(unittest.TestCase):("v0.43.0", "2026-10-17", False, [{"name": "app.zip"}]),("v0.44.0", "2026-10-18", True, [{"name": "app.zip"}]),("v0.45.0", "2026-10-19", False, [{"name": "app.zip"}])]]]- with mock.patch.object(self.script, "graphql", return_value={"node": {"fields": {"nodes": fields}}}) as api, \- mock.patch.object(self.script, "connection", side_effect=[[item, archived, draft], [], []]), \+ def api_result(query, **variables):+ if "fields(first:" in query:+ return {"node": {"fields": {"nodes": fields}}}+ if "archivedStates:[ARCHIVED,NOT_ARCHIVED]" in query:+ return {"node": {"items": {"nodes": [item, archived, draft], "pageInfo": {"hasNextPage": False}}}}+ if "issues(first:" in query:+ return {"repository": {"issues": {"nodes": [archived["content"]], "pageInfo": {"hasNextPage": False}}}}+ if "pullRequests(first:" in query:+ return {"repository": {"pullRequests": {"nodes": [], "pageInfo": {"hasNextPage": False}}}}+ if "updateProjectV2ItemFieldValue(" in query:+ self.assertEqual(variables["item"], "item")+ return {"updateProjectV2ItemFieldValue": {"projectV2Item": {"id": "item"}}}+ self.fail(f"不允许的看板调用:{query}")++ with mock.patch.object(self.script, "graphql", side_effect=api_result), \mock.patch.object(self.script, "gh", return_value=releases), \mock.patch.object(self.script, "ancestor", return_value=True):changes = self.script.reconcile({"project_id": "project", "repository": "peach-mitao/peach",- "implementation_commits": {"65": [commit]}}, apply=False)- self.assertEqual(api.call_count, 1)+ "implementation_commits": {"65": [commit]}}, apply=True)+ maintained = self.script.reconcile({"project_id": "project", "repository": "peach-mitao/peach", "maintainers": ["visitor"],+ "implementation_commits": {"65": [commit]}}, apply=False)self.assertEqual({change["number"] for change in changes}, {65})actual = {change["field"]: change["value"] for change in changes}self.assertEqual(actual["发布版本"], "v0.43.0")self.assertEqual(actual["Status"], "待验证")+ self.assertEqual(actual["来源"], "用户反馈")+ self.assertEqual(next(change["value"] for change in maintained if change["field"]=="来源"), "维护者待办")self.assertTrue(actual["实现关联"].endswith(commit))def test_ancestor_uses_actual_commit_graph_and_rejects_unmerged_commit(self):@@ -137,6 +154,21 @@ class ProjectBoardTests(unittest.TestCase):self.assertFalse(self.script.ancestor(feature, "refs/tags/v1.0"))self.assertFalse(self.script.ancestor("not-a-commit", "refs/tags/v1.0"))+ def test_public_roadmap_adds_issues_without_copying_internal_drafts_or_prs(self):+ issue = self.issue(id="public-issue", number=7)+ pr = {"__typename": "PullRequest", "id": "pr", "state": "OPEN"}+ internal = {"id": "private-card", "isArchived": False,+ "content": {"id": "private-draft", "__typename": "DraftIssue"}}+ candidates = {"private-draft": internal}+ with mock.patch.object(self.script, "connection", return_value=[issue]), \+ mock.patch.object(self.script, "graphql", return_value={"node": pr}) as api:+ self.script.include_incoming({"repository": "peach-mitao/peach", "project_id": "public", "issues_only": True},+ candidates, [pr], {"repository": {"full_name": "peach-mitao/peach"},+ "pull_request": {"node_id": "pr"}}, False)+ self.assertEqual(set(candidates), {"private-draft", "public-issue"})+ self.assertIs(candidates["private-draft"], internal)+ self.assertEqual(api.call_count, 1)+class UpdateTaskSmokeTests(unittest.TestCase):def test_dry_run_does_not_open_artifacts_or_create_installation_data(self):