Skip to content

fix(ci): support fork PR workflows for community contributors#143

Merged
dev01lay2 merged 4 commits intodevelopfrom
fix/fork-pr-ci
Mar 19, 2026
Merged

fix(ci): support fork PR workflows for community contributors#143
dev01lay2 merged 4 commits intodevelopfrom
fix/fork-pr-ci

Conversation

@dev01lay2
Copy link
Collaborator

Problem

When a community contributor opens a PR from a fork (e.g. zzhengzhuo015/clawpallay2dev/clawpal), 3 CI workflows fail:

  1. screenshot.ymlactions/checkout uses github.head_ref which doesn't exist in the base repo
  2. coverage.ymlpeter-evans/create-or-update-comment fails because fork PRs get a read-only GITHUB_TOKEN
  3. metrics.yml — Same comment-posting failure as coverage

Fix

  • screenshot.yml: Checkout from github.event.pull_request.head.repo.full_name + skip push/comment steps for fork PRs
  • coverage.yml + metrics.yml: Skip PR comment steps for fork PRs

All checks, builds, and tests still run for fork PRs — only write-back steps (pushing screenshot refs, posting PR comments) are skipped since the fork token lacks write permissions.

Context

Triggered by PR #142 (feat: remote doctor by @zzhengzhuo015) which had 3 CI failures due to being a fork contribution.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 19, 2026

📊 Test Coverage Report

Metric Base (develop) PR (fix/fork-pr-ci) Delta
Lines 74.43% (6141/8251) 74.34% (6134/8251) 🔴 -0.09%
Functions 68.88% (704/1022) 68.88% (704/1022) ⚪ ±0.00%
Regions 75.96% (10169/13388) 75.86% (10156/13388) 🔴 -0.10%

Coverage measured by cargo llvm-cov (clawpal-core + clawpal-cli).

@github-actions
Copy link
Contributor

github-actions bot commented Mar 19, 2026

📦 PR Build Artifacts

Platform Download Size
Windows-x64 📥 clawpal-Windows-x64 15.7 MB
Linux-x64 📥 clawpal-Linux-x64 102.9 MB
macOS-ARM64 📥 clawpal-macOS-ARM64 12.3 MB
macOS-x64 📥 clawpal-macOS-x64 12.9 MB

🔨 Built from 648db50 · View workflow run
⚠️ Unsigned development builds — for testing only

Copy link
Collaborator

@Keith-CY Keith-CY left a comment

Choose a reason for hiding this comment

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

P1 - .github/workflows/screenshot.yml:3-27

This change fixes fork PR checkout, but it also breaks the existing workflow_dispatch entrypoint for the screenshot workflow. The workflow still declares workflow_dispatch, yet the checkout step now unconditionally reads github.event.pull_request.head.repo.full_name and github.event.pull_request.head.ref. Those fields do not exist on manual runs, so the very first step loses its repository/ref inputs and the manually triggered screenshot job stops working.

Please keep the PR-specific checkout for pull_request, but fall back to github.repository + the current ref for workflow_dispatch (or split the checkout into separate guarded steps) so manual screenshot runs continue to work.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 19, 2026

📏 Metrics Gate Report

Status: ✅ All gates passed

Commit Size ✅

Metric Value Limit Status
Commits checked 4
All within limit 4/4 ≤ 500 lines
Largest commit 99 lines ≤ 500

Bundle Size ✅

Metric Value Limit Status
JS bundle (raw) 918 KB
JS bundle (gzip) 289 KB ≤ 350 KB
JS initial load (gzip) 164 KB ≤ 180 KB

Perf Metrics E2E ✅

Metric Value Limit Status
Tests 10 passed, 0 failed 0 failures
RSS (test process) 3.2 MB ≤ 20 MB
VMS (test process) 269.9 MB ℹ️
Command P50 latency 32 µs ≤ 1000 µs
Command P95 latency 56 µs ≤ 5000 µs
Command max latency 89 µs ≤ 50000 µs

Command Perf (local) ✅

Metric Value Status
Tests 4 passed, 0 failed
Commands measured 5 ℹ️
RSS (test process) 4.4 MB ℹ️
Local command timings
Command P50 (µs) P95 (µs) Max (µs)
local_openclaw_config_exists 1 9 9
list_ssh_hosts 2 10 10
get_app_preferences 17 41 41
read_app_log 60 77 77
read_error_log 6 11 11

Command Perf (remote SSH) ✅

Metric Value Status
SSH transport OK
Command failures 12/15 runs ℹ️ Docker (no gateway)
Remote command timings (via Docker SSH)
Command Median Max
openclaw_status 2215 ms 2229 ms
cat__root_.openclaw_openclaw.json 252 ms 253 ms
openclaw_gateway 2378 ms 2390 ms
openclaw_cron 2264 ms 2269 ms
openclaw_agent 2395 ms 2549 ms

Home Page Render Probes (real IPC) ✅

Probe Value Limit Status
status 33 ms ≤ 500 ms
version 120 ms ≤ 500 ms
agents 33 ms ≤ 500 ms
models 134 ms ≤ 500 ms
settled 145 ms ≤ 500 ms

Code Readability

File Lines Target Status
commands/doctor_assistant.rs 5636 ≤ 3000 ⚠️
commands/rescue.rs 3402 ≤ 2000 ⚠️
commands/profiles.rs 2477 ≤ 1500 ⚠️
cli_runner.rs 1915 ≤ 1200 ⚠️
commands/credentials.rs 1629 ≤ 1000 ⚠️
openclaw_doc_resolver.rs 1362 ≤ 800 ⚠️
commands/ssh.rs 1232 ≤ 700 ⚠️
commands/doctor.rs 1168 ≤ 700 ⚠️
commands/sessions.rs 905 ≤ 500 ⚠️
pages/StartPage.tsx 898 ≤ 500 ⚠️
pages/Settings.tsx 897 ≤ 500 ⚠️
commands/discovery.rs 878 ≤ 500 ⚠️
pages/Home.tsx 875 ≤ 500 ⚠️
install/commands.rs 839 ≤ 500 ⚠️
ssh.rs 826 ≤ 500 ⚠️
lib/use-api.ts 674 ≤ 500 ⚠️
commands/model.rs 645 ≤ 500 ⚠️
bridge_client.rs 645 ≤ 500 ⚠️
components/InstallHub.tsx 619 ≤ 500 ⚠️
agent_fallback.rs 609 ≤ 500 ⚠️
install/runners/docker.rs 525 ≤ 500 ⚠️
commands/types.rs 518 ≤ 500 ⚠️
commands/overview.rs 508 ≤ 500 ⚠️
components/SessionAnalysisPanel.tsx 503 ≤ 500 ⚠️
commands/instance.rs 501 ≤ 500 ⚠️
App.tsx 498 ≤ 500
lib/types.ts 490 ≤ 500
pages/Doctor.tsx 479 ≤ 500
commands/agent.rs 475 ≤ 500
pages/Channels.tsx 460 ≤ 500
commands/backup.rs 459 ≤ 500
lib/api.ts 453 ≤ 500
node_client.rs 452 ≤ 500
commands/discover_local.rs 441 ≤ 500
pages/Cron.tsx 429 ≤ 500
components/__tests__/DoctorRecoveryOverview.test.tsx 429 ≤ 500
commands/config.rs 419 ≤ 500
bug_report/queue.rs 409 ≤ 500
commands/channels.rs 405 ≤ 500
lib/api-read-cache.ts 401 ≤ 500
components/__tests__/InstanceCard.test.tsx 400 ≤ 500
lib/__tests__/guidance.test.ts 399 ≤ 500
components/DoctorRecoveryOverview.tsx 383 ≤ 500
lib/use-cached-query.ts 353 ≤ 500
hooks/useSshConnection.ts 352 ≤ 500
components/DoctorTempProviderDialog.tsx 349 ≤ 500
bug_report/collector.rs 335 ≤ 500
components/InstanceCard.tsx 334 ≤ 500
lib.rs 333 ≤ 500
hooks/useWorkspaceTabs.ts 331 ≤ 500
lib/doctor-report-i18n.ts 328 ≤ 500
recipe.rs 325 ≤ 500
pages/__tests__/overview-loading.test.ts 318 ≤ 500
components/__tests__/SshFormWidget.test.tsx 312 ≤ 500
doctor.rs 303 ≤ 500
Files > 500 lines 25 trend ↓
Files over target 25 0 ⚠️

📊 Metrics defined in docs/architecture/metrics.md

@github-actions
Copy link
Contributor

github-actions bot commented Mar 19, 2026

📸 UI Screenshots

Commit: 7a06c9d5921c8c32aa8f53e20e80c7b6640f267c | Screenshots: Download artifact

Light Mode — Core Pages

Start Page Home Channels
start home channels
Recipes Cron Doctor
recipes cron doctor
Context History Chat Panel
context history chat
Settings (4 scroll positions)
Main Appearance Advanced Bottom
s1 s2 s3 s4
Start Page Sections
Overview Profiles Settings
sp1 sp2 sp3

Dark Mode

Start Home Channels Doctor
d1 d2 d3 d4
Dark mode — more pages
Recipes Cron Settings
d5 d6 d7

Responsive + Dialogs

Home 1024×680 Chat 1024×680 Create Agent
r1 r2 d1

🔧 Harness: Docker + Xvfb + tauri-driver + Selenium | 28 screenshots, 13 flows

…l contributors)

- screenshot.yml: checkout from fork repo, skip push/comment for fork PRs
- coverage.yml: skip PR comment for fork PRs (read-only GITHUB_TOKEN)
- metrics.yml: skip PR comment for fork PRs (read-only GITHUB_TOKEN)

Fork PRs still run all checks/builds/tests — only write-back steps
(pushing refs, posting PR comments) are skipped since the fork token
lacks write permissions.
- coverage.yml: save comment body as artifact for fork PR pickup
- metrics.yml: save comment body as artifact for fork PR pickup
- fork-pr-comment.yml: new workflow_run handler that downloads
  comment artifacts and posts them with write permissions

Same-repo PRs still post comments directly (no change).
Fork PRs now get full metrics/coverage visibility via the
workflow_run relay.
Download step uses continue-on-error so the workflow doesn't fail
when the upstream workflow failed before producing the comment artifact.
Subsequent steps gated on download success.
…enshot.yml

When triggered via workflow_dispatch, pull_request context fields are empty.
Use '|| github.repository' and '|| github.ref' fallbacks so manual runs
still check out the correct code.

Addresses Keith-CY's review feedback on PR #143.
@dev01lay2 dev01lay2 merged commit 648db50 into develop Mar 19, 2026
10 of 11 checks passed
dev01lay2 added a commit that referenced this pull request Mar 20, 2026
…enshot.yml

When triggered via workflow_dispatch, pull_request context fields are empty.
Use '|| github.repository' and '|| github.ref' fallbacks so manual runs
still check out the correct code.

Addresses Keith-CY's review feedback on PR #143.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants