Skip to content

ci: refine PR triage and stabilize checks#959

Merged
Astro-Han merged 17 commits into
devfrom
codex/ci-labeler-triage
May 28, 2026
Merged

ci: refine PR triage and stabilize checks#959
Astro-Han merged 17 commits into
devfrom
codex/ci-labeler-triage

Conversation

@Astro-Han
Copy link
Copy Markdown
Owner

@Astro-Han Astro-Han commented May 28, 2026

Summary

  • Remove PR type labels from the synced labeler config and let pr-triage infer task only for desktop release bump-only PRs.
  • Re-run pr-triage on PR label changes so author-added type labels recover failed label-policy checks without manual reruns.
  • Stabilize prompt submit and follow-up draft handling around visible-session ownership, locale propagation, readiness gating, and injected submit helpers.
  • Harden desktop Electron install repair for CI by recognizing versioned macOS framework layouts and falling back to a direct checksum-verified Electron artifact extraction.

No GitHub issue; this follows the local STATUS.md CI labeler refactor item and includes CI follow-up fixes needed to get this PR green.

Why

Release bump PRs previously needed an enhancement workaround because a manually added task label could be removed by the labeler sync pass. Type labels should be author/script-owned, while labeler continues to own routing labels and pr-triage continues to own priority labels.

During validation, CI exposed unrelated but blocking instability in app prompt/follow-up tests and desktop Electron repair. Those fixes are included here so the PR's CI signal is clean on the current head.

Related Issue

No GitHub issue.

Human Review Status

Pending

Review Focus

Please check these four surfaces:

  • PR label ownership: release bump-only PRs get task; routing and priority behavior remain unchanged; label changes re-run pr-triage.
  • Prompt submit: visible-session ownership, readiness gates, and new-session rollback behavior remain correct.
  • Follow-up drafts: queued and direct follow-ups preserve locale and send through the injected helper contract.
  • Desktop Electron repair: macOS framework detection and direct artifact fallback are acceptable for CI repair.

Risk Notes

  • Label policy risk is limited to PR automation. Covered by script and workflow contract tests plus live pr-triage on this PR.
  • Prompt/follow-up changes affect user-visible submit behavior but not UI layout or copy. Covered by focused app tests and packages/app typecheck.
  • Desktop platform/packaging behavior is touched through the CI Electron repair script. Covered by local repair tests and live desktop-smoke on macOS arm64.
  • No dependencies, docs, credentials, destructive file behavior, generated assets, or release notes are changed.

How To Verify

node --test .github/scripts/*.test.js
Result: passed.

cd packages/opencode && npx -y bun@1.3.13 test test/github/pr-triage-workflow.test.ts
Result: 10 passed, 0 failed.

cd packages/opencode && bun test test/github/officecli-bump-workflow.test.ts
Result: passed.

cd packages/app && npx -y bun@1.3.13 test src/components/prompt-input/submit.test.ts
Result: 22 passed, 0 failed.

cd packages/app && npx -y bun@1.3.13 test src/pages/session/use-session-followups.test.ts src/components/prompt-input/submit-ownership.test.ts src/components/prompt-input/draft-isolation.integration.test.ts
Result: passed.

cd packages/app && bun run typecheck
Result: passed.

cd packages/desktop-electron && npx -y bun@1.3.13 test scripts/repair-electron-install.test.ts
Result: 11 passed, 0 failed.

GitHub Actions on head e33056b3458d
Result: ci, desktop-smoke, pr-triage, codeql, e2e-artifacts, perf-probe-baseline, dependency-review, commit-lint, and CodeRabbit all passed.

Screenshots or Recordings

Not required; no visible UI or copy changed.

Checklist

  • Type label — this PR carries exactly one of bug, enhancement, task, documentation.
  • Routing labels — this PR carries at least one of app, ui, platform, harness, ci.
  • Priority label — this PR carries exactly one of P0, P1, P2, P3.
  • Human Review Status above is set to Pending, Approved by @<reviewer>, or Not required: <reason>.
  • I linked the related issue, or stated in Summary why there is no issue.
  • I described the review focus and any meaningful risks.
  • I replaced the example block in How To Verify with the real verification steps and the key result for each.
  • I reviewed the final diff for unrelated changes and suspicious dependency changes.
  • I am targeting dev, and my PR title and commit messages use Conventional Commits in English.
  • (conditional) I considered macOS and Windows impact for platform, packaging, updater, signing, paths, shell, or permissions changes.
  • (conditional) I manually checked visible UI or copy changes when needed. Leave unticked because no visible UI or copy changed.
  • (conditional) I called out docs, release notes, dependencies, permissions, credentials, deletion behavior, generated content, or local file changes when relevant. Leave unticked because none of those surfaces changed.

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced PR triage workflow to respond to label change events for improved classification
    • Improved Electron application installation repair mechanism with artifact download and verification capabilities
  • Chores

    • Updated CI configuration for broader workflow file change detection
    • Refactored prompt submission routing to improve session state handling and navigation

@Astro-Han Astro-Han added ci Continuous integration / GitHub Actions P2 Medium priority task Narrow execution, audit, spike, migration, tracking, or upstream follow-up work labels May 28, 2026
@github-actions github-actions Bot added the harness Model harness, prompts, tool descriptions, and session mechanics label May 28, 2026
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Suggested priority: P2 (includes non-doc, non-test paths outside the low-risk bucket).

P1/P0 are reserved for maintainer confirmation. Please relabel manually if this is a release blocker, security issue, data-loss risk, or updater/runtime failure.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 28, 2026

Caution

Review failed

Failed to post review comments

📝 Walkthrough

Walkthrough

Adds PR type inference and updated label planning for release-bump PRs; changes labeler rules to route ci for broader .github/** edits and updates triage workflow/tests. Refactors prompt submission to accept injected navigation/routeParams, extracts follow-up draft helpers, injects sendFollowup into followups logic/tests, and improves macOS Electron install detection with tests.

Changes

PR Type Classification and Label Planning

Layer / File(s) Summary
Type labels and release-bump constants
.github/scripts/pr-priority-triage.js
TYPE_LABELS export and release-bump globs/required-path constants added.
Type classification and planning
.github/scripts/pr-priority-triage.js
classifyPullRequestType(paths) and planPullRequestLabels(paths, labels) infer and append task type for release-bump-only PRs when no author type label exists.
Labeler config and workflow integration
.github/labeler.yml, .github/workflows/pr-triage.yml
Labeler rule changed to ci for .github/** edits; pr-triage workflow now calls planPullRequestLabels() and listens for labeled/unlabeled events.
Labeling workflow tests
packages/opencode/test/github/pr-triage-workflow.test.ts
Tests updated to expect ci routing for workflow-config edits, require planPullRequestLabels, add labeled/unlabeled trigger types, and include release-bump-only planning tests.

Prompt submission and follow-up extraction

Layer / File(s) Summary
Component wiring and createPromptSubmit callsites
packages/app/src/components/prompt-input.tsx
Import useNavigate/useParams, create navigate and routeParams in PromptInput, and pass them into createPromptSubmit.
FollowupDraft type and helper extraction
packages/app/src/components/prompt-input/followup-draft.ts
Add exported FollowupDraft type and followupCommandText(draft) helper that concatenates prompt part content.
createPromptSubmit: injectable navigation and params
packages/app/src/components/prompt-input/submit.ts
Refactor to accept optional navigate and routeParams in PromptSubmitInput, capture stable routeParams before async awaits, and use imported followupCommandText.
Submit tests adjusted for injected routing
packages/app/src/components/prompt-input/submit.test.ts, related tests
Update tests to supply navigate and routeParams, derive local test types from createPromptSubmit, and tighten mocked client types.

Session follow-ups and persistence

Layer / File(s) Summary
createSessionFollowups injection and wiring
packages/app/src/pages/session/use-session-followups.ts, packages/app/src/pages/session/composer/session-composer-region.tsx
Add optional sendFollowup override to createSessionFollowups, import extracted followup helpers, and route dispatch through the override when provided.
Followups persistence and injection tests
packages/app/src/pages/session/use-session-followups.test.ts
Introduce PersistMock/workspaceStorage helpers, remove prior submit-module mocks, and inject sendFollowup into queued-followup and duplicate-blocking tests.
Session readiness test updates
packages/app/src/pages/session/session-action-readiness.test.ts
Statically import followupCommandText, use local FollowupDraft alias, and remove prior dynamic router mocking setup.

Desktop Electron install detection

Layer / File(s) Summary
macOS framework path detection
packages/desktop-electron/scripts/repair-electron-install.mjs
Compute a frameworkDir and check multiple candidate Electron Framework paths (including Versions/A) when determining install completeness.
Download-based repair and env wiring
packages/desktop-electron/scripts/repair-electron-install.mjs
Add downloadElectronArtifact and helpers to derive filenames/URLs, download, checksum-verify, and extract artifacts; add platform/arch env wiring and call download fallback in repair flow.
Repair and versioned framework tests
packages/desktop-electron/scripts/repair-electron-install.test.ts
Add tests to pin repair env platform/arch, assert versioned-framework detection/path writing, pass arch into repair calls, and validate artifact-download-based repair with checksum fixture stubs.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 I hopped through labels, tests, and code,
Injected routes where prompts once strode,
Follow-ups snuggled in a draft so neat,
Electron frameworks found their proper seat,
CI now wanders through .github/** with nimble feet.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 9.09% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and specifically describes the main changes: refining PR triage automation and stabilizing CI checks.
Description check ✅ Passed The PR description comprehensively covers all required template sections including Summary, Why, Related Issue, Human Review Status, Review Focus, Risk Notes, How To Verify, and a complete checklist with most items ticked.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/ci-labeler-triage

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request shifts PR type labeling from static configuration in .github/labeler.yml to dynamic script-based inference in .github/scripts/pr-priority-triage.js. It introduces automated detection for release-bump PRs as "task" types without overriding user-selected labels. A review comment suggests adding a default parameter to classifyPullRequestType to prevent potential runtime errors if called without arguments.

Comment thread .github/scripts/pr-priority-triage.js
@github-actions github-actions Bot added the app Application behavior and product flows label May 28, 2026
@github-actions github-actions Bot added the ui Design system and user interface label May 28, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 28, 2026

Perf delta summary

Comparator: pass

Profile / Scenario interaction median interaction worst long task max tbt frame gap p95 frame gap max jank count cls status
default / homepage-cold 24 -> 24 (0) 40 -> 40 (0) 80 -> 79 (-1) 30 -> 29 (-1) 33.3 -> 16.8 (-16.5) 116.7 -> 166.7 (+50) 4 -> 4 (0) 0 -> 0 (0) pass

@github-actions github-actions Bot added the platform Electron shell, OS integration, packaging, updater, signing, paths, and permissions label May 28, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/app/src/components/prompt-input/submit.test.ts`:
- Around line 3-13: The test harness has weakened types (Prompt,
PromptSubmitInputForTest, createPromptSubmit, sendFollowupDraft) using any and
forced casts; restore strong typing by importing the real types/interfaces used
by the implementation (e.g., the Prompt/Message type and the SubmitInput
contract from submit.ts or its exported types) and replace the loose definitions
with those concrete types (ensure Prompt is the correct array element type,
PromptSubmitInputForTest matches the real props like navigate: (path:
string)=>void, routeParams: ()=>{dir?:string;id?:string}, promptLength: (value:
Prompt)=>number, onQueue: (draft: DraftType)=>void). Also type
createPromptSubmit and sendFollowupDraft to the exact exported function
signatures instead of using as unknown as, and remove any stray index-signature
[key:string]: any so the compiler will surface API drift.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4abdb17c-456b-4b40-8f3a-390731ac26d0

📥 Commits

Reviewing files that changed from the base of the PR and between 57ec600 and 366e928.

📒 Files selected for processing (14)
  • .github/scripts/pr-priority-triage.js
  • packages/app/src/components/prompt-input.tsx
  • packages/app/src/components/prompt-input/draft-isolation.integration.test.ts
  • packages/app/src/components/prompt-input/followup-draft.ts
  • packages/app/src/components/prompt-input/submit-ownership.test.ts
  • packages/app/src/components/prompt-input/submit.test.ts
  • packages/app/src/components/prompt-input/submit.ts
  • packages/app/src/pages/session/composer/session-composer-region.tsx
  • packages/app/src/pages/session/session-action-readiness.test.ts
  • packages/app/src/pages/session/use-session-followups.test.ts
  • packages/app/src/pages/session/use-session-followups.ts
  • packages/desktop-electron/scripts/repair-electron-install.mjs
  • packages/desktop-electron/scripts/repair-electron-install.test.ts
  • packages/opencode/test/github/pr-triage-workflow.test.ts
✅ Files skipped from review due to trivial changes (2)
  • packages/app/src/pages/session/composer/session-composer-region.tsx
  • packages/app/src/components/prompt-input/submit-ownership.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/opencode/test/github/pr-triage-workflow.test.ts

Comment thread packages/app/src/components/prompt-input/submit.test.ts Outdated
@Astro-Han Astro-Han changed the title ci: infer release bump PR type labels ci: refine PR triage and stabilize checks May 28, 2026
Astro-Han added 2 commits May 28, 2026 16:19
# Conflicts:
#	packages/desktop-electron/scripts/repair-electron-install.mjs
#	packages/desktop-electron/scripts/repair-electron-install.test.ts
@Astro-Han Astro-Han merged commit 808617a into dev May 28, 2026
29 checks passed
@Astro-Han Astro-Han deleted the codex/ci-labeler-triage branch May 28, 2026 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app Application behavior and product flows ci Continuous integration / GitHub Actions harness Model harness, prompts, tool descriptions, and session mechanics P2 Medium priority platform Electron shell, OS integration, packaging, updater, signing, paths, and permissions task Narrow execution, audit, spike, migration, tracking, or upstream follow-up work ui Design system and user interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant