-
Notifications
You must be signed in to change notification settings - Fork 0
fix: T8 合并 PR 谓词跨仓检索 v2(ADR-0085) #355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -412,13 +412,24 @@ jobs: | |
| gate 绿由 PR required checks 承担(合并事实即全 gate 绿的载体); | ||
| 不信任标签事件载荷——API 重查(fail-closed:读取失败=拒绝)。""" | ||
| target = f"{REPO}#{issue_number}" | ||
| # 跨仓检索(ADR-0085 实走教训:卡在治理仓、PR 可落在任意仓—— | ||
| # archive#17/cnb-bridge#1 均为跨仓绑定,本仓清单法漏判)。 | ||
| # search 索引分钟级延迟:命中即真(合并事实不可伪造),未命中再回退 | ||
| # 本仓 pulls 双查,两通道皆空才判未完成(重置 done 标签即重放,幂等)。 | ||
| q = urllib.parse.quote(f'"{target}" is:pr is:merged org:{ORG}') | ||
| st, hits = api(E["APP_TOKEN"], f"/search/issues?q={q}&per_page=20") | ||
| search_ok = st == 200 | ||
| if search_ok: | ||
| for it in hits.get("items") or []: | ||
| if target in (it.get("body") or ""): | ||
| return True, f"跨仓 PR 已合并:{it.get('html_url')} 绑定 {target}" | ||
|
Comment on lines
+419
to
+425
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win 跨仓检索与绑定校验仍有两个会影响合并判定的具体问题:
📍 Affects 1 file
🤖 Prompt for AI Agents |
||
| st, prs = api(E["APP_TOKEN"], f"/repos/{REPO}/pulls?state=closed&per_page=100") | ||
| if st != 200: | ||
| return False, f"PR 清单读取失败 HTTP {st}(fail-closed)" | ||
| if st != 200 and not search_ok: | ||
| return False, f"PR 检索双通道均不可用(search={search_ok} pulls HTTP {st}——fail-closed)" | ||
| for pr in prs or []: | ||
| if pr.get("merged_at") and target in (pr.get("body") or ""): | ||
| return True, f"PR #{pr['number']} 已合并({pr['merged_at']})绑定 {target}" | ||
| return False, f"无绑定 {target} 且已合并的 PR(近 100 个 closed PR 内)" | ||
| return False, f"无绑定 {target} 且已合并的 PR(跨仓 search{'OK' if search_ok else 'FAIL'} + 本仓 closed PR 双查均空)" | ||
|
|
||
| if t["id"] == "T8": | ||
| okp, reason = check_merged_pr(ISSUE) | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. Scoped token blocks cross-repo
🐞 Bug≡ CorrectnessAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools