feat(ci): add OfficeCLI bundled-version bump workflow - #571
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 (2)
📝 WalkthroughWalkthroughAdds a new GitHub Actions workflow that checks iOfficeAI/OfficeCLI for a new release, compares it to the pinned version in packages/desktop-electron/bundled-tools.json, updates the manifest and verifies platform builds when different, and opens a bump PR to dev. Adds a Bun test validating the workflow file. ChangesOfficeCLI Bump Automation
Sequence DiagramsequenceDiagram
participant Runner as GitHub Runner
participant GHAPI as GitHub API
participant Repo as Repository
participant Script as prepare-officecli.ts
Runner->>GHAPI: Query iOfficeAI/OfficeCLI releases (latest)
GHAPI-->>Runner: Latest tag + release URL
Runner->>Repo: Read packages/desktop-electron/bundled-tools.json
Runner->>Runner: Compare pinned vs latest
alt pinned == latest
Runner->>Runner: Exit early (no changes)
else pinned != latest
Runner->>Repo: Update bundled-tools.json to latest tag
loop for each platform/arch (darwin/win32 x arm64/x64)
Runner->>Script: Run prepare-officecli.ts for platform/arch
Script-->>Runner: Verification result (success/failed)
end
Runner->>Repo: Commit & push bump branch
Runner->>GHAPI: Create PR via gh cli with body, labels, and "Closes `#330`."
GHAPI-->>Runner: PR created
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
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)
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 |
c546e37 to
5e2096f
Compare
Astro-Han
left a comment
There was a problem hiding this comment.
Opus second-pass review — PR #571
Pass after P2 fix, no remaining blockers.
Strengths
- Scope discipline: workflow modifies only
packages/desktop-electron/bundled-tools.json, with an explicit branch guardif [ "$GITHUB_REF_NAME" != "dev" ]; then exit 1; fifor non-dry runs. Release workflow contract is unchanged. dry_rundefaults to true onworkflow_dispatch. Safety-first default for a workflow that can open PRs.- Existing-PR check skips duplicate bumps cleanly (
gh pr list --state open --base dev --head "$branch"). - All four bundled desktop assets (
darwin-arm64/darwin-x64/win32-x64/win32-arm64) verified via the existingprepare-officecliscript before opening the bump PR. - Failure path is fail-red, not fail-partial: upstream asset / checksum drift will fail the workflow rather than open a half-done bump.
- All third-party actions pinned to commit SHA (
actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd,actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e,oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6), no@v6floating tags. - Contract test (
packages/opencode/test/github/officecli-bump-workflow.test.ts) pins triggers, permissions, action SHAs, manifest path, and the bump command shape — protects against silent drift. - Local dry-run with
v1.0.63 → v1.0.88on all four targets attached as verification evidence.
P2 fix (already resolved at HEAD 5e2096fef)
The earlier HEAD had actions/checkout@v6 with persist-credentials: false paired with git push --set-upstream origin "$branch", which would have failed at first non-dry-run trigger because git had no auth wiring. Now fixed by calling gh auth setup-git before the push so GH_TOKEN configures the git remote.
The contract test also pins the gh auth setup-git line so this auth wiring cannot silently regress.
Nit (no action)
- Schedule cron
17 3 * * 1(03:17 UTC every Monday). Low-frequency cadence is fine. If upstream OfficeCLI ever produces pre-release tags,releases/latestwould still skip them — acceptable for v1.
Verdict
Test-only / CI-workflow-only PR. No product code, no release workflow change, no UI/UX. Ready for engineering final from @GPT-X.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/officecli-bump.yml (1)
68-70: 💤 Low valueStep name says "Exit" but does not terminate the workflow.
This step logs a message but does not stop execution. The correct behavior is achieved because subsequent steps have
ifconditions checking version mismatch, so they are skipped. Consider renaming to something like "Log when already up to date" to match actual behavior, or add an earlyexit 0if you want to clearly end the run.🤖 Prompt for 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. In @.github/workflows/officecli-bump.yml around lines 68 - 70, The step named "Exit when already up to date" is misleading because it only logs a message and does not terminate the workflow; either rename the step to "Log when already up to date" to reflect its actual behavior or change the step to explicitly terminate the job by adding an exit (e.g., run: exit 0) so it truly stops execution; update the step title and/or its run command where the step name "Exit when already up to date" and the if condition checking steps.versions.outputs.current_version == steps.versions.outputs.latest_version appear.
🤖 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.
Nitpick comments:
In @.github/workflows/officecli-bump.yml:
- Around line 68-70: The step named "Exit when already up to date" is misleading
because it only logs a message and does not terminate the workflow; either
rename the step to "Log when already up to date" to reflect its actual behavior
or change the step to explicitly terminate the job by adding an exit (e.g., run:
exit 0) so it truly stops execution; update the step title and/or its run
command where the step name "Exit when already up to date" and the if condition
checking steps.versions.outputs.current_version ==
steps.versions.outputs.latest_version appear.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 2dff17e5-80d8-46a7-8dc3-41cf60933e47
📒 Files selected for processing (2)
.github/workflows/officecli-bump.ymlpackages/opencode/test/github/officecli-bump-workflow.test.ts
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/opencode/test/github/officecli-bump-workflow.test.ts (1)
13-15: ⚡ Quick winHarden step matching to avoid false positives with duplicate action steps.
Using
find(...)only validates the first matching step. If a secondactions/checkout/setup-node/setup-bunstep is later added with an unpinned or different ref, this test may still pass. Prefer asserting exactly one matching step (or that all matches use the expected pinned ref).Suggested tightening
- const checkout = steps.find((step) => step.uses?.startsWith("actions/checkout@")) - const setupNode = steps.find((step) => step.uses?.startsWith("actions/setup-node@")) - const setupBun = steps.find((step) => step.uses?.startsWith("oven-sh/setup-bun@")) + const checkoutSteps = steps.filter((step) => step.uses?.startsWith("actions/checkout@")) + const setupNodeSteps = steps.filter((step) => step.uses?.startsWith("actions/setup-node@")) + const setupBunSteps = steps.filter((step) => step.uses?.startsWith("oven-sh/setup-bun@")) + + expect(checkoutSteps).toHaveLength(1) + expect(setupNodeSteps).toHaveLength(1) + expect(setupBunSteps).toHaveLength(1) + + const [checkout] = checkoutSteps + const [setupNode] = setupNodeSteps + const [setupBun] = setupBunStepsAlso applies to: 35-40
🤖 Prompt for 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. In `@packages/opencode/test/github/officecli-bump-workflow.test.ts` around lines 13 - 15, The test currently uses steps.find(...) for checkout, setupNode, and setupBun which only checks the first match and can mask duplicate/incorrect steps; update the assertions to locate all matches (e.g., use steps.filter or Array.prototype.reduce) for "actions/checkout", "actions/setup-node", and "oven-sh/setup-bun" and assert there is exactly one match and that its uses value equals the expected pinned ref (or assert all matches use the pinned ref) for the variables checkout, setupNode, and setupBun to prevent false positives from duplicate actions.
🤖 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.
Nitpick comments:
In `@packages/opencode/test/github/officecli-bump-workflow.test.ts`:
- Around line 13-15: The test currently uses steps.find(...) for checkout,
setupNode, and setupBun which only checks the first match and can mask
duplicate/incorrect steps; update the assertions to locate all matches (e.g.,
use steps.filter or Array.prototype.reduce) for "actions/checkout",
"actions/setup-node", and "oven-sh/setup-bun" and assert there is exactly one
match and that its uses value equals the expected pinned ref (or assert all
matches use the pinned ref) for the variables checkout, setupNode, and setupBun
to prevent false positives from duplicate actions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: d56e143b-297a-4023-adf6-9486f6581592
📒 Files selected for processing (2)
.github/workflows/officecli-bump.ymlpackages/opencode/test/github/officecli-bump-workflow.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/workflows/officecli-bump.yml
There was a problem hiding this comment.
Code Review
This pull request introduces a new test suite for the officecli-bump GitHub workflow to ensure correct triggers, permissions, and pinned action versions. A review comment points out that the versions specified for Node.js (24) and Bun (1.3.13) in the test expectations are likely incorrect as they refer to unreleased or non-existent versions, and suggests using stable versions like Node 22 and Bun 1.1.34 instead.
5e2096f to
d2c0401
Compare
Summary
Add a scheduled/manual GitHub workflow that checks
iOfficeAI/OfficeCLIfor a newer release, verifies the four bundled desktop assets with the existingprepare-officecliscript, and opens a reviewable bump PR when the pinned version is behind.Why
Today the desktop release workflow only consumes the version already pinned in
packages/desktop-electron/bundled-tools.json. That is the right safety boundary for releases, but it leaves the repo without a first-class path to notice upstream OfficeCLI releases and prepare a version bump with verification attached.This PR adds that missing upgrade workflow without changing release behavior:
Related Issue
Closes #330.
Human Review Status
Pending. A human should make the final merge decision after reviewing the final diff and verification evidence.
Review Focus
packages/desktop-electron/bundled-tools.jsonand should not touch the release workflow itself.workflow_dispatchpath should supportdry_run=truefor safe manual validation without opening a PR.Risk Notes
prepare-officecli.tscontract for download + SHA256 verification, so version bumps stay aligned with the current release path.404 workflow officecli-bump.yml not found on the default branchwhen trying to rungh workflow run officecli-bump.yml --ref slock/officecli-bump-workflow -f dry_run=true. To validate the same logic pre-merge, I ran the bump path locally against the live upstream release and restored the manifest afterward.How To Verify
Screenshots or Recordings
Not needed. This is a CI automation PR with no visible UI change.
Checklist
dev, and my PR title and commit messages use Conventional Commits in EnglishSummary by CodeRabbit
New Features
Tests