Skip to content

ci: harden dependency audit checks - #990

Merged
Astro-Han merged 7 commits into
devfrom
codex/i977-ci-hardening-b
May 30, 2026
Merged

ci: harden dependency audit checks#990
Astro-Han merged 7 commits into
devfrom
codex/i977-ci-hardening-b

Conversation

@Astro-Han

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

Copy link
Copy Markdown
Owner

Summary

Harden the second #977 CI slice: remove the now-unused perf Playwright browser cache, tighten dependency-review, add a non-required Bun audit visibility check, and pin workflow Bun runtimes to the audit-verified 1.3.14.

Why

PR #988 moved perf-probe-baseline to system Chrome with Playwright video disabled, leaving the .playwright-browsers restore cache unused. The dependency review workflow was still advisory-only and its job name did not match the planned required context. bun audit is useful signal, but current dev already has high/critical advisories, so this PR adds it as a visible non-required check rather than a merge gate.

Related Issue

Closes part of #977.

Human Review Status

Pending

Review Focus

Please focus on the GitHub Actions semantics: dependency-review now emits the required check name, dev-dep-audit is intentionally not a required context, and every setup-bun workflow pin is on 1.3.14 with a contract test covering the scan.

Risk Notes

  • dev-dep-audit currently fails on the existing lockfile advisories: 34 vulnerabilities (1 critical, 33 high). It is intentionally a non-required visibility check until those are fixed or baselined.
  • Do not add dev-dep-audit to dev-merge-gate from this PR. It would block unrelated PRs.
  • dependency-review can become required after this workflow shape lands on dev, because the job now emits the dependency-review check name.
  • Screenshots/recordings skipped: no visible UI changed.

How To Verify

Workflow contract tests: 21 passed
Command: bun test test/github/perf-probe-workflow.test.ts test/github/dependency-review-workflow.test.ts test/github/bun-version-workflow.test.ts test/github/officecli-bump-workflow.test.ts test/github/ci-workflow.test.ts test/github/desktop-smoke-workflow.test.ts test/config/e2e-artifacts-workflow.test.ts

App perf workflow contract: 2 passed
Command: bun test src/testing/perf-workflow.test.ts

Root typecheck: passed
Command: bun turbo typecheck

Whitespace check: passed
Command: git diff --check origin/dev...HEAD

Perf cache sanity: passed
Command: rg -n 'PLAYWRIGHT_BROWSERS_PATH|path: \$\{\{ github\.workspace \}\}/\.playwright-browsers|playwright-\$\{\{ runner\.os \}\}-' .github/workflows/perf-probe-baseline.yml
Result: no matches

Bun pin sanity: passed
Command: rg -n 'bun-version:|packageManager' .github/workflows package.json
Result: root packageManager and all setup-bun workflow inputs are 1.3.14

Bun audit visibility check: expected failure on current lockfile
Command: bun audit --audit-level=high
Result: exits 1 with 34 vulnerabilities (1 critical, 33 high)

Ruleset readback: current dev-merge-gate remains at 8 required contexts and does not include dev-dep-audit
Command: gh api repos/Astro-Han/pawwork/rulesets/15292177 --jq '{name,enforcement,required: [.rules[] | select(.type=="required_status_checks") | .parameters.required_status_checks[]?.context]}'

Screenshots or Recordings

Not applicable. No visible UI changes.

Checklist

How to use this checklist:

  • Tick a box by replacing [ ] with [x]. Do not edit, add, or remove items.
  • The bot-applied label items can only be honestly ticked AFTER the PR is opened and the labeler / priority-triage bots have run — return to the PR description and tick them then.
  • Most items are required. The few that are conditional are explicitly marked (conditional); for those, leave unticked if they truly do not apply and explain why in Risk Notes. All other items must be ticked before requesting human review.
  • Type label — this PR carries exactly one of bug, enhancement, task, documentation. Type labels are author-added; the labeler bot does NOT assign them. Add the label in the GitHub UI, then tick this.
  • Routing labels — this PR carries at least one of app, ui, platform, harness, ci. The labeler bot assigns these on PR open based on changed paths. Confirm the bot's choice (or override if wrong), then tick this.
  • Priority label — this PR carries exactly one of P0, P1, P2, P3. The priority-triage bot suggests one on PR open. Confirm or override, then tick this.
  • Human Review Status above is set to Pending, Approved by @<reviewer>, or Not required: <reason> (default is Pending; "not required" is restricted to bot-authored low-risk PRs).
  • 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 did not introduce unrelated refactors, dependencies, generated files, or file changes beyond the stated scope.
  • (conditional) I manually checked visible UI or copy changes when needed, with screenshots or recordings. Leave unticked only if no visible UI or copy changed.
  • (conditional) I considered macOS and Windows impact for platform, packaging, updater, signing, paths, shell, or permissions changes. Leave unticked only if no platform/packaging surface was touched.
  • (conditional) I called out docs, release notes, dependencies, permissions, credentials, deletion behavior, generated content, or local file changes when relevant. Leave unticked only if none of those surfaces was touched.
  • 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.

Summary by CodeRabbit

  • Chores

    • Updated Bun runtime version from 1.3.13 to 1.3.14 across all CI/CD workflows and project configuration.
    • Removed Playwright browser caching optimization from performance baseline workflow.
  • New Features

    • Added automated dependency audit workflow for the dev branch to detect high-severity vulnerabilities.
  • Bug Fixes

    • Enhanced dependency review to actively fail PRs on high-severity security issues instead of warning only.
  • Tests

    • Added test coverage for Bun version pin consistency and GitHub Actions workflow validation.

Review Change Stack

@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 tech-debt Supplemental cleanup, maintainability, architecture, test, or quality debt context labels May 29, 2026
@coderabbitai

coderabbitai Bot commented May 29, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@Astro-Han, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 16 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f4ea1395-3ca8-4d90-91c8-b9f9b46fe6cf

📥 Commits

Reviewing files that changed from the base of the PR and between 3f4141f and 42bc2aa.

📒 Files selected for processing (3)
  • packages/opencode/test/github/bun-version-workflow.test.ts
  • packages/opencode/test/github/dependency-review-workflow.test.ts
  • packages/opencode/test/github/workflow-parser.ts
📝 Walkthrough

Walkthrough

This PR bumps Bun from 1.3.13 to 1.3.14 across all CI workflows and the package manifest, adds a new dev-dep-audit workflow for dependency scanning on dev-branch PRs, hardens dependency-review to enforce high-severity issue failures, removes Playwright caching from perf-probe, and introduces enforcement tests for version pin consistency and workflow configurations.

Changes

Bun 1.3.14 Rollout

Layer / File(s) Summary
Bun version bump across workflows and package.json
package.json, .github/workflows/build.yml, .github/workflows/ci.yml, .github/workflows/desktop-smoke.yml, .github/workflows/e2e-artifacts.yml, .github/workflows/officecli-bump.yml, .github/workflows/perf-probe-baseline.yml, .github/workflows/windows-advisory.yml
Updates Bun version from 1.3.13 to 1.3.14 in root packageManager field and across 7 CI workflow files (build-electron, 7 CI jobs, desktop-smoke, e2e-artifacts, officecli-bump, perf-probe-baseline, windows-advisory). Inline comments added to workflows note the version is tied to bun audit exit semantics and should not be bumped without re-verification.
New dev-dep-audit workflow and dependency-review hardening
.github/workflows/dev-dep-audit.yml, .github/workflows/dependency-review.yml, packages/opencode/test/github/dependency-review-workflow.test.ts
Adds dev-dep-audit workflow that runs on PRs targeting dev branch with concurrency control, installs Node 24 and Bun 1.3.14, and runs bun audit --audit-level=high. Updates dependency-review workflow: renames job key to dependency-review, removes warn-only mode, and adds fail-on-severity: high and fail-on-scopes: runtime,unknown to enforce PR failures on high-severity issues. New test parses and validates both workflows' configurations, pinned action versions, permissions, job settings, and step inputs.
Perf-probe baseline workflow Playwright cache removal
.github/workflows/perf-probe-baseline.yml
Removes workflow-level PLAYWRIGHT_BROWSERS_PATH environment variable and the actions/cache/restore step that cached $GITHUB_WORKSPACE/.playwright-browsers directory. Retains Bun version bump to 1.3.14 with audit semantics comment.
Bun version pin enforcement tests and workflow validation
packages/opencode/test/github/bun-version-workflow.test.ts, packages/opencode/test/github/officecli-bump-workflow.test.ts, packages/opencode/test/github/perf-probe-workflow.test.ts, packages/app/src/testing/perf-workflow.test.ts
Adds bun-version-workflow.test.ts to validate packageManager: bun@1.3.14 and enforce a load-bearing audit comment on all bun-version: pins in workflow files. Updates officecli-bump and perf-probe workflow tests to assert Bun 1.3.14 version. Updates perf-workflow.test.ts to expect Bun cache restore-keys instead of Playwright keys and adds assertions that Playwright environment variables and .playwright-browsers references are absent.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related issues

  • Astro-Han/pawwork#977: The PR implements PR-B CI hardening items including the Bun 1.3.14 version pin, new dev-dep-audit workflow, and tightened dependency-review behavior described in the issue.

Possibly related PRs

  • Astro-Han/pawwork#409: Introduced the windows-advisory.yml workflow that is updated in this PR with the Bun version bump.
  • Astro-Han/pawwork#634: Added the lint job to ci.yml with oven-sh/setup-bun, which this PR updates to Bun 1.3.14.
  • Astro-Han/pawwork#571: Introduced the officecli-bump workflow and its corresponding test, both updated in this PR with the Bun version bump.

Poem

🐰 A bun update hops across the workflows,
1.3.14 in every crevice it flows,
Audits now enforce, with severity high,
Playwright caches fade as we say goodbye,
One version to bind them all, tested with care! 🎯

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'ci: harden dependency audit checks' accurately and concisely describes the main change: strengthening CI dependency audit enforcement through workflow updates and Bun version pinning.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Description check ✅ Passed The PR description comprehensively follows the template with all required sections completed: Summary, Why, Related Issue, Human Review Status, Review Focus, Risk Notes, How To Verify, Screenshots/Recordings, and Checklist with 13 of 14 items ticked.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/i977-ci-hardening-b

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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.

@github-actions github-actions Bot added app Application behavior and product flows harness Model harness, prompts, tool descriptions, and session mechanics labels May 29, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested priority: P2 (includes user-path files (packages/app/src/testing/perf-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.

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

Copy link
Copy Markdown

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 updates the Bun package manager version to 1.3.14 across the repository, updates workflow tests to reflect this change, and introduces new contract tests to validate GitHub workflows, including Bun version pinning and dependency reviews. Feedback suggests enhancing the Bun version pinning test to ensure that every workflow step utilizing oven-sh/setup-bun explicitly defines a bun-version pin, preventing potential configuration drift if a pin is omitted in future workflows.

Comment thread packages/opencode/test/github/bun-version-workflow.test.ts
@Astro-Han
Astro-Han merged commit 6eb8585 into dev May 30, 2026
26 of 27 checks passed
@Astro-Han
Astro-Han deleted the codex/i977-ci-hardening-b branch May 30, 2026 02:49
Astro-Han added a commit that referenced this pull request May 30, 2026
Root cause:
- The dev `windows-advisory` run after PR #990 exposed Windows-only path separator assertions in the Bun version workflow contract.
- Windows opencode shard args used prefix-sensitive paths such as `test/git`, `test/file`, and `test/share`, which can also match sibling directories.
- A session retry test coupled disabled-tool retry semantics to a 20ms live HTTP timing window, and PR CI exposed a fake-time fixture where `completedAt` could be earlier than `triggeredAt`.

Changes:
- Normalize workflow contract paths before comparing setup-bun pins.
- Use trailing-slash shard args for prefix-sensitive Windows opencode test directories and add a generic contract guard for ambiguous shard paths.
- Add deterministic disabled-tool boundary/retry coverage and relax the live retry timeout to reduce Windows runner timing sensitivity.
- Align the global session activity test fake clock with the synthetic reminder timestamp.

Verification:
- `cd packages/opencode && bun test test/github/bun-version-workflow.test.ts test/github/ci-workflow.test.ts` -> 16 pass, 0 fail.
- `cd packages/opencode && bun test test/session/run-observability.test.ts` -> 67 pass, 0 fail.
- `cd packages/opencode && bun test test/session/run-observability.test.ts test/session/processor-effect.test.ts -t "disabled unknown tools"` -> 2 pass, 0 fail.
- `cd packages/opencode && bun test test/server/global-session-activity-list.test.ts` -> 6 pass, 0 fail.
- PR CI required checks passed after follow-up commit; `dev-dep-audit` remains a known non-gating advisory signal from existing dependency advisories.

Review follow-up:
- Addressed and resolved Gemini Code Assist feedback about `test/git/` and `test/file/`, and extended the same guard to `test/share/`.

Residual risk:
- Windows advisory itself runs on dev push, so final proof is the post-merge `windows-advisory` run on `dev`.
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 task Narrow execution, audit, spike, migration, tracking, or upstream follow-up work tech-debt Supplemental cleanup, maintainability, architecture, test, or quality debt context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant