Repository navigation
巡检与反爬诊断共用并发组,推送失败可重试 - #7
Conversation
2026-11-04 13:23 的巡检在「提交中文报告与订阅」阶段失败:同一时刻另一个巡检 任务已经推送过同样的生成文件,`git pull --rebase` 在 data/、reports/、 subscriptions/ 上全线冲突,已经跑完的巡检被判红。 - patrol.yml 与 access.yml 共用 concurrency 组 `vensrc-main`:两个工作流都会把 生成文件写回 main,串行执行就不会互撞(release.yml 不写 main,保持原组) - 新增 .github/scripts/push_generated.sh:暂存 → 提交 → fetch → `pull --rebase -X theirs`(本提交只有生成物,冲突时保留本轮结果)→ push,失败退避重试 5 次 - patrol 里「本轮之后受信任的清单或脚本被改过就不能发布」的守卫保留,并把 .github/scripts/ 一并纳入比较范围 - 两个工作流里重复的 commit/pull/push 逻辑收敛到同一个脚本 验证:actionlint 通过;本地沙箱复现了两个提交同时改同一文件的情况——直接 push 被拒,脚本里的 fetch + rebase -X theirs + push 成功且保留本轮的生成内容。
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1198ee53dd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for attempt in $(seq 1 "$attempts"); do | ||
| git -c credential.helper="$credential" fetch --quiet origin main | ||
| # 本提交只含脚本生成物,冲突时以本轮结果为准。 | ||
| git -c credential.helper="$credential" pull --rebase -X theirs --quiet origin main |
There was a problem hiding this comment.
Preserve generated outputs as a complete snapshot during retries
When another patrol has published results since this run's checkout, -X theirs can silently publish inconsistent subscriptions and evidence rather than preserve this run's complete outputs. The Git documentation explains that the option resolves “conflicting hunks”; nonconflicting changes are still merged. I reproduced this with the new script in two local clones: the remote patrol added a third subscription, while the local patrol generated two subscriptions with updated lock timestamps and report. The script successfully pushed an index containing three entries, but a lock file and report containing only two. Previously, the conflicting timestamps/report stopped publication. Preserve and reapply the entire generated snapshot, including files unchanged relative to the original checkout, or regenerate and validate the outputs against the fetched base before pushing.
Useful? React with 👍 / 👎.
问题
今天 13:23 的巡检失败在最后一步:
同一时刻另一个巡检任务已经推过同样的生成文件,两边
git pull --rebase撞车,已经跑完 12 分钟巡检的结果被丢弃。根因:
patrol.yml和access.yml各自有独立的concurrency组,但两个工作流都会把生成文件写回main;并发组只防自己跟自己撞。改动
patrol.yml与access.yml都改用group: vensrc-main,串行执行就不会互撞。release.yml只创建 Release、不写 main,保持原组。.github/scripts/push_generated.sh:commit→fetch→pull --rebase -X theirs→pushPUSH_ATTEMPTS可调).github/scripts/纳入比较范围。验证
actionlint通过git push被拒(non-fast-forward)→ 脚本的fetch + pull --rebase -X theirs + push成功,且文件内容是本轮生成的那份