fix(release): 接受预览提示中的带引号范围确认
build / build (push) Successful in 2m22s

This commit is contained in:
姚章浩
2026-11-24 14:54:05 +08:00
parent 91f9e00010
commit c33c7e2700
2 changed files with 11 additions and 4 deletions
+7 -4
View File
@@ -70,7 +70,7 @@ def resolve(task, event):
return sha, sha
def frozen_approval(task_id):
def frozen_approval(task_id, comment_id=None):
"""An owner reply to the specific, unedited scope preview authorizes this immutable local plan."""
path = DIRECTORY / (task_id + '.preview.json')
if not path.exists():
@@ -81,8 +81,11 @@ def frozen_approval(task_id):
cd.require(parent.get('content') == saved['content'], 'scope preview has changed')
replies = [r for r in rows if r.get('parentId') == saved['comment'] and author(r) == cd.RELEASE_OWNER
and (r.get('author') or {}).get('type') == 'human' and not r.get('runId')]
if replies and max(replies, key=lambda r: r['createdAt'])['content'].strip() == '确认范围':
return saved['plan']
if replies:
latest = max(replies, key=lambda r: r['createdAt'])
if ((comment_id is None or latest['id'] == comment_id)
and latest['content'].strip() in ('确认范围', '「确认范围」')):
return saved['plan']
return None
@@ -172,7 +175,7 @@ def main():
if args.action == 'preflight':
return preflight(task, args.comment)
if args.action == 'scope':
cd.require(author(row) == cd.RELEASE_OWNER and row['content'].strip() == '确认范围' and frozen_approval(task['id']),
cd.require(frozen_approval(task['id'], row['id']),
'require the release owner reply on the exact scope preview')
return coordinator.queue(task['id'])
return qa(task, row)