ci: harden OfficeCLI bump PR creation#735
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe ChangesWorkflow security hardening and duplicate PR handling
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the 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. Comment |
There was a problem hiding this comment.
Suggested priority: P3 (only low-risk paths changed (.github/workflows/officecli-bump.yml, packages/opencode/test/github/officecli-bump-workflow.test.ts)).
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.
There was a problem hiding this comment.
Code Review
This pull request updates the officecli-bump-workflow tests to include assertions for a new token validation step, specific environment variables, and refined git operations such as force-with-lease. It also restricts the workflow's default permissions to contents: read. A critical issue was identified regarding the use of the --label flag with the gh pr edit command; the reviewer noted that gh pr edit requires --add-label instead, suggesting a likely bug in the underlying workflow implementation.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 @.github/workflows/officecli-bump.yml:
- Around line 260-272: The current code hides failures because `gh pr list` is
run inside an `if` assignment; instead run the command on its own line so `set
-euo pipefail` will cause the script to exit on transient failures: assign
existing_pr="$(gh pr list --state open --base dev --head "$branch" --json url
--jq '.[0].url // empty')" on its own line, then use if [ -n "$existing_pr" ] to
decide whether to call gh pr edit (the block that uses
--title/--body-file/--add-label and exits 0); do not rely on
command-substitution-in-if to suppress errors so gh pr create is not reached
when gh pr list fails.
- Around line 193-196: The fetch + push sequence can fail because git fetch
origin "$branch" doesn't create refs/remotes/origin/$branch under the repo's
custom fetch config, so --force-with-lease=refs/heads/"$branch" has no tracking
ref to compare; update the fetch step to fetch an explicit refspec for the
branch (e.g. fetch refs/heads/"$branch":refs/remotes/origin/"$branch") before
running git push --force-with-lease=refs/heads/"$branch" --set-upstream origin
"$branch" so the remote-tracking ref exists for the lease check.
🪄 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: 0fe1e065-8c96-43f0-a7ad-c4d2c3215256
📒 Files selected for processing (2)
.github/workflows/officecli-bump.ymlpackages/opencode/test/github/officecli-bump-workflow.test.ts
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Root cause / goal: - Prepare PawWork stable release v2026.5.19 from current dev. - Keep PR #735 out of this release, per release boundary. Change boundary: - Bump only packages/desktop-electron/package.json from 2026.5.18 to 2026.5.19. Verification: - Local: bun --cwd packages/desktop-electron typecheck:release - Local: git diff --check - PR #742 checks passed: ci, desktop-smoke, e2e-artifacts, CodeQL, dependency-review, lint/title/commit checks, and pr-triage. - Review threads checked before merge: none unresolved. Release follow-up: - Build macOS arm64/x64 prod artifacts through submit/finalize. - Build Windows x64 prod artifact through full release workflow. - Publish v2026.5.19 as latest stable only after assets and updater metadata verify.
Bump packages/desktop-electron/bundled-tools.json officecli.version from v1.0.93 to v1.0.102, refresh skillsTarballSha256 (933f63e5a73d3c136bacfd10f435af775355cc170ab69f4a42dbcf5648b9cb6a), and re-sync vendored skills/ with PawWork override blockquote re-injected after upstream frontmatter. Upstream skill content change this cycle is limited to switching the install URLs from raw.githubusercontent.com to the new d.officecli.ai CDN; same 10 skills, no add/remove. Why: Upstream OfficeCLI published v1.0.94 through v1.0.102 (latest on 2026-05-28). The scheduled officecli-bump workflow keeps failing at the "Create bump pull request" step (runs 26744544092 schedule, 26806907135 manual dispatch); #735 is the in-flight automation fix. This PR completes the bump handoff manually using the same script path the workflow runs, so the next release can ship a current OfficeCLI bundle without waiting on the workflow repair. Verification (local, run from a fresh worktree with bun install --frozen-lockfile): - prepare-officecli.ts: pass for darwin-arm64, darwin-x64, win32-x64, win32-arm64 ("Prepared OfficeCLI v1.0.102 for <target>") - sync-officecli-skills.ts --compute-sha: computed 933f63e5...8b9cb6a, wrote skillsTarballSha256 - sync-officecli-skills.ts: wrote 120 files across 10 skills (10 SKILL.md with override + 110 companion files), pruned 0 stale dirs - CI on PR: 31/31 checks green including Windows unit jobs Review: gemini-code-assist reviewed with no feedback; coderabbitai was rate-limited and skipped (Review skipped status); pr-priority-triage suggested P2 which was applied. Risk: No product code, release workflow, or updater behavior changes. Only the pinned OfficeCLI version and vendored skills content consumed by desktop packaging move. SHA verification gates the four bundled desktop assets. Follow-up: - #735 still tracks repairing the scheduled bump workflow's PR-creation step so future bumps land automatically. - Gemini consumer review bot officially ceases on 2026-07-17; a replacement reviewer or accepting fewer bot reviews is a separate decision.
Summary
OFFICECLI_BUMP_TOKENsecret instead ofgithub.token.GITHUB_TOKENpermissions to read-only.Why
The scheduled OfficeCLI bump run could verify assets and push
ci/officecli-bump-v1.0.93, but failed at PR creation withGitHub Actions is not permitted to create or approve pull requests. This keeps repository-wide Actions PR creation disabled while giving this one maintenance workflow a scoped bot-token path.Related Issue
No separate issue. Follow-up to #730 and the OfficeCLI automation from #330.
Human Review Status
Pending. A human should make the final merge decision after reviewing the final diff and verification evidence.
Review Focus
OFFICECLI_BUMP_TOKENis the right repository secret name and will be provisioned after merge.GITHUB_TOKENis read-only, and write operations export the dedicated secret asGH_TOKENonly after dry-run exits.ci/officecli-bump-*branch update behavior is acceptable: existing bump branches are updated with--force-with-lease, then existing PRs are edited instead of duplicated.Risk Notes
OFFICECLI_BUMP_TOKEN; without it, the workflow now fails early with a clear error before pushing a branch.ci/officecli-bump-*branch path it creates for a target OfficeCLI version.How To Verify
Screenshots or Recordings
Not needed. This is a CI workflow change with no visible UI change.
Checklist
bug,enhancement,task, ordocumentation), at least one primary routing label (app,ui,platform,harness, orci), and exactly one priority label (P0toP3), or I requested maintainer labelingdev, and my PR title and commit messages use Conventional Commits in EnglishSummary by CodeRabbit
Chores
#330." Duplicate bump handling now updates existing PRs (title/body/labels) instead of skipping.Tests