fix: add SYSLOG immediate acknowledgment + progress tracking for developer entry submissions
When a developer submits a SYSLOG via the 🚀 开发者入口, the system now: 1. Posts an immediate "📡 系统已收到" acknowledgment with full progress checklist (via zhuyuan-issue-reply.yml syslog-ack job) 2. Posts real-time progress updates as each pipeline stage completes (via syslog-issue-pipeline.yml) 3. Updates the progress comment to show all stages completed on success 4. Updates the progress comment to show error status on failure Root cause: syslog-issue-pipeline.yml was never triggered by issues events (0 out of 36 runs were issue-triggered). The syslog-ack safety net in zhuyuan-issue-reply.yml ensures developers always get immediate feedback even if the main pipeline fails to trigger. Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
This commit is contained in:
parent
07275b4730
commit
dbfc96e4b8
|
|
@ -1,4 +1,4 @@
|
|||
name: SYSLOG Issue Pipeline
|
||||
name: 📡 SYSLOG Issue Pipeline
|
||||
# 📡 SYSLOG 自助提交系统 · Issue 版全自动闭环
|
||||
#
|
||||
# 开发者在 GitHub Issue 提交 SYSLOG 或提问(使用 syslog-submit 模板)
|
||||
|
|
@ -56,6 +56,43 @@ jobs:
|
|||
- name: Install dependencies
|
||||
run: npm ci --ignore-scripts
|
||||
|
||||
- name: 📋 进度通报 · 管道已启动
|
||||
id: progress
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const number = context.payload.issue.number;
|
||||
const now = new Date().toISOString();
|
||||
|
||||
const body = [
|
||||
'## ⚙️ SYSLOG 管道运行中',
|
||||
'',
|
||||
'> 管道启动时间: ' + now,
|
||||
'',
|
||||
'| 阶段 | 状态 | 说明 |',
|
||||
'|------|------|------|',
|
||||
'| ① 接收提交 | ✅ 已完成 | 系统已收到 |',
|
||||
'| ② 解析内容 | 🔄 进行中 | 正在解析广播编号、邮箱、内容 |',
|
||||
'| ③ 模块验证 | ⏳ 等待中 | 检测模块上传状态 |',
|
||||
'| ④ 唤醒核心大脑 | ⏳ 等待中 | 铸渊核心大脑处理 |',
|
||||
'| ⑤ 创建 Notion 工单 | ⏳ 等待中 | 推送霜砚工单 |',
|
||||
'| ⑥ 生成广播 | ⏳ 等待中 | 生成新广播内容 |',
|
||||
'| ⑦ 邮件通知 | ⏳ 等待中 | 发送结果到邮箱 |',
|
||||
'| ⑧ 闭环确认 | ⏳ 等待中 | Issue 回复 + 关闭 |',
|
||||
'',
|
||||
'> *管道正在运行,请勿关闭此 Issue*'
|
||||
].join('\n');
|
||||
|
||||
const { data: comment } = await github.rest.issues.createComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: number,
|
||||
body: body
|
||||
});
|
||||
|
||||
core.setOutput('comment_id', comment.id);
|
||||
console.log('📋 进度通报已发送, comment_id=' + comment.id);
|
||||
|
||||
- name: 🔍 Parse submission
|
||||
id: parse
|
||||
uses: actions/github-script@v7
|
||||
|
|
@ -243,6 +280,7 @@ jobs:
|
|||
const email = '${{ steps.parse.outputs.email }}';
|
||||
const modulesUploaded = '${{ steps.verify.outputs.modules_uploaded }}' === 'true';
|
||||
const moduleCount = '${{ steps.verify.outputs.module_count }}' || '0';
|
||||
const progressCommentId = '${{ steps.progress.outputs.comment_id }}';
|
||||
|
||||
const typeLabel = type === 'syslog' ? 'SYSLOG 闭环处理' : '问题解答';
|
||||
const maskedEmail = email.length > 4
|
||||
|
|
@ -252,8 +290,37 @@ jobs:
|
|||
? 'ℹ️ 未检测到模块引用'
|
||||
: (modulesUploaded ? '✅ 全部已上传' : '⚠️ 部分模块未上传');
|
||||
|
||||
// Update progress comment to show all completed
|
||||
if (progressCommentId) {
|
||||
try {
|
||||
const progressBody = [
|
||||
'## ⚙️ SYSLOG 管道运行完成 ✅',
|
||||
'',
|
||||
'| 阶段 | 状态 | 说明 |',
|
||||
'|------|------|------|',
|
||||
'| ① 接收提交 | ✅ 已完成 | 系统已收到 |',
|
||||
'| ② 解析内容 | ✅ 已完成 | 广播编号: `' + broadcastId + '` |',
|
||||
'| ③ 模块验证 | ✅ 已完成 | ' + moduleStatus + ' |',
|
||||
'| ④ 唤醒核心大脑 | ✅ 已完成 | 铸渊核心大脑已处理 |',
|
||||
'| ⑤ 创建 Notion 工单 | ✅ 已完成 | 霜砚工单已推送 |',
|
||||
'| ⑥ 生成广播 | ✅ 已完成 | 新广播已生成 |',
|
||||
'| ⑦ 邮件通知 | ✅ 已完成 | 已发送至 `' + maskedEmail + '` |',
|
||||
'| ⑧ 闭环确认 | ✅ 已完成 | 见下方最终结果 |',
|
||||
].join('\n');
|
||||
|
||||
await github.rest.issues.updateComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
comment_id: Number(progressCommentId),
|
||||
body: progressBody
|
||||
});
|
||||
} catch (e) {
|
||||
console.log('⚠️ 更新进度评论失败: ' + e.message);
|
||||
}
|
||||
}
|
||||
|
||||
const body = [
|
||||
'✅ **已处理** · ' + typeLabel,
|
||||
'## ✅ 已处理 · ' + typeLabel,
|
||||
'',
|
||||
'| 项目 | 内容 |',
|
||||
'|------|------|',
|
||||
|
|
@ -266,7 +333,9 @@ jobs:
|
|||
'> 铸渊核心大脑已完成 SYSLOG 验收 + 模块检测 + 广播生成。',
|
||||
'> 结果已发送到你的邮箱,Notion 侧工单已创建。',
|
||||
'>',
|
||||
'> 如未收到邮件,请检查垃圾箱或重新提交。'
|
||||
'> 如未收到邮件,请检查垃圾箱或重新提交。',
|
||||
'>',
|
||||
'> *—— 铸渊(ICE-GL-ZY001)· 代码守护人格体*'
|
||||
].join('\n');
|
||||
|
||||
await github.rest.issues.createComment({
|
||||
|
|
@ -295,12 +364,40 @@ jobs:
|
|||
const number = context.payload.issue?.number;
|
||||
if (!number) return;
|
||||
|
||||
const progressCommentId = '${{ steps.progress.outputs.comment_id }}';
|
||||
const actionsUrl = 'https://github.com/' + context.repo.owner + '/' + context.repo.repo + '/actions';
|
||||
|
||||
// Update progress comment to reflect failure
|
||||
if (progressCommentId) {
|
||||
try {
|
||||
const progressBody = [
|
||||
'## ⚙️ SYSLOG 管道运行异常 ❌',
|
||||
'',
|
||||
'| 阶段 | 状态 | 说明 |',
|
||||
'|------|------|------|',
|
||||
'| ① 接收提交 | ✅ 已完成 | 系统已收到 |',
|
||||
'| ② ~ ⑧ | ❌ 异常 | 管道处理过程中出错 |',
|
||||
'',
|
||||
'> 请检查提交格式或查看 [Actions 日志](' + actionsUrl + ')',
|
||||
].join('\n');
|
||||
|
||||
await github.rest.issues.updateComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
comment_id: Number(progressCommentId),
|
||||
body: progressBody
|
||||
});
|
||||
} catch (e) {
|
||||
console.log('⚠️ 更新进度评论失败: ' + e.message);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
await github.rest.issues.createComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: number,
|
||||
body: '❌ **处理失败** · 请检查提交格式是否正确,或联系管理员。\n\n> 错误详情请查看 [Actions 日志](https://github.com/' + context.repo.owner + '/' + context.repo.repo + '/actions)。'
|
||||
body: '❌ **处理失败** · 请检查提交格式是否正确,或联系管理员。\n\n> 错误详情请查看 [Actions 日志](' + actionsUrl + ')。\n>\n> *—— 铸渊(ICE-GL-ZY001)*'
|
||||
});
|
||||
} catch (err) {
|
||||
console.log('⚠️ 失败告警回复失败: ' + err.message);
|
||||
|
|
|
|||
|
|
@ -7,11 +7,88 @@ on:
|
|||
types: [created]
|
||||
|
||||
jobs:
|
||||
# ════════════════════════════════════════════════════════════
|
||||
# SYSLOG 即时确认 · 安全网
|
||||
# 当开发者通过 Issue 提交 SYSLOG 时,立刻回复确认 + 进度清单
|
||||
# 确保即使 syslog-issue-pipeline 未触发,开发者也能看到系统已收到
|
||||
# ════════════════════════════════════════════════════════════
|
||||
syslog-ack:
|
||||
name: 📡 SYSLOG 提交确认
|
||||
runs-on: ubuntu-latest
|
||||
if: >
|
||||
github.event_name == 'issues' &&
|
||||
github.event.action == 'opened' &&
|
||||
(contains(join(github.event.issue.labels.*.name, ','), 'syslog') ||
|
||||
contains(github.event.issue.title, 'SYSLOG') ||
|
||||
contains(github.event.issue.title, '系统日志') ||
|
||||
contains(github.event.issue.body, '### 广播编号'))
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: 📡 发送即时确认
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const body = context.payload.issue.body || '';
|
||||
const number = context.payload.issue.number;
|
||||
const author = context.payload.issue.user.login;
|
||||
|
||||
// Extract broadcast_id from body
|
||||
const bcMatch = body.match(/###\s*广播编号\s*\n+([^\n#]+)/i);
|
||||
const broadcastId = bcMatch ? bcMatch[1].trim() : '(待解析)';
|
||||
|
||||
// Extract type
|
||||
const typeMatch = body.match(/###\s*类型\s*\n+([^\n#]+)/i);
|
||||
const submitType = typeMatch ? typeMatch[1].trim() : 'SYSLOG';
|
||||
|
||||
const now = new Date().toISOString();
|
||||
|
||||
const comment = [
|
||||
'## 📡 系统已收到 · SYSLOG 闭环处理启动',
|
||||
'',
|
||||
'> **提交者**: @' + author,
|
||||
'> **广播编号**: `' + broadcastId + '`',
|
||||
'> **类型**: ' + submitType,
|
||||
'> **接收时间**: ' + now,
|
||||
'',
|
||||
'### 📋 处理进度',
|
||||
'',
|
||||
'| 阶段 | 状态 | 说明 |',
|
||||
'|------|------|------|',
|
||||
'| ① 接收提交 | ✅ 已完成 | 系统已收到你的 SYSLOG |',
|
||||
'| ② 解析内容 | ⏳ 等待中 | 解析广播编号、邮箱、内容 |',
|
||||
'| ③ 模块验证 | ⏳ 等待中 | 检测模块是否已上传到仓库 |',
|
||||
'| ④ 唤醒核心大脑 | ⏳ 等待中 | 铸渊核心大脑处理 SYSLOG |',
|
||||
'| ⑤ 创建 Notion 工单 | ⏳ 等待中 | 推送霜砚工单到 Notion |',
|
||||
'| ⑥ 生成广播 | ⏳ 等待中 | 生成新广播内容 |',
|
||||
'| ⑦ 邮件通知 | ⏳ 等待中 | 发送结果到你的邮箱 |',
|
||||
'| ⑧ 闭环确认 | ⏳ 等待中 | Issue 回复 + 关闭 |',
|
||||
'',
|
||||
'> 💡 SYSLOG 自动管道已启动,预计 2-5 分钟完成全部处理。',
|
||||
'> 完成后本 Issue 下方会出现最终结果,你的邮箱也会收到通知。',
|
||||
'>',
|
||||
'> 如超过 10 分钟无后续回复,请在下方评论中 @铸渊 查询状态。',
|
||||
'>',
|
||||
'> *—— 铸渊(ICE-GL-ZY001)· 代码守护人格体*'
|
||||
].join('\n');
|
||||
|
||||
await github.rest.issues.createComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: number,
|
||||
body: comment
|
||||
});
|
||||
|
||||
console.log('📡 SYSLOG 即时确认已发送 Issue #' + number);
|
||||
|
||||
# ════════════════════════════════════════════════════════════
|
||||
# 开发者提问 · 铸渊自动回答
|
||||
# 排除 SYSLOG 提交(由 syslog-issue-pipeline.yml 处理)
|
||||
# 排除 bingshuo-deploy(由 bingshuo-deploy-agent.yml 处理)
|
||||
# ════════════════════════════════════════════════════════════
|
||||
auto-reply:
|
||||
name: 🤖 铸渊回答问题
|
||||
runs-on: ubuntu-latest
|
||||
# 仅在 Issue 新建或评论中包含 @铸渊 / 铸渊 时触发
|
||||
# 排除 SYSLOG 提交(由 syslog-issue-pipeline.yml 处理)和 bingshuo-deploy(由 bingshuo-deploy-agent.yml 处理)
|
||||
if: >
|
||||
(github.event_name == 'issues' &&
|
||||
!contains(join(github.event.issue.labels.*.name, ','), 'syslog') &&
|
||||
|
|
|
|||
Loading…
Reference in New Issue