fix: address code review feedback — property type parsing, magic number extraction, diagnostic clarity
Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com> Agent-Logs-Url: https://github.com/qinfendebingshuo/guanghulab/sessions/349be7ce-3eda-4280-8109-d4844191898a
This commit is contained in:
parent
d629df12e8
commit
7ef7bea084
|
|
@ -29,6 +29,7 @@ env:
|
|||
SYNC_LOG_PATH: ".github/persona-brain/dev-status-sync-log.json"
|
||||
YELLOW_THRESHOLD_HOURS: 14
|
||||
RED_THRESHOLD_HOURS: 48
|
||||
SYNC_FRESHNESS_MINUTES: 10
|
||||
|
||||
jobs:
|
||||
check-sync-status:
|
||||
|
|
@ -152,7 +153,7 @@ jobs:
|
|||
const d = JSON.parse(require('fs').readFileSync('$SYNC_LOG_PATH','utf8'));
|
||||
const syncTime = new Date(d.last_sync || '2000-01-01');
|
||||
const diffMin = (Date.now() - syncTime.getTime()) / 60000;
|
||||
if (d.status === 'success' && diffMin < 10) console.log('success');
|
||||
if (d.status === 'success' && diffMin < ${{ env.SYNC_FRESHNESS_MINUTES }}) console.log('success');
|
||||
else console.log('stale');
|
||||
} catch { console.log('error'); }
|
||||
")
|
||||
|
|
|
|||
|
|
@ -86,7 +86,8 @@ async function fetchDevStatusFromNotion() {
|
|||
// 解析 Notion 页面属性为 dev-status 格式(霜砚签发制格式)
|
||||
const team = pages.map(page => {
|
||||
const props = page.properties || {};
|
||||
const lastSyslog = getNotionText(props['最后SYSLOG']) || getNotionDate(props['最后SYSLOG']);
|
||||
const syslogProp = props['最后SYSLOG'];
|
||||
const lastSyslog = getNotionDate(syslogProp) || getNotionText(syslogProp);
|
||||
return {
|
||||
dev_id: getNotionText(props['编号']) || getNotionTitle(props['Name']) || '',
|
||||
name: getNotionText(props['昵称']) || getNotionTitle(props['Name']) || '',
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
"all_failed": true,
|
||||
"last_success": "从未成功",
|
||||
"last_failure": "2026-03-24T15:02:00Z",
|
||||
"failure_root_cause": "E",
|
||||
"failure_root_cause": "E (Workflow不存在/配置错误 — PR创建被拒绝)",
|
||||
"failure_detail": "peter-evans/create-pull-request@v7 报错:GitHub Actions is not permitted to create or approve pull requests. 仓库设置不允许 Actions 创建 PR,导致每次同步数据拉取成功但提交失败。"
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue