Skip to content

feat: detect bun audit in scripts and CI workflows - #534

Open
YuniorGlez wants to merge 1 commit into
ambient-code:mainfrom
YuniorGlez:feat/dependency-security-bun
Open

feat: detect bun audit in scripts and CI workflows#534
YuniorGlez wants to merge 1 commit into
ambient-code:mainfrom
YuniorGlez:feat/dependency-security-bun

Conversation

@YuniorGlez

Copy link
Copy Markdown

Description

Bun projects run dependency auditing via bun audit — either as a package.json script or, more commonly, as a CI step. The JS/TS dependency scanner only reported "npm/yarn audit" and never looked at workflow files, so a Bun project with a proper audit CI step scored 0 on this signal.

Type of Change

  • New feature (non-breaking change which adds functionality)

Related Issues

No related issues (no existing Bun-support issue found; see sibling PRs #531, #532, #533).

Changes Made

  • Distinguish bun audit from npm/yarn in package.json scripts evidence (✓ bun audit configured).
  • New: detect bun|npm|yarn|pnpm audit steps in .github/workflows/*.yml|yaml (+10 pts).
  • Unit test: workflow with oven-sh/setup-bun + bun audit is detected.

Testing

  • Unit tests pass (pytest) — 178 passed
  • Manual testing performed — verified against a real Bun repo (nextjs base template)
  • No new warnings or errors — ruff clean

Checklist

  • My code follows the project's code style
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional Notes

Part of a small series adding first-class Bun support to agentready (bun.lock, CI gates, single-file verification).

Bun projects run dependency auditing via `bun audit` (in package.json
scripts or as a CI step). The JS/TS dependency scanner only reported
"npm/yarn audit" and never looked at workflow files, so a Bun project
with a proper audit CI step scored 0 on this signal.

- Distinguish `bun audit` from npm/yarn in scripts evidence.
- New: detect `bun|npm|yarn|pnpm audit` steps in .github/workflows.
- Unit test: workflow with setup-bun + bun audit is detected.
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@YuniorGlez, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 55 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

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.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 3a753b55-1cea-46a6-9827-8036b52a5258

📥 Commits

Reviewing files that changed from the base of the PR and between 3f4c01b and b880b9d.

📒 Files selected for processing (2)
  • src/agentready/assessors/security.py
  • tests/unit/test_assessors_security.py

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.

@jwm4 jwm4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks! I tested this end to end on a real repository (stranxik/runward, which runs npm audit --audit-level=high in its CI). With your change its dependency security score goes from 50 to 60, which is exactly the intended effect. I also confirmed your unit test genuinely covers the new code: removing the workflow check makes the test fail.

A few things before merging:

  1. Run black . and commit the result. That is why CI is failing. Only security.py needs reformatting.

  2. Update the documentation. The file docs/attributes.md has a Dependency Security section that lists how each tool contributes points. Please add a line for the new CI audit check (10 points) and mention bun and pnpm in the tools list, which currently only names npm and yarn audit. In this repo, docs and assessor changes are expected to land in the same PR.

  3. Update the section comment in the code. It still says the JavaScript section is worth 20 points, but with your addition it can now award 30.

  4. Optional but recommended: tighten the package.json script check while you are in there. The existing check gives credit to any script whose text contains the word "audit" anywhere. During testing I found a real repository that gets security credit because its test script runs a file named audit-corpus.js, which has nothing to do with security auditing. You already wrote the right regex for the CI check; applying the same one to script values (\b(?:npm|yarn|pnpm|bun)\s+audit\b) would fix that, and it would also make your new "bun audit configured" evidence label accurate.

This comment is from Bill Murdock, written with assistance from Claude Code.

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