Skip to content

fix(ci): skip Periphery scans for unrelated PR changes - #107991

Merged
hxy91819 merged 3 commits into
mainfrom
agent/fix-periphery-pr-scope-drift
Jul 19, 2026
Merged

hxy91819 merged 3 commits into
mainfrom
agent/fix-periphery-pr-scope-drift

Conversation

@hxy91819

Copy link
Copy Markdown
Member

Related: #106090
Observed on: #106789

What Problem This Solves

Fixes an issue where pull requests unrelated to iOS, macOS, or shared OpenClawKit could run Periphery scans when main advanced after the pull-request event was created. The stale event base SHA made base-branch changes look like pull-request changes, consuming macOS runners and adding irrelevant checks.

Why This Change Was Made

The three Periphery scope jobs now compare GitHub's synthetic pull-request merge commit with its first parent, which is the exact base tree used to build that merge result. Checkout depth is increased to two so both commits are available; the stale event-base fetch is no longer needed.

Scope behavior remains fail-closed, manual dispatch still scans, draft pull requests still skip, and renamed files remain covered.

User Impact

Unrelated pull requests no longer start iOS, macOS, or shared OpenClawKit Periphery scan jobs solely because main changed. Pull requests that actually touch the scoped native paths continue to run the same scans.

AI-assisted change; I reviewed and understand the implementation and tests.

Evidence

  • Regression test builds a hermetic synthetic merge where main adds a shared OpenClawKit file while the PR changes only docs. The old event-base comparison reports a scoped change; HEAD^1..HEAD reports only the PR's docs file and sets should-scan=false.
  • node scripts/run-vitest.mjs test/scripts/periphery-scope-workflows.test.ts test/scripts/ios-periphery-comment-workflow.test.ts test/scripts/periphery-intersection.test.ts — 3 files, 36 tests passed.
  • node scripts/check-workflows.mjs — passed, including zizmor and interpolation checks.
  • oxfmt --check on all six touched files — passed.
  • git diff --check — passed.
  • Fresh autoreview — no accepted/actionable findings; patch correct at 0.96 confidence.
  • Blacksmith Testbox run https://github.com/openclaw/openclaw/actions/runs/29387812718 reached ready state but the delegated host DNS timed out before repository commands could execute. A second fresh lease failed at the same infrastructure stage, so focused tests used the repository's permitted narrow local fallback above.

@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels Jul 15, 2026
@hxy91819
hxy91819 marked this pull request as ready for review July 15, 2026 04:06

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7321433f63

ℹ️ 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".

@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Jul 15, 2026
@hxy91819

Copy link
Copy Markdown
Member Author

@clawsweeper automerge

@clawsweeper

clawsweeper Bot commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞🔧
ClawSweeper automerge is enabled.

Draft PRs stay fix-only until GitHub marks them ready for review. Pause with /clawsweeper stop.

Automerge progress:

  • 2026-07-19 07:56:17 UTC review queued 96c3999a75bc (queued)
  • 2026-07-16 06:26:52 UTC review passed 96c3999a75bc (structured ClawSweeper verdict: pass (sha=96c3999a75bc678f6df8bb73a0f6be2b3135f...)

@clawsweeper clawsweeper Bot added the clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge label Jul 15, 2026
@hxy91819
hxy91819 force-pushed the agent/fix-periphery-pr-scope-drift branch from 0cb611f to 667cf25 Compare July 15, 2026 09:24
@hxy91819
hxy91819 force-pushed the agent/fix-periphery-pr-scope-drift branch from 667cf25 to 96c3999 Compare July 15, 2026 09:58
@hxy91819

Copy link
Copy Markdown
Member Author

@clawsweeper automerge

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 🚀 automerge armed This PR is in ClawSweeper's automerge lane. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Jul 16, 2026
@clawsweeper

clawsweeper Bot commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 19, 2026, 4:48 AM ET / 08:48 UTC.

Summary
The branch changes the iOS, macOS, and shared OpenClawKit Periphery scope jobs to diff the synthetic pull-request merge commit against its first parent, with focused regression tests and changed-test routing coverage.

PR surface: Tests +83, Config -27, Other +12. Total +68 across 8 files.

Reproducibility: yes. in source: the new hermetic synthetic-merge test models a base-only native-path change plus a docs-only PR change, the condition that makes the stale event-base comparison incorrectly select a scan.

Review metrics: none identified.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🌊 off-meta tidepool
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Let the existing automerge gate recompute the merge ref and require the final exact-head checks before landing.

Risk before merge

  • [P1] The branch is reported as behind main; before landing, automerge must re-evaluate the final synthetic merge ref and required exact-head workflow checks so the HEAD^1 assumption is validated against the actual merge result.

Maintainer options:

  1. Retain automerge with final merge-ref gating (recommended)
    Allow the existing automerge lane to land only after GitHub recomputes the final pull-request merge ref and all required exact-head workflow checks pass.

Next step before merge

  • [P2] No discrete repair is identified; retain the existing automerge opt-in and let refreshed mergeability plus required exact-head checks decide landing.

Security
Cleared: The patch keeps existing pinned GitHub Actions references and does not add permissions, dependencies, secrets, artifact execution, or external code sources.

Review details

Best possible solution:

Keep the local, credential-free scope detector and land this bounded HEAD^1..HEAD correction only after the final merge ref and required automation checks remain green.

Do we have a high-confidence way to reproduce the issue?

Yes, in source: the new hermetic synthetic-merge test models a base-only native-path change plus a docs-only PR change, the condition that makes the stale event-base comparison incorrectly select a scan.

Is this the best way to solve the issue?

Yes: comparing the checked-out synthetic merge commit with its first parent is the narrowest maintainable way to isolate the PR contribution while retaining manual-dispatch, draft, rename, and fail-closed behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 2e8b042f9fba.

Label changes

Label justifications:

  • P2: This corrects a bounded CI regression that wastes native-runner capacity and adds irrelevant checks to unrelated pull requests.
  • merge-risk: 🚨 automation: The patch changes GitHub Actions scope detection that decides whether four Periphery scan jobs execute.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 🚀 automerge armed: This PR is in ClawSweeper's automerge lane. Not applicable: The author is a repository member, so the external-contributor proof gate does not apply; the PR nevertheless provides focused synthetic-merge and exact-head workflow evidence.
Evidence reviewed

PR surface:

Tests +83, Config -27, Other +12. Total +68 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 4 254 171 +83
Docs 0 0 0 0
Config 3 12 39 -27
Generated 0 0 0 0
Other 1 15 3 +12
Total 8 281 213 +68

What I checked:

  • Distinct scope defect: The three workflow edits replace the event payload base SHA with HEAD^1 after checking out the synthetic pull-request merge commit, so the detector evaluates the PR contribution against the exact base tree used for that merge result. (.github/workflows/ios-periphery.yml:45, 261db3373b84)
  • Sibling workflow coverage: The same scoped-diff correction is applied to the macOS and shared OpenClawKit workflows, preserving their existing independent path sets rather than creating a one-sided iOS-only fix. (.github/workflows/shared-openclawkit-periphery.yml:45, 261db3373b84)
  • Regression and routing coverage: The added synthetic-merge test covers the stale-base scenario across all three workflows, and changed-test routing now selects that regression suite whenever one of those workflows changes. (test/scripts/periphery-scope-workflows.test.ts:1, 261db3373b84)
  • Adjacent merged provenance: The earlier merged Periphery fix introduced local fail-closed Git diffs to avoid pull-request-files API quota failures; this PR changes the comparison base for that same detector rather than duplicating the earlier fix. (.github/workflows/ios-periphery.yml:45, d38fc3e2f06c)
  • Exact-head validation context: The provided PR check state reports successful actionlint, workflow guard, precise changed-path, and all three Periphery scope detector checks for the current branch head; the remaining queued scans are normal downstream work, not a demonstrated regression. (261db3373b84)

Likely related people:

  • steipete: The merged Periphery scope implementation in the related PR established the local Git-diff detector that this PR corrects for merge-base drift. (role: introduced adjacent current workflow behavior; confidence: medium; commits: d38fc3e2f06c; files: .github/workflows/ios-periphery.yml, .github/workflows/macos-periphery.yml, .github/workflows/shared-openclawkit-periphery.yml)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (1 earlier review cycle)
  • reviewed 2026-07-16T02:30:39.779Z sha 96c3999 :: passed. :: none

@hxy91819

Copy link
Copy Markdown
Member Author

Addressed the ClawSweeper follow-up in #107991 (comment).

Land-ready proof for exact head 261db3373b846e20448ff72755dfa0f18c59d169:

  • Refreshed onto main f07a1fb5027f6af7cacb360968085e224d094eae; the later main drift through 8631832048cfd5f08f33e1899a373914e515c579 does not touch any of the eight PR paths.
  • Resolved the current-main routing conflict by preserving both the existing macOS workflow owner test and the new consolidated scope regression test.
  • Focused local proof: node scripts/run-vitest.mjs test/scripts/periphery-scope-workflows.test.ts test/scripts/ios-periphery-comment-workflow.test.ts test/scripts/periphery-intersection.test.ts test/scripts/test-projects.test.ts — 4 files, 251 tests passed.
  • Workflow proof: node scripts/check-workflows.mjs and git diff --check passed.
  • Fresh autoreview: no accepted/actionable findings; patch correct, confidence 0.96.
  • Exact-head openclaw/ci-gate passed. The Blacksmith Testbox check also passed.
  • All three exact-head scope detectors passed: iOS, macOS, and shared OpenClawKit.

The HEAD^1 assumption is intentionally coupled to the pull_request synthetic merge checkout: actions/checkout v6 fetches two commits, and the hermetic regression constructs the synthetic merge and proves that HEAD^1..HEAD contains only the PR delta while the stale event-base diff includes unrelated base drift.

The old failed run 29406453190 was the unrelated plugin-npm-extended-stable-workflow test; the refreshed exact-head gate above is green.

@hxy91819
hxy91819 merged commit c26d3cf into main Jul 19, 2026
99 checks passed
@hxy91819
hxy91819 deleted the agent/fix-periphery-pr-scope-drift branch July 19, 2026 08:52
@hxy91819

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 20, 2026
* fix(ci): scope Periphery to PR merge changes

* test(ci): align Periphery changed-test routing
zooqueen pushed a commit to zooqueen/openclaw that referenced this pull request Sep 11, 2026
* fix(ci): scope Periphery to PR merge changes

* test(ci): align Periphery changed-test routing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: M status: 🚀 automerge armed This PR is in ClawSweeper's automerge lane.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants